closed periods in accordeon + styling

This commit is contained in:
Julie Lenaerts 2022-04-22 17:49:57 +02:00
parent d757e07dfc
commit 0cbcd91c3f
2 changed files with 165 additions and 156 deletions

View File

@ -30,6 +30,7 @@ div.list-with-period {
// override wrap-list // override wrap-list
div.wrap-list.periods-list { div.wrap-list.periods-list {
padding-right: 1rem;
div.wl-row { div.wl-row {
flex-wrap: nowrap; flex-wrap: nowrap;
div.wl-col { div.wl-col {
@ -63,6 +64,7 @@ div.list-with-period {
} }
div.periods-list { div.periods-list {
padding-right: 1rem;
div.title { div.title {
text-align: right; text-align: right;
div.date {} div.date {}

View File

@ -157,7 +157,6 @@
</a> </a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
{% endmacro %} {% endmacro %}
@ -218,46 +217,54 @@
{#- 'acps' is for AcCompanyingPeriodS #} {#- 'acps' is for AcCompanyingPeriodS #}
{%- set acps = [] %} {%- set acps = [] %}
{%- set acpsClosed = [] %}
{%- for acp in person.accompanyingPeriodInvolved %} {%- for acp in person.accompanyingPeriodInvolved %}
{%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', acp) %} {%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', acp) %}
{% if acp.step == 'CLOSED' %}
{%- set acpsClosed = acpsClosed|merge([acp]) %}
{% else %}
{%- set acps = acps|merge([acp]) %} {%- set acps = acps|merge([acp]) %}
{% endif %}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{# add as requestor #} {# add as requestor #}
{% if acps|length > 0 %} {% if acps|length > 0 %}
{% for acp in acps %} {% for acp in acps %}
{% if acp.step == 'CLOSED' %} {{ _self.accompanying_period(acp, person) }}
<div class="accordion" id="member_{{ acp.id }}"> {% endfor %}
{% endif %}
{% if acpsClosed|length > 0 %}
<div class="accordion" id="member_{{ person.id }}">
<div class="accordion-item"> <div class="accordion-item">
<h2 class="accordion-header" id="heading_{{ acp.id }}"> <h2 class="accordion-header" id="heading_{{ person.id }}">
<button <button
class="accordion-button collapsed" class="accordion-button collapsed"
type="button" type="button"
data-bs-toggle="collapse" data-bs-toggle="collapse"
data-bs-target="#collapse_{{ acp.id }}" data-bs-target="#collapse_{{ person.id }}"
aria-expanded="false" aria-expanded="false"
aria-controls="collapse_{{ acp.id }}"> aria-controls="collapse_{{ person.id }}">
<span class="folded">{{ 'Show closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }} ({{ 'budget.number of elements'|trans({ 'nb_items': 1 }) }})</span> <span class="folded">{{ 'Show closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }} ({{ 'budget.number of elements'|trans({ 'nb_items': 1 }) }})</span>
<span class="unfolded text-secondary">{{ 'Hide closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }}</span> <span class="unfolded text-secondary">{{ 'Hide closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }}</span>
</button> </button>
</h2> </h2>
<div id="collapse_{{ acp.id }}" <div id="collapse_{{ person.id }}"
class="accordion-collapse collapse" class="accordion-collapse collapse"
aria-labelledby="heading_{{ acp.id }}" aria-labelledby="heading_{{ person.id }}"
data-bs-parent="#nonCurrent"> data-bs-parent="#nonCurrent">
{% for acp in acpsClosed %}
{{ _self.accompanying_period(acp, person) }} {{ _self.accompanying_period(acp, person) }}
</div>
</div>
</div>
{% else %}
{{ _self.accompanying_period(acp, person) }}
{% endif %}
{% endfor %} {% endfor %}
</div>
</div>
</div>
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>