2020-04-25 23:20:46 +00:00
{% extends "base.html" %}
{% load i18n %}
2020-08-05 19:07:31 +00:00
{% load render_table from django_tables2 %}
2020-04-25 23:20:46 +00:00
{% block content %}
2020-08-05 19:07:31 +00:00
{% if user.is_authenticated %}
< h2 > {% trans "Users that have surnormal rights" %}< / h2 >
{% render_table special_memberships_table %}
< hr >
{% endif %}
< h2 > {% trans "Roles description" %}< / h2 >
2020-04-25 23:20:46 +00:00
{% if user.is_authenticated %}
< div class = "form-check" >
< label for = "owned_only" class = "form-check-label" >
< input id = "owned_only" name = "owned_only" type = "checkbox" class = "checkboxinput form-check-input" >
{% trans "Filter with roles that I have in at least one club" %}
< / label >
< / div >
{% endif %}
2020-08-05 19:07:31 +00:00
2020-04-25 23:20:46 +00:00
< ul >
{% regroup active_memberships by roles as memberships_per_role %}
{% for role in roles %}
< li class = "{% if not role.clubs %}no-club{% endif %}" >
2020-07-25 18:15:26 +00:00
{{ role }} {% if role.weirole %}(< em > Pour le WEI< / em > ){% endif %} {% if role.for_club %}(< em > Pour le club {{ role.for_club }} uniquement< / em > ){% endif %}
2020-04-25 23:20:46 +00:00
{% if role.clubs %}
< div class = "alert alert-success" >
{% trans "Own this role in the clubs" %} {{ role.clubs|join:", " }}
< / div >
{% endif %}
< ul >
2020-07-25 18:15:26 +00:00
{% for permission in role.permissions.all %}
2020-07-31 20:29:23 +00:00
< 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 >
2020-04-25 23:20:46 +00:00
{% empty %}
< em > {% trans "No associated permission" %}< / em >
{% endfor %}
< / ul >
< / li >
{% endfor %}
< / ul >
{% endblock %}
{% block extrajavascript %}
< script >
$(document).ready(function() {
let checkbox = $("#owned_only");
function update() {
if (checkbox.is(":checked"))
$(".no-club").addClass('d-none');
else
$(".no-club").removeClass('d-none');
}
checkbox.change(update);
update();
});
< / script >
{% endblock %}