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

@ -19,28 +19,40 @@
{% trans "Filter with roles that I have in at least one club" %} {% trans "Filter with roles that I have in at least one club" %}
</label> </label>
</div> </div>
{% endif %} {% endif %}
<div class="accordion" id="accordionRoles">
{% regroup active_memberships by roles as memberships_per_role %}
{% for role in roles %}
<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 %}
{% if role.clubs %}
<small><span class="badge badge-success">{% trans "Owned" %} : {{ role.clubs|join:", " }}</span></small>
{% endif %}
</button>
</h2>
</div>
<ul> <div id="collapse{{ role|slugify }}" class="collapse" aria-labelledby="{{ role|slugify }}" data-parent="#accordionRoles">
{% regroup active_memberships by roles as memberships_per_role %} <div class="card-body">
{% for role in roles %} {% if role.clubs %}
<li class="{% if not role.clubs %}no-club{% endif %}"> <div class="alert alert-success">
{{ role }} {% if role.weirole %}(<em>Pour le WEI</em>){% endif %} {% if role.for_club %}(<em>Pour le club {{ role.for_club }} uniquement</em>){% endif %} {% trans "Own this role in the clubs" %} {{ role.clubs|join:", " }}
{% if role.clubs %} </div>
<div class="alert alert-success"> {% endif %}
{% trans "Own this role in the clubs" %} {{ role.clubs|join:", " }} <ul>
{% for permission in role.permissions.all %}
<li data-toggle="tooltip" title="{% trans "Mask:" %} {{ permission.mask }}, {% trans "Query:" %} {{ permission.query }}">{{ permission }} ({{ permission.get_type_display }} {{ permission.model }}{% if permission.permanent %}, {% trans "permanent" %}{% endif %})</li>
{% empty %}
<em>{% trans "No associated permission" %}</em>
{% endfor %}
</ul>
</div> </div>
{% endif %} </div>
<ul> </div>
{% for permission in role.permissions.all %} {% endfor %}
<li data-toggle="tooltip" title="{% trans "Mask:" %} {{ permission.mask }}, {% trans "Query:" %} {{ permission.query }}">{{ permission }} ({{ permission.get_type_display }} {{ permission.model }}{% if permission.permanent %}, {% trans "permanent" %}{% endif %})</li>
{% empty %}
<em>{% trans "No associated permission" %}</em>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% endblock %} {% endblock %}
{% block extrajavascript %} {% block extrajavascript %}