This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
calebasse/calebasse/personnes/templates/personnes/acces.html

113 lines
3.3 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "personnes/base.html" %}
{% block extrascripts %}
<script src="{{ STATIC_URL }}js/calebasse.reset-button.js"></script>
{{ block.super }}
<script type="text/javascript">
$(function() {
$('.icon-minus').click(function() {
generic_ajaxform_dialog($(this).data('id') + '/delete/', "Désactiver un utilisateur",
'#ajax-dlg', '500px', 'Oui');
});
$('.icon-plus').click(function() {
generic_ajaxform_dialog($(this).data('id') + '/activate/', "Activer un utilisateur",
'#ajax-dlg', '500px', 'Oui');
});
});
</script>
{% endblock %}
{% block appbar %}
<h2>Gestion des personnes — Accès</h2>
<a href="../">Retourner à la gestion des personnes</a>
<button class="dialog-button" data-url="new/ #form-content" data-default-button="Créer">Nouvel accès</button>
{% endblock %}
{% block beforecontent %}
<div id="sidebar">
<div>
<h3>Rechercher dans les comptes</h3>
<form>
<label>Identifiant :
<input type="text"/ name='identifier' value="{{ request.GET.identifier }}" class="focus">
</label>
{% if request.GET %}
<div class="search-reset">
<button id="search">Rechercher</button>
<button id="reset" class="icon-remove-sign" title="Réinitialiser"></button>
</div>
{% else %}
<button id="search">Rechercher</button>
{% endif %}
</form>
</div>
</div>
{% endblock %}
{% block content %}
<div class="content">
{% if active_list %}
<h2>Accès actifs</h2>
<table class="main" id="timetable-table">
<thead>
<tr>
<th>Identifiant</th>
<th>Courriel</th>
<th>Fiche Personnel</th>
<th>Roles</th>
<th>Désactiver</th>
</tr>
</thead>
<tbody>
{% for object in active_list %}
<tr data-pk="{{object.pk}}" id="object-{{ object.pk}}">
<td>{{object.username}}</td>
<td>{{object.email}}</td>
{% with worker=object.userworker.worker %}
<td>{% if worker %}<a href="{{ worker.get_absolute_url }}">{{ worker }}</a>{% else %}-{% endif %}</td>
{% endwith %}
<td>{% for role in object.groups.all %}{{ role.name }} {% endfor %}</td>
<td><button class="icon-minus" data-id="{{ object.id }}"/></a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Il n'y a aucun compte actif.</p>
{% endif %}
<br/>
{% if inactive_list %}
<h2>Accès inactifs</h2>
<table class="main" id="timetable-table">
<thead>
<tr>
<th>Identifiant</th>
<th>Courriel</th>
<th>Fiche Personnel</th>
<th>Activer</th>
</tr>
</thead>
<tbody>
{% for object in inactive_list %}
<tr data-pk="{{object.pk}}" id="object-{{ object.pk}}">
<td>{{object.username}}</td>
<td>{{object.email}}</td>
{% with worker=object.userworker.worker %}
<td>{% if worker %}<a href="{{ worker.get_absolute_url }}">{{ worker }}</a>{% else %}-{% endif %}</td>
{% endwith %}
<td><button class="icon-plus" data-id="{{ object.id }}"/></a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Il n'y a aucun compte inactif.</p>
{% endif %}
</div>
{% endblock %}
{% block dialogs %}
<div id="ajax-dlg" style="display: none;"></div>
{% endblock %}