resume page: change order for masonry blocks, don't render empty blocks

This commit is contained in:
Mathieu Jaumotte 2021-11-29 10:51:26 +01:00
parent 6ee01621c8
commit ccff346dbb

View File

@ -56,48 +56,17 @@
{% endif %}
</div>
<div class="col col-sm-6 col-lg-4 scopes mb-4">
{% if accompanyingCourse.scopes is not empty %}
<h4 class="item-key">{{ 'Scopes'|trans }}</h4>
<div>
{% for s in accompanyingCourse.scopes %}
<span>{{ s.name|localize_translatable_string|capitalize }}</span>{% if not loop.last %}, {% endif %}
{% endfor %}
</div>
{% else %}
<span class="chill-no-data-statement visually-hidden">{{ 'No scopes'|trans }}</span>
{% endif %}
</div>
<div class="col col-sm-6 col-lg-4 requestor mb-4">
{% if accompanyingCourse.requestorPerson is not null %}
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}
{% elseif accompanyingCourse.requestorThirdParty is not null %}
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}
{% else %}
<span class="chill-no-data-statement visually-hidden">{{ 'No requestor'|trans }}</span>
{% endif %}
</div>
<div class="col col-sm-6 col-lg-4 persons mb-4">
{% if accompanyingCourse.participations is not empty %}
{% if accompanyingCourse.participations is not empty %}
<div class="col col-sm-6 col-lg-4 persons mb-4">
<h4 class="item-key">{{ 'Persons associated'|trans }}</h4>
{% for r in accompanyingCourse.participations %}
{% 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 %}
{{ _self.insert_onthefly('person', r.person) }}
{% endfor %}
{% else %}
<span class="chill-no-data-statement visually-hidden">{{ 'No participations'|trans }}</span>
{% endif %}
</div>
</div>
{% endif %}
<div class="col col-sm-6 col-lg-4 resources mb-4">
{% if accompanyingCourse.resources is not empty %}
{% if accompanyingCourse.resources is not empty %}
<div class="col col-sm-6 col-lg-4 resources mb-4">
<h4 class="item-key">{{ 'Resources'|trans }}</h4>
{% for r in accompanyingCourse.resources %}
{% if r.person is not null %}
@ -106,10 +75,31 @@
{{ _self.insert_onthefly('thirdparty', r.thirdParty) }}
{% endif %}
{% endfor %}
{% else %}
<span class="chill-no-data-statement visually-hidden">{{ 'No resources'|trans }}</span>
{% endif %}
</div>
</div>
{% endif %}
{% if accompanyingCourse.scopes is not empty %}
<div class="col col-sm-6 col-lg-4 scopes mb-4">
<h4 class="item-key">{{ 'Scopes'|trans }}</h4>
<div>
{% for s in accompanyingCourse.scopes %}
<span>{{ s.name|localize_translatable_string|capitalize }}</span>{% if not loop.last %}, {% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% if accompanyingCourse.requestorPerson is not null or accompanyingCourse.requestorThirdParty is not null %}
<div class="col col-sm-6 col-lg-4 requestor mb-4">
{% if accompanyingCourse.requestorPerson is not null %}
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }}
{% elseif accompanyingCourse.requestorThirdParty is not null %}
<h4 class="item-key">{{ 'Requestor'|trans }}</h4>
{{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }}
{% endif %}
</div>
{% endif %}
</div>
<div class="social-actions my-4">