From 46c647cbb77ebeef220ec5463a5183213a298a22 Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 10:39:56 +0200 Subject: [PATCH 1/5] fixed events width --- .../Resources/views/Event/new.html.twig | 34 ++- .../Resources/views/Event/page_list.html.twig | 196 ++++++++++-------- 2 files changed, 131 insertions(+), 99 deletions(-) diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig index 12ea8f246..6412c94a5 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig @@ -1,18 +1,11 @@ -{% extends '@ChillEvent/layout.html.twig' %} - -{% block js %} - {{ encore_entry_script_tags('mod_async_upload') }} -{% endblock %} - -{% block css %} - {{ encore_entry_link_tags('mod_async_upload') }} -{% endblock %} - -{% block title 'Event creation'|trans %} - -{% block event_content -%} +{% extends '@ChillEvent/layout.html.twig' %} {% block js %} +{{ encore_entry_script_tags("mod_async_upload") }} +{% endblock %} {% block css %} +{{ encore_entry_link_tags("mod_async_upload") }} +{% endblock %} {% block title 'Event creation'|trans %} {% block event_content +-%}
-

{{ 'Event creation'|trans }}

+

{{ "Event creation" | trans }}

{{ form_start(form) }} {{ form_errors(form) }} @@ -20,7 +13,7 @@ {{ form_row(form.name) }} {{ form_row(form.date) }} - {{ form_row(form.type, { 'label': 'Event type' }) }} + {{ form_row(form.type, { label: "Event type" }) }} {{ form_row(form.moderator) }} {{ form_row(form.location) }} {{ form_row(form.organizationCost) }} @@ -30,12 +23,17 @@ diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig index f22b56c05..bb1ffa24e 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig @@ -1,92 +1,126 @@ -{% extends '@ChillEvent/layout.html.twig' %} +{% extends '@ChillEvent/layout.html.twig' %} {% block title 'Events'|trans %} {% +block js %} +{{ parent() }} +{{ encore_entry_script_tags("mod_pickentity_type") }} +{% endblock %} {% block css %} +{{ parent() }} +{{ encore_entry_link_tags("mod_pickentity_type") }} +{% endblock %} {% block content %} +
+

{{ block("title") }}

-{% block title 'Events'|trans %} + {{ filter | chill_render_filter_order_helper }} -{% block js %} - {{ parent() }} - {{ encore_entry_script_tags('mod_pickentity_type') }} -{% endblock %} - -{% block css %} - {{ parent() }} - {{ encore_entry_link_tags('mod_pickentity_type') }} -{% endblock %} - -{% block content %} -

{{ block('title') }}

- - {{ filter|chill_render_filter_order_helper }} - -{# {% if is_granted('CHILL_EVENT_CREATE') %} #} - - {# {% endif %} #} - {% if events|length > 0 %} -
- {% for e in events %} -
-
-
-
- {{ e.name }} -
-

{{ e.type.name|localize_translatable_string }}

- {% if e.moderator is not null %} -

{{ 'Moderator'|trans }}: {{ e.moderator|chill_entity_render_box }}

- {% endif %} -
-
-
-

{{ e.date|format_datetime('medium', 'medium') }}

-

{{ 'count participations to this event'|trans({'count': e.participations|length}) }}

-
-
+ {# {% if is_granted('CHILL_EVENT_CREATE') %} #} + + {# {% endif %} #} {% if events|length > 0 %} +
+ {% for e in events %} +
+
+
+
+ {{ e.name }}
- {% if e.participations|length > 0 %} -
- {{ 'Participations'|trans }} : - {% for part in e.participations|slice(0, 20) %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'person', id: part.person.id }, - action: 'show', - displayBadge: true, - buttonText: part.person|chill_entity_render_string, - isDead: part.person.deathdate is not null - } %} - {% endfor %} - {% if e.participations|length > 20 %} - {{ 'events.and_other_count_participants'|trans({'count': e.participations|length - 20}) }} - {% endif %} -
+

{{ e.type.name | localize_translatable_string }}

+ {% if e.moderator is not null %} +

+ {{ "Moderator" | trans }}: + {{ e.moderator | chill_entity_render_box }} +

{% endif %} -
-
- {{ form_start(eventForms[e.id]) }} - {{ form_widget(eventForms[e.id].person_id) }} - {{ form_end(eventForms[e.id]) }} -
-
-
-
-
-
-
    - {% if is_granted('CHILL_EVENT_UPDATE', e) %} -
  • - {% endif %} - {% if is_granted('CHILL_EVENT_UPDATE', e) %} -
  • - {% endif %} -
  • -
-
+
+
+
+

{{ e.date|format_datetime('medium', 'medium') }}

+

+ {{ 'count participations to this event'|trans({'count': e.participations|length}) }} +

