From ab8deb036b0708ba65ae98c8589a9c465a493cf0 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 23 Jun 2021 21:28:42 +0200 Subject: [PATCH] accompanyingCourse: add activities in the accompanying course summary --- .../AccompanyingCourseController.php | 10 +++++-- .../views/AccompanyingCourse/index.html.twig | 28 ++++++++++--------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index c33fc636e..d9bc07ffb 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -75,7 +75,7 @@ class AccompanyingCourseController extends Controller return $this->redirectToRoute('chill_person_accompanying_course_edit', [ 'accompanying_period_id' => $period->getId() ]); - + } /** @@ -96,9 +96,15 @@ class AccompanyingCourseController extends Controller } } + $activities = $this->getDoctrine()->getManager()->getRepository('ChillActivityBundle:Activity')->findBy( + ['accompanyingPeriod' => $accompanyingCourse], + ['date' => 'DESC'], + ); + return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [ 'accompanyingCourse' => $accompanyingCourse, - 'withoutHousehold' => $withoutHousehold + 'withoutHousehold' => $withoutHousehold, + 'activities' => $activities ]); } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 4c3ad8b56..364f8c7fd 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -67,9 +67,9 @@

{{ p.person.firstname ~ ' ' ~ p.person.lastname }}

{% set born = (p.person.gender == 'woman') ? 'née': 'né' %} - {% set gender = (p.person.gender == 'woman') ? 'fa-venus' : + {% set gender = (p.person.gender == 'woman') ? 'fa-venus' : (p.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %} - {% set genderTitle = (p.person.gender == 'woman') ? 'femme' : + {% set genderTitle = (p.person.gender == 'woman') ? 'femme' : (p.person.gender == 'man') ? 'homme' : 'neutre' %} {{ born ~ ' le ' ~ p.person.birthdate|format_date('short') }}

@@ -103,9 +103,9 @@ {% if p.person.isSharingHousehold %}
  • - @@ -128,7 +128,7 @@ {% for r in accompanyingCourse.resources %}
    {% if r.person %} - +

    @@ -137,9 +137,9 @@

    {% set born = (r.person.gender == 'woman') ? 'née': 'né' %} - {% set gender = (r.person.gender == 'woman') ? 'fa-venus' : + {% set gender = (r.person.gender == 'woman') ? 'fa-venus' : (r.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %} - {% set genderTitle = (r.person.gender == 'woman') ? 'femme' : + {% set genderTitle = (r.person.gender == 'woman') ? 'femme' : (r.person.gender == 'homme') ? 'fa-mars' : 'neutre' %} {{ born ~ ' le ' ~ r.person.birthdate|format_date('short') }}

    @@ -174,10 +174,10 @@
    - + {% endif %} {% if r.thirdParty %} - +

    @@ -214,7 +214,7 @@

    - + {% endif %}
    {% endfor %} @@ -222,9 +222,11 @@

    {{ 'Social actions'|trans }}

    -

    {{ 'Last events on accompanying course'|trans }}

    - + {% set person = null %} + {% block contentActivity %} + {% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'person'} %} + {% endblock %} {# ==> insert accompanyingCourse vue component #} -
    +
    {% endblock %}