From 0aa909f060dc52ee72806d096202dc14081460eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 8 Jun 2021 16:55:29 +0200 Subject: [PATCH] fix misc in activity (WIP) --- .../ChillActivityBundle/Form/ActivityType.php | 5 +- .../Menu/AccompanyingCourseMenuBuilder.php | 2 +- .../Resources/views/Activity/edit.html.twig | 9 +- .../Resources/views/Activity/list.html.twig | 27 ++--- .../Resources/views/Activity/new.html.twig | 22 +++- .../Activity/newAccompanyingCourse.html.twig | 4 +- .../views/Activity/newPerson.html.twig | 2 +- .../Resources/views/Activity/show.html.twig | 106 +++++++++++++----- .../translations/messages.fr.yml | 3 + .../Entity/Embeddable/CommentEmbeddable.php | 5 + .../translations/messages.fr.yml | 3 + .../views/Entity/social_action.html.twig | 13 +++ .../Templating/Entity/SocialActionRender.php | 71 ++++++++++++ .../Household/MaxHolderValidator.php | 8 ++ 14 files changed, 225 insertions(+), 55 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/Entity/social_action.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php create mode 100644 src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolderValidator.php diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 7540d4872..9606250e6 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -31,7 +31,6 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Chill\MainBundle\Form\Type\UserPickerType; use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Form\Type\ChillDateType; - use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\CallbackTransformer; use Chill\PersonBundle\Form\DataTransformer\PersonToIdTransformer; @@ -104,7 +103,7 @@ class ActivityType extends AbstractType if ($options['accompanyingPeriod']) { $accompanyingPeriod = $options['accompanyingPeriod']; } - +dump($options['data']->getType()); if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) { $builder->add('socialIssues', EntityType::class, [ 'label' => $activityType->getLabel('socialIssues'), @@ -255,6 +254,8 @@ class ActivityType extends AbstractType 'label' => $activityType->getLabel('documents'), 'required' => $activityType->isRequired('documents'), 'allow_add' => true, + 'button_add_label' => 'activity.Insert a document', + 'button_remove_label' => 'activity.Remove a document' ]); } diff --git a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php index 402df733b..71d465b6c 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -34,7 +34,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface { $period = $parameters['accompanyingCourse']; - $menu->addChild($this->translator->trans('List of activities'), [ + $menu->addChild($this->translator->trans('Activity list'), [ 'route' => 'chill_activity_activity_list', 'routeParameters' => [ 'accompanying_period_id' => $period->getId(), diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig index b8a389015..3024148e1 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig @@ -19,12 +19,12 @@ {{ form_row(edit_form.scope) }} {% endif %} -{%- if form.socialActions is defined -%} - {{ form_row(form.socialActions) }} +{%- if edit_form.socialActions is defined -%} + {{ form_row(edit_form.socialActions) }} {% endif %} -{%- if form.socialIssues is defined -%} - {{ form_row(form.socialIssues) }} +{%- if edit_form.socialIssues is defined -%} + {{ form_row(edit_form.socialIssues) }} {% endif %} {%- if edit_form.reasons is defined -%} @@ -86,7 +86,6 @@ {% set accompanying_course_id = accompanyingCourse.id %} {% endif %} -{{ form_widget(edit_form) }}