- {% endfor %} +
+ {% if e.participations|length > 0 %} +
+ {{ "Participations" | trans }} : + {% for part in e.participations|slice(0, 20) %} {% include + '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'person', id: part.person.id }, action: + 'show', displayBadge: true, buttonText: + part.person|chill_entity_render_string, isDead: + part.person.deathdate is not null } %} {% endfor %} {% if + e.participations|length > 20 %} + {{ 'events.and_other_count_participants'|trans({'count': e.participations|length - 20}) }} + {% endif %} +
+ {% endif %} +
+
+ {{ form_start(eventForms[e.id]) }} + {{ form_widget(eventForms[e.id].person_id) }} + {{ form_end(eventForms[e.id]) }} +
+
+
+
+
+
    + {% if is_granted('CHILL_EVENT_UPDATE', e) %} +
  • + +
  • + {% endif %} {% if is_granted('CHILL_EVENT_UPDATE', e) %} +
  • + +
  • + {% endif %} +
  • + +
  • +
+
+
+ {% endfor %} +
{% endif %} +
- {{ chill_pagination(pagination) }} +{{ chill_pagination(pagination) }} {% endblock %} From d50d067bf79df4812a121c87647d3fe505108b3d Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 12:51:20 +0200 Subject: [PATCH 2/5] added button for moderators and fixed participant styling --- .../ChillEventBundle/Form/EventType.php | 14 ++++------ .../Resources/views/Event/edit.html.twig | 28 +++++++++++++------ .../Resources/views/Event/new.html.twig | 6 ++-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/Bundle/ChillEventBundle/Form/EventType.php b/src/Bundle/ChillEventBundle/Form/EventType.php index fe64ef12b..3363079fa 100644 --- a/src/Bundle/ChillEventBundle/Form/EventType.php +++ b/src/Bundle/ChillEventBundle/Form/EventType.php @@ -18,6 +18,7 @@ use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillDateTimeType; use Chill\MainBundle\Form\Type\CommentType; +use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Form\Type\PickUserLocationType; use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Form\Type\UserPickerType; @@ -45,14 +46,9 @@ class EventType extends AbstractType 'class' => '', ], ]) - ->add('moderator', UserPickerType::class, [ - 'center' => $options['center'], - 'role' => $options['role'], - 'placeholder' => 'Pick a moderator', - 'attr' => [ - 'class' => '', - ], - 'required' => false, + ->add('moderator', PickUserDynamicType::class, [ + 'label' => 'Pick a moderator', + ]) ->add('location', PickUserLocationType::class, [ 'label' => 'event.fields.location', @@ -68,7 +64,7 @@ class EventType extends AbstractType ], 'allow_add' => true, 'allow_delete' => true, - 'delete_empty' => fn (StoredObject $storedObject): bool => '' === $storedObject->getFilename(), + 'delete_empty' => fn(StoredObject $storedObject): bool => '' === $storedObject->getFilename(), 'button_remove_label' => 'event.form.remove_document', 'button_add_label' => 'event.form.add_document', ]) diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig index fc4001c63..b6b11878b 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig @@ -1,10 +1,14 @@ -{% extends '@ChillEvent/layout.html.twig' %} +{% extends '@ChillEvent/layout.html.twig' %} {% block js %} +{{ encore_entry_script_tags("mod_async_upload") }} +{{ encore_entry_script_tags("mod_pickentity_type") }} -{% block title 'Event edit'|trans %} +{% endblock %} {% block css %} +{{ encore_entry_link_tags("mod_async_upload") }} +{{ encore_entry_link_tags("mod_pickentity_type") }} -{% block event_content -%} +{% endblock %} {% block title 'Event edit'|trans %} {% block event_content -%}
-

{{ 'Event edit'|trans }}

+

{{ "Event edit" | trans }}

{{ form_start(edit_form) }} {{ form_errors(edit_form) }} @@ -12,7 +16,7 @@ {{ form_row(edit_form.name) }} {{ form_row(edit_form.date) }} - {{ form_row(edit_form.type, { 'label': 'Event type' }) }} + {{ form_row(edit_form.type, { label: "Event type" }) }} {{ form_row(edit_form.moderator) }} {{ form_row(edit_form.location) }} {{ form_row(edit_form.organizationCost) }} @@ -22,16 +26,22 @@ {{ form_end(edit_form) }} -
{% endblock %} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig index 6412c94a5..0fb69a4ea 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillEvent/layout.html.twig' %} {% block js %} {{ encore_entry_script_tags("mod_async_upload") }} +{{ encore_entry_script_tags("mod_pickentity_type") }} + {% endblock %} {% block css %} {{ encore_entry_link_tags("mod_async_upload") }} +{{ encore_entry_link_tags("mod_pickentity_type") }} + {% endblock %} {% block title 'Event creation'|trans %} {% block event_content -%}
@@ -12,12 +16,10 @@ {{ form_row(form.circle) }} {{ form_row(form.name) }} {{ form_row(form.date) }} - {{ form_row(form.type, { label: "Event type" }) }} {{ form_row(form.moderator) }} {{ form_row(form.location) }} {{ form_row(form.organizationCost) }} - {{ form_row(form.comment) }} {{ form_row(form.documents) }} From 651c455bdf7c52f4639473b0c5019192d632e68f Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 15:05:11 +0200 Subject: [PATCH 3/5] added translation for No item --- src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml index ffabdaa59..0bfe2b64c 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml @@ -13,13 +13,14 @@ Update document: Modifier le document Edit attributes: Modifier les propriétés du document Existing document: Document existant No document to download: Aucun document à télécharger -'Choose a document category': Choisissez une catégorie de document +"Choose a document category": Choisissez une catégorie de document No document found: Aucun document trouvé The document is successfully registered: Le document est enregistré The document is successfully updated: Le document est mis à jour Any description: Aucune description Document from person %name%: Document de l'usager %name% See the document: Voir le document +No item: Aucun document document: Any title: Aucun titre @@ -36,7 +37,6 @@ Delete document ?: Supprimer le document ? Are you sure you want to remove this document ?: Êtes-vous sûr·e de vouloir supprimer ce document ? The document is successfully removed: Le document a été supprimé - # dropzone upload File too big: Fichier trop volumineux Drop your file or click here: Cliquez ici ou faites glissez votre nouveau fichier dans cette zone From f7f7e1cb1d905b4f5fa6d9bfbc8d72060a6a1f22 Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 15:44:29 +0200 Subject: [PATCH 4/5] updated translation by changing translation in twig --- src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml | 1 - .../ChillMainBundle/Resources/views/Form/fields.html.twig | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml index 0bfe2b64c..c16c161bc 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml @@ -20,7 +20,6 @@ The document is successfully updated: Le document est mis à jour Any description: Aucune description Document from person %name%: Document de l'usager %name% See the document: Voir le document -No item: Aucun document document: Any title: Aucun titre diff --git a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig index 9c60028ad..1d0764980 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig @@ -173,10 +173,10 @@ {{ form_widget(entry) }} {{ form_errors(entry) }}
- + {% else %}
  • - {{ form.vars.empty_collection_explain|default('No item')|trans }} + {{ form.vars.empty_collection_explain|default('No entities')|trans }}
  • {% endfor %} From 30955752c34ac3b2586bed9fef5a03eda19db509 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 8 May 2024 10:28:14 +0200 Subject: [PATCH 5/5] fix pipeline and add changie --- .changes/unreleased/UX-20240508-102757.yaml | 5 +++++ src/Bundle/ChillEventBundle/Form/EventType.php | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .changes/unreleased/UX-20240508-102757.yaml diff --git a/.changes/unreleased/UX-20240508-102757.yaml b/.changes/unreleased/UX-20240508-102757.yaml new file mode 100644 index 000000000..8ba540e2d --- /dev/null +++ b/.changes/unreleased/UX-20240508-102757.yaml @@ -0,0 +1,5 @@ +kind: UX +body: Adjust certain graphical issues for better user experience +time: 2024-05-08T10:27:57.220873296+02:00 +custom: + Issue: "266" diff --git a/src/Bundle/ChillEventBundle/Form/EventType.php b/src/Bundle/ChillEventBundle/Form/EventType.php index 3363079fa..98cb5ea5e 100644 --- a/src/Bundle/ChillEventBundle/Form/EventType.php +++ b/src/Bundle/ChillEventBundle/Form/EventType.php @@ -21,7 +21,6 @@ use Chill\MainBundle\Form\Type\CommentType; use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Form\Type\PickUserLocationType; use Chill\MainBundle\Form\Type\ScopePickerType; -use Chill\MainBundle\Form\Type\UserPickerType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\MoneyType; use Symfony\Component\Form\FormBuilderInterface; @@ -48,7 +47,6 @@ class EventType extends AbstractType ]) ->add('moderator', PickUserDynamicType::class, [ 'label' => 'Pick a moderator', - ]) ->add('location', PickUserLocationType::class, [ 'label' => 'event.fields.location', @@ -64,7 +62,7 @@ class EventType extends AbstractType ], 'allow_add' => true, 'allow_delete' => true, - 'delete_empty' => fn(StoredObject $storedObject): bool => '' === $storedObject->getFilename(), + 'delete_empty' => fn (StoredObject $storedObject): bool => '' === $storedObject->getFilename(), 'button_remove_label' => 'event.form.remove_document', 'button_add_label' => 'event.form.add_document', ])