From d5290e4bdd2e7408aeeb034927e1d951d4ae0fc6 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 13 Dec 2021 17:25:39 +0100 Subject: [PATCH] create comments page, with menu entry, route and template --- .../Controller/AccompanyingCourseController.php | 16 ++++++++++++++++ .../Menu/AccompanyingCourseMenuBuilder.php | 7 +++++++ .../AccompanyingCourse/comment_list.html.twig | 11 +++++++++++ .../translations/messages.fr.yml | 2 ++ 4 files changed, 36 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 7d0e841cf..3de0e30f4 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -216,4 +216,20 @@ class AccompanyingCourseController extends Controller 'accompanying_period_id' => $period->getId(), ]); } + + + + /** + * Comments page of Accompanying Course section. + * + * @Route("/{_locale}/parcours/{accompanying_period_id}/comment", name="chill_person_accompanying_period_comment_list") + * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) + */ + public function commentAction(AccompanyingPeriod $accompanyingCourse): Response + { + return $this->render('@ChillPerson/AccompanyingCourse/comment_list.html.twig', [ + 'accompanyingCourse' => $accompanyingCourse, + ]); + } + } diff --git a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php index fed840954..60455b201 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -73,6 +73,13 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface ], ]) ->setExtras(['order' => 40]); + $menu->addChild($this->translator->trans('Accompanying Course Comment'), [ + 'route' => 'chill_person_accompanying_period_comment_list', + 'routeParameters' => [ + 'accompanying_period_id' => $period->getId(), + ], ]) + ->setExtras(['order' => 50]); + $workflow = $this->registry->get($period, 'accompanying_period_lifecycle'); if ($workflow->can($period, 'close')) { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig new file mode 100644 index 000000000..a81721530 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/comment_list.html.twig @@ -0,0 +1,11 @@ +{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %} + +{% block title %} + {{ 'Accompanying Course Comment list'|trans }} +{% endblock %} + +{% block content %} +
+

{{ block('title') }}

+
+{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 4a712633d..152a66ee0 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -407,6 +407,8 @@ Choose a person to locate by: Localiser auprès d'un usager concerné Associate at least one member with an household, and set an address to this household: Associez au moins un membre du parcours à un ménage, et indiquez une adresse à ce ménage. Locate by: Localiser auprès de fix it: Compléter +Accompanying Course Comment: Commentaire +Accompanying Course Comment list: Commentaires du parcours # Household Household: Ménage