From d50d067bf79df4812a121c87647d3fe505108b3d Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 12:51:20 +0200 Subject: [PATCH] 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) }}