accompanyingCourse: add activities in the accompanying course summary

This commit is contained in:
nobohan 2021-06-23 21:28:42 +02:00
parent ac47a75a75
commit ab8deb036b
2 changed files with 23 additions and 15 deletions

View File

@ -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
]);
}

View File

@ -67,9 +67,9 @@
<h3>{{ p.person.firstname ~ ' ' ~ p.person.lastname }}</h3>
<p>
{% 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' %}
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ p.person.birthdate|format_date('short') }}
</p>
@ -103,9 +103,9 @@
</li>
{% if p.person.isSharingHousehold %}
<li>
<a
<a
href="{{ chill_path_add_return_path(
'chill_person_household_summary',
'chill_person_household_summary',
{ 'household_id': p.person.getCurrentHousehold.id }
) }}"
class="sc-button">
@ -128,7 +128,7 @@
{% for r in accompanyingCourse.resources %}
<div class="item-bloc">
{% if r.person %}
<div class="item-row">
<div class="item-col">
<h3>
@ -137,9 +137,9 @@
</h3>
<p>
{% 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' %}
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ r.person.birthdate|format_date('short') }}
</p>
@ -174,10 +174,10 @@
</ul>
</div>
</div>
{% endif %}
{% if r.thirdParty %}
<div class="item-row">
<div class="item-col">
<h3>
@ -214,7 +214,7 @@
</ul>
</div>
</div>
{% endif %}
</div>
{% endfor %}
@ -222,9 +222,11 @@
<h2>{{ 'Social actions'|trans }}</h2>
<h2>{{ 'Last events on accompanying course'|trans }}</h2>
{% set person = null %}
{% block contentActivity %}
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'person'} %}
{% endblock %}
{# ==> insert accompanyingCourse vue component #}
<div id="accompanying-course"></div>
<div id="accompanying-course"></div>
{% endblock %}