accourse resume page: add requestor and resources informations

This commit is contained in:
2021-11-22 14:57:29 +01:00
parent 99d412adc9
commit 21b33fb4f6
3 changed files with 37 additions and 11 deletions

View File

@@ -4,15 +4,12 @@
{{ 'Resume Accompanying Course'|trans }}
{% endblock %}
{% macro button_person(person) %}
{% if person.isSharingHousehold %}
<li>
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': person.getCurrentHousehold.id }) }}"
class="btn btn-sm btn-chill-beige" title="{{ 'Show household'|trans ~ ' n° ' ~ person.getCurrentHousehold.id }}">
<i class="fa fa-home"></i>
</a>
</li>
{% endif %}
{% macro insert_onthefly(type, entity) %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id },
buttonText: entity|chill_entity_render_string
} %}
{% endmacro %}
{% block js %}
@@ -56,6 +53,32 @@
{% endif %}
</div>
<div class="col-md-6 resources mb-5">
<div class="mb-3">
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{% if accompanyingCourse.requestorPerson is not null %}
{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}
{% elseif accompanyingCourse.requestorThirdParty is not null %}
{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}
{% else %}
<span class="chill-no-data-statement">{{ 'No requestor'|trans }}</span>
{% endif %}
</div>
<div>
<h4 class="item-key">{{ 'Resources'|trans }}</h4>
{% for r in accompanyingCourse.resources %}
{% if r.person is not null %}
{{ _self.insert_onthefly('person', r.person) }}
{% elseif r.thirdParty is not null %}
{{ _self.insert_onthefly('thirdparty', r.thirdParty) }}
{% endif %}
{% endfor %}
{% if accompanyingCourse.resources is empty %}
<span class="chill-no-data-statement">{{ 'No resources'|trans }}</span>
{% endif %}
</div>
</div>
<div class="social-actions mb-5">
<h2 class="mb-3 d-none">{{ 'Last social actions'|trans }}</h2>
{% include 'ChillPersonBundle:AccompanyingCourseWork:list_recent_by_accompanying_period.html.twig' with {'buttonText': false } %}