2020-04-25 23:20:46 +00:00
|
|
|
{% extends "base.html" %}
|
2020-08-22 08:01:22 +00:00
|
|
|
{% comment %}
|
2020-09-01 08:20:16 +00:00
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
2020-08-22 08:01:22 +00:00
|
|
|
{% endcomment %}
|
2020-04-25 23:20:46 +00:00
|
|
|
{% 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-22 08:01:22 +00:00
|
|
|
{% if user.is_authenticated %}
|
2020-08-31 19:11:00 +00:00
|
|
|
<div class="card bg-light mb-3">
|
|
|
|
<h3 class="card-header text-center">
|
|
|
|
{% trans "Users that have surnormal rights" %}
|
|
|
|
</h3>
|
|
|
|
<div class="card-body">
|
2020-08-31 19:49:02 +00:00
|
|
|
<div class="alert alert-info">
|
2020-09-01 12:33:38 +00:00
|
|
|
<i class="fa fa-info-circle"></i> {% trans "Superusers have all rights on everything, to manage the website." %}
|
2020-08-31 19:49:02 +00:00
|
|
|
</div>
|
2020-08-31 19:11:00 +00:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-head">
|
|
|
|
<h4 class="card-header text-center">
|
|
|
|
<a href="#" data-toggle="collapse" data-target="#card-superusers">{% trans "Superusers" %}</a>
|
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div class="card-body collapse show" id="card-superusers">
|
|
|
|
{% render_table superusers %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-head">
|
|
|
|
<h4 class="card-header text-center">
|
|
|
|
<a href="#" data-toggle="collapse" data-target="#card-clubs">{% trans "Club managers" %}</a>
|
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div class="card-body collapse show" id="card-clubs">
|
|
|
|
{% render_table special_memberships_table %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-08-05 19:07:31 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2020-08-31 19:11:00 +00:00
|
|
|
<div class="card bg-light">
|
|
|
|
<h3 class="card-header text-center">
|
|
|
|
{% trans "Roles description" %}
|
|
|
|
</h3>
|
2020-08-22 08:01:22 +00:00
|
|
|
<div class="card-body">
|
2020-08-31 19:11:00 +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 %}
|
|
|
|
</div>
|
|
|
|
<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 py-1" id="{{ role|slugify }} ">
|
|
|
|
<a href="#" class="text-decoration-none" 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 %}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="collapse{{ role|slugify }}" class="collapse" aria-labelledby="{{ role|slugify }}"
|
|
|
|
data-parent="#accordionRoles">
|
|
|
|
<div class="card-body">
|
|
|
|
{% if role.clubs %}
|
|
|
|
<div class="alert alert-success">
|
|
|
|
{% trans "Own this role in the clubs" %} {{ role.clubs|join:", " }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
<ul>
|
|
|
|
{% for permission in role.permissions.all %}
|
|
|
|
<li data-toggle="tooltip"
|
|
|
|
title="{% trans "Mask:" %} {{ permission.mask }}, {% trans "Query:" %} {{ permission.query }}">
|
|
|
|
<b>{{ permission }}</b> ({{ permission.get_type_display }}
|
|
|
|
{{ permission.model }}{% if permission.permanent %},
|
|
|
|
{% trans "permanent" %}{% endif %})
|
|
|
|
</li>
|
|
|
|
{% empty %}
|
|
|
|
<em>{% trans "No associated permission" %}</em>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-08-22 08:01:22 +00:00
|
|
|
{% endfor %}
|
2020-04-25 23:20:46 +00:00
|
|
|
</div>
|
2020-08-22 08:01:22 +00:00
|
|
|
</div>
|
2020-04-25 23:20:46 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block extrajavascript %}
|
2020-08-31 19:11:00 +00:00
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
|
|
|
let checkbox = $("#owned_only");
|
2020-04-25 23:20:46 +00:00
|
|
|
|
2020-08-31 19:11:00 +00:00
|
|
|
function update() {
|
|
|
|
if (checkbox.is(":checked"))
|
|
|
|
$(".no-club").addClass('d-none');
|
|
|
|
else
|
|
|
|
$(".no-club").removeClass('d-none');
|
|
|
|
}
|
2020-04-25 23:20:46 +00:00
|
|
|
|
2020-08-31 19:11:00 +00:00
|
|
|
checkbox.change(update);
|
|
|
|
update();
|
|
|
|
});
|
|
|
|
</script>
|
2020-09-01 12:33:38 +00:00
|
|
|
{% endblock %}
|