resume: improve resources bloc

This commit is contained in:
Mathieu Jaumotte 2021-11-22 17:02:08 +01:00
parent 21b33fb4f6
commit e43d22c1e0

View File

@ -34,7 +34,8 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %} {% if accompanyingCourse.locationStatus == 'address'
or accompanyingCourse.locationStatus == 'none' %}
<div class="col-md-6 warnings mb-5"> <div class="col-md-6 warnings mb-5">
{% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %} {% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %}
</div> </div>
@ -53,31 +54,38 @@
{% endif %} {% endif %}
</div> </div>
{% if accompanyingCourse.resources is not empty
and (accompanyingCourse.requestorThirdParty is not null
or accompanyingCourse.requestorPerson is not null)
%}
<div class="col-md-6 resources mb-5"> <div class="col-md-6 resources mb-5">
<div class="mb-3"> <div class="mb-3">
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{% if accompanyingCourse.requestorPerson is not null %} {% if accompanyingCourse.requestorPerson is not null %}
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }} {{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}
{% elseif accompanyingCourse.requestorThirdParty is not null %} {% elseif accompanyingCourse.requestorThirdParty is not null %}
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }} {{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}
{% else %} {% else %}
<span class="chill-no-data-statement">{{ 'No requestor'|trans }}</span> <span class="chill-no-data-statement visually-hidden">{{ 'No requestor'|trans }}</span>
{% endif %} {% endif %}
</div> </div>
<div> <div>
<h4 class="item-key">{{ 'Resources'|trans }}</h4> {% if accompanyingCourse.resources is not empty %}
{% for r in accompanyingCourse.resources %} <h4 class="item-key">{{ 'Resources'|trans }}</h4>
{% if r.person is not null %} {% for r in accompanyingCourse.resources %}
{{ _self.insert_onthefly('person', r.person) }} {% if r.person is not null %}
{% elseif r.thirdParty is not null %} {{ _self.insert_onthefly('person', r.person) }}
{{ _self.insert_onthefly('thirdparty', r.thirdParty) }} {% elseif r.thirdParty is not null %}
{% endif %} {{ _self.insert_onthefly('thirdparty', r.thirdParty) }}
{% endfor %} {% endif %}
{% if accompanyingCourse.resources is empty %} {% endfor %}
<span class="chill-no-data-statement">{{ 'No resources'|trans }}</span> {% else %}
<span class="chill-no-data-statement visually-hidden">{{ 'No resources'|trans }}</span>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endif %}
<div class="social-actions mb-5"> <div class="social-actions mb-5">
<h2 class="mb-3 d-none">{{ 'Last social actions'|trans }}</h2> <h2 class="mb-3 d-none">{{ 'Last social actions'|trans }}</h2>