Projet

Général

Profil

Télécharger (3,26 ko) Statistiques
| Branche: | Tag: | Révision:

calebasse / calebasse / personnes / templates / personnes / acces.html @ 0a4f779f

1
{% extends "personnes/base.html" %}
2

    
3
{% block extrascripts %}
4
<script src="{{ STATIC_URL }}js/calebasse.reset-button.js"></script>
5
{{ block.super }}
6
<script type="text/javascript">
7
    $(function() {
8
            $('.icon-minus').click(function() {
9
                generic_ajaxform_dialog($(this).data('id') + '/delete/', "Désactiver un utilisateur",
10
                    '#ajax-dlg', '500px', 'Oui');
11
                });
12
            $('.icon-plus').click(function() {
13
                generic_ajaxform_dialog($(this).data('id') + '/activate/', "Activer un utilisateur",
14
                    '#ajax-dlg', '500px', 'Oui');
15
                });
16
            });
17
</script>
18
{% endblock %}
19

    
20
{% block appbar %}
21
<h2>Gestion des personnes — Accès</h2>
22
<a href="../">Retourner à la gestion des personnes</a>
23

    
24
<button class="dialog-button" data-url="new/ #form-content" data-default-button="Créer">Nouvel accès</button>
25
{% endblock %}
26

    
27
{% block beforecontent %}
28
<div id="sidebar">
29
  <div>
30
    <h3>Rechercher dans les comptes</h3>
31
    <form>
32
      <label>Identifiant :
33
        <input type="text"/ name='identifier' value="{{ request.GET.identifier }}" class="focus">
34
      </label>
35
      {% if request.GET %}
36
      <div class="search-reset">
37
        <button id="search">Rechercher</button>
38
        <button id="reset" class="icon-remove-sign" title="Réinitialiser"></button>
39
      </div>
40
      {% else %}
41
        <button id="search">Rechercher</button>
42
      {% endif %}
43
    </form>
44
  </div>
45
</div>
46
{% endblock %}
47

    
48
{% block content %}
49
<div class="content">
50
  {% if active_list %}
51
  <h2>Accès actifs</h2>
52
  <table class="main" id="timetable-table">
53
    <thead>
54
    <tr>
55
      <th>Identifiant</th>
56
      <th>Courriel</th>
57
      <th>Fiche Personnel</th>
58
      <th>Roles</th>
59
      <th>Désactiver</th>
60
    </tr>
61
    </thead>
62
    <tbody>
63
   {% for object in active_list %}
64
     <tr data-pk="{{object.pk}}" id="object-{{ object.pk}}">
65
      <td>{{object.username}}</td>
66
      <td>{{object.email}}</td>
67
      {% with worker=object.userworker.worker %}
68
      <td>{% if worker %}<a href="{{ worker.get_absolute_url }}">{{ worker }}</a>{% else %}-{% endif %}</td>
69
      {% endwith %}
70
      <td>{% for role in object.groups.all %}{{ role.name }} {% endfor %}</td>
71
      <td><button class="icon-minus" data-id="{{ object.id }}"/></a></td>
72
    </tr>
73
   {% endfor %}
74
    </tbody>
75
  </table>
76
  {% else %}
77
  <p>Il n'y a aucun compte actif.</p>
78
  {% endif %}
79
  <br/>
80
  {% if inactive_list %}
81
  <h2>Accès inactifs</h2>
82
  <table class="main" id="timetable-table">
83
    <thead>
84
    <tr>
85
      <th>Identifiant</th>
86
      <th>Courriel</th>
87
      <th>Fiche Personnel</th>
88
      <th>Activer</th>
89
    </tr>
90
    </thead>
91
    <tbody>
92
   {% for object in inactive_list %}
93
     <tr data-pk="{{object.pk}}" id="object-{{ object.pk}}">
94
      <td>{{object.username}}</td>
95
      <td>{{object.email}}</td>
96
      {% with worker=object.userworker.worker %}
97
      <td>{% if worker %}<a href="{{ worker.get_absolute_url }}">{{ worker }}</a>{% else %}-{% endif %}</td>
98
      {% endwith %}
99
      <td><button class="icon-plus" data-id="{{ object.id }}"/></a></td>
100
    </tr>
101
   {% endfor %}
102
    </tbody>
103
  </table>
104
  {% else %}
105
  <p>Il n'y a aucun compte inactif.</p>
106
  {% endif %}
107
</div>
108
{% endblock %}
109

    
110
{% block dialogs %}
111
<div id="ajax-dlg" style="display: none;"></div>
112
{% endblock %}
(2-2/18)