1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

Add blocks with collapse animation instead of display all

This commit is contained in:
Rida Lali 2020-08-21 08:18:00 +02:00
parent ba636fc401
commit 2672721235

View File

@ -20,12 +20,23 @@
</label> </label>
</div> </div>
{% endif %} {% endif %}
<div class="accordion" id="accordionRoles">
<ul>
{% regroup active_memberships by roles as memberships_per_role %} {% regroup active_memberships by roles as memberships_per_role %}
{% for role in roles %} {% for role in roles %}
<li class="{% if not role.clubs %}no-club{% endif %}"> <div class="card {% if not role.clubs %}no-club{% endif %}">
<div class="card-header" id="{{ role|slugify }} ">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapse{{ role|slugify }}" aria-expanded="true" aria-controls="collapse{{ role|slugify }}">
{{ role }} {% if role.weirole %}(<em>Pour le WEI</em>){% endif %} {% if role.for_club %}(<em>Pour le club {{ role.for_club }} uniquement</em>){% endif %} {{ role }} {% if role.weirole %}(<em>Pour le WEI</em>){% endif %} {% if role.for_club %}(<em>Pour le club {{ role.for_club }} uniquement</em>){% endif %}
{% if role.clubs %}
<small><span class="badge badge-success">{% trans "Owned" %} : {{ role.clubs|join:", " }}</span></small>
{% endif %}
</button>
</h2>
</div>
<div id="collapse{{ role|slugify }}" class="collapse" aria-labelledby="{{ role|slugify }}" data-parent="#accordionRoles">
<div class="card-body">
{% if role.clubs %} {% if role.clubs %}
<div class="alert alert-success"> <div class="alert alert-success">
{% trans "Own this role in the clubs" %} {{ role.clubs|join:", " }} {% trans "Own this role in the clubs" %} {{ role.clubs|join:", " }}
@ -38,9 +49,10 @@
<em>{% trans "No associated permission" %}</em> <em>{% trans "No associated permission" %}</em>
{% endfor %} {% endfor %}
</ul> </ul>
</li> </div>
</div>
</div>
{% endfor %} {% endfor %}
</ul>
{% endblock %} {% endblock %}
{% block extrajavascript %} {% block extrajavascript %}