mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 04:43:10 +00:00
Merge branch 'navbar' into 'master'
Passage à fontawesome See merge request federez/re2o!96
This commit is contained in:
commit
26e87451a1
57 changed files with 277 additions and 245 deletions
|
@ -1,3 +1,3 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
contributeurs = ['Gabriel Detraz', 'chirac', 'Maël Kervella', 'LEVY-FALK Hugo', 'Dalahro', 'lhark', 'root', 'Chirac', 'Hugo LEVY-FALK', 'guimoz', 'Mael Kervella', 'klafyvel', 'matthieu', 'Yoann Pietri', 'Simon Brélivet', 'chibrac', 'David Sinquin', 'Pierre Cadart', 'moamoak', 'Éloi Alain', 'FERNET Laouen', 'Hugo Levy-Falk', 'Yoann PIETRI', 'B', 'Daniel STAN', 'Eloi Alain', 'Guimoz', 'Hugo Hervieux', 'Joanne Steiner', 'Laouen Fernet', 'Lemesle', 'MICHELET matthieu', 'Nymous', 'Thibault de BOUTRAY', 'Tipunchetrhum', 'Éloi ALAIN']
|
||||
contributeurs = ['Gabriel Detraz', 'chirac', 'Maël Kervella', 'LEVY-FALK Hugo', 'Dalahro', 'lhark', 'root', 'Hugo LEVY-FALK', 'Chirac', 'guimoz', 'Mael Kervella', 'klafyvel', 'matthieu', 'Yoann Pietri', 'Simon Brélivet', 'chibrac', 'David Sinquin', 'Pierre Cadart', 'moamoak', 'Éloi Alain', 'FERNET Laouen', 'Hugo Levy-Falk', 'Joanne Steiner', 'Matthieu Michelet', 'Yoann PIETRI', 'B', 'Daniel STAN', 'Eloi Alain', 'Guimoz', 'Hugo Hervieux', 'Laouen Fernet', 'Lemesle', 'MICHELET matthieu', 'Nymous', 'Thibault de BOUTRAY', 'Tipunchetrhum', 'Éloi ALAIN']
|
|
@ -45,11 +45,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td class="text-right">
|
||||
{% can_edit article %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'cotisations:edit-article' article.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'cotisations:history' 'article' article.id %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -37,11 +37,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td class="text-right">
|
||||
{% can_edit banque %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'cotisations:edit-banque' banque.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'cotisations:history' 'banque' banque.id %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -57,21 +57,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="editionfacture">
|
||||
{% can_edit facture %}
|
||||
<li><a href="{% url 'cotisations:edit-facture' facture.id %}"><i class="glyphicon glyphicon-bitcoin"></i> Modifier</a></li>
|
||||
<li><a href="{% url 'cotisations:edit-facture' facture.id %}"><i class="fa fa-dollar-sign"></i> Modifier</a></li>
|
||||
{% acl_else %}
|
||||
<li>Facture controlée</li>
|
||||
{% acl_end %}
|
||||
{% can_delete facture %}
|
||||
<li><a href="{% url 'cotisations:del-facture' facture.id %}"><i class="glyphicon glyphicon-trash"></i> Supprimer</a></li>
|
||||
<li><a href="{% url 'cotisations:del-facture' facture.id %}"><i class="fa fa-trash"></i> Supprimer</a></li>
|
||||
{% acl_end %}
|
||||
<li><a href="{% url 'cotisations:history' 'facture' facture.id %}"><i class="glyphicon glyphicon-time"></i> Historique</a></li>
|
||||
<li><a href="{% url 'cotisations:history' 'facture' facture.id %}"><i class="fa fa-history"></i> Historique</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if facture.valid %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:facture-pdf' facture.id %}">
|
||||
<i class="glyphicon glyphicon-save"></i>
|
||||
<i class="fa fa-file-pdf"></i>
|
||||
PDF
|
||||
</a>
|
||||
{% else %}
|
||||
|
|
|
@ -37,11 +37,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td class="text-right">
|
||||
{% can_edit paiement %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'cotisations:edit-paiement' paiement.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'cotisations:history' 'paiement' paiement.id %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -56,7 +56,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% bootstrap_form_errors form %}
|
||||
<tr>
|
||||
|
||||
<td><a href="{% url "users:profil" form.instance.user.id%}" class="btn btn-primary btn-sm" role="button"><i class="glyphicon glyphicon-user"></i></a>
|
||||
<td><a href="{% url "users:profil" form.instance.user.id%}" class="btn btn-primary btn-sm" role="button"><i class="fa fa-user"></i></a>
|
||||
</td>
|
||||
<td>{{ form.instance.user.name }}</td>
|
||||
<td>{{ form.instance.user.surname }}</td>
|
||||
|
|
|
@ -31,9 +31,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des types d'articles</h2>
|
||||
{% can_create Article %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-article' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un type d'articles</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-article' %}"><i class="fa fa-cart-plus"></i> Ajouter un type d'articles</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-article' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs types d'articles</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-article' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs types d'articles</a>
|
||||
{% include "cotisations/aff_article.html" with article_list=article_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -31,9 +31,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des banques</h2>
|
||||
{% can_create Banque %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-banque' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter une banque</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-banque' %}"><i class="fa fa-cart-plus"></i> Ajouter une banque</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-banque' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer une ou plusieurs banques</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-banque' %}"><i class="fa fa-trash"></i> Supprimer une ou plusieurs banques</a>
|
||||
{% include "cotisations/aff_banque.html" with banque_list=banque_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -31,9 +31,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des types de paiements</h2>
|
||||
{% can_create Paiement %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-paiement' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un type de paiement</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:add-paiement' %}"><i class="fa fa-cart-plus"></i> Ajouter un type de paiement</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-paiement' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs types de paiements</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:del-paiement' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs types de paiements</a>
|
||||
{% include "cotisations/aff_paiement.html" with paiement_list=paiement_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -49,7 +49,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
id="id_form-0-article-remove" type="button">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
<span class="fa fa-times"></span>
|
||||
</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
@ -73,7 +73,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
id="id_form-__prefix__-article-remove" type="button">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
<span class="fa fa-times"></span>
|
||||
</button>`
|
||||
|
||||
function add_article(){
|
||||
|
|
|
@ -46,7 +46,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
id="id_form-0-article-remove" type="button">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
<span class="fa fa-times"></span>
|
||||
</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
@ -70,7 +70,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
id="id_form-__prefix__-article-remove" type="button">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
<span class="fa fa-times"></span>
|
||||
</button>`
|
||||
|
||||
function add_article(){
|
||||
|
|
|
@ -28,35 +28,35 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block sidebar %}
|
||||
{% can_change Facture pdf %}
|
||||
<a class="list-group-item list-group-item-success" href="{% url "cotisations:new-facture-pdf" %}">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<i class="fa fa-plus"></i>
|
||||
Créer une facture
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-warning" href="{% url "cotisations:control" %}">
|
||||
<i class="glyphicon glyphicon-eye-open"></i>
|
||||
<i class="fa fa-eye"></i>
|
||||
Contrôler les factures
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Facture %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Factures
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Article %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index-article" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Articles en vente
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Banque %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index-banque" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Banques
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Paiement %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "cotisations:index-paiement" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Moyens de paiement
|
||||
</a>
|
||||
{% acl_end %}
|
||||
|
|
|
@ -51,7 +51,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% can_edit_history %}
|
||||
<td>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' revision.id %}">
|
||||
<i class="glyphicon glyphicon-remove"></i>
|
||||
<i class="fa fa-times"></i>
|
||||
Annuler
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -54,7 +54,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% can_edit_history %}
|
||||
<td>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||
<i class="glyphicon glyphicon-remove"></i>
|
||||
<i class="fa fa-times"></i>
|
||||
Annuler
|
||||
</a>
|
||||
</td>
|
||||
|
@ -77,7 +77,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% can_edit_history%}
|
||||
<td>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||
<i class="glyphicon glyphicon-remove"></i>
|
||||
<i class="fa fa-times"></i>
|
||||
Annuler
|
||||
</a>
|
||||
</td>
|
||||
|
@ -96,7 +96,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% can_edit_history %}
|
||||
<td>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||
<i class="glyphicon glyphicon-remove"></i>
|
||||
<i class="fa fa-times"></i>
|
||||
Annuler
|
||||
</a>
|
||||
</td>
|
||||
|
@ -115,7 +115,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% can_edit_history %}
|
||||
<td>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||
<i class="glyphicon glyphicon-remove"></i>
|
||||
<i class="fa fa-times"></i>
|
||||
Annuler
|
||||
</a>
|
||||
</td>
|
||||
|
@ -134,7 +134,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% can_edit_history %}
|
||||
<td>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
||||
<i class="glyphicon glyphicon-remove"></i>
|
||||
<i class="fa fa-times"></i>
|
||||
Annuler
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -28,27 +28,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block sidebar %}
|
||||
{% can_view_app logs %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "logs:index" %}">
|
||||
<i class="glyphicon glyphicon-stats"></i>
|
||||
<i class="fa fa-clipboard-list"></i>
|
||||
Résumé
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-logs" %}">
|
||||
<i class="glyphicon glyphicon-stats"></i>
|
||||
<i class="fa fa-calendar-alt"></i>
|
||||
Évènements
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-general" %}">
|
||||
<i class="glyphicon glyphicon-stats"></i>
|
||||
<i class="fa fa-chart-area"></i>
|
||||
Général
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-models" %}">
|
||||
<i class="glyphicon glyphicon-stats"></i>
|
||||
<i class="fa fa-database"></i>
|
||||
Base de données
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-actions" %}">
|
||||
<i class="glyphicon glyphicon-stats"></i>
|
||||
<i class="fa fa-plug"></i>
|
||||
Actions de cablage
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "logs:stats-users" %}">
|
||||
<i class="glyphicon glyphicon-stats"></i>
|
||||
<i class="fa fa-users"></i>
|
||||
Utilisateurs
|
||||
</a>
|
||||
{% acl_end %}
|
||||
|
|
|
@ -46,9 +46,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% for machine in machines_list %}
|
||||
<tr class="info">
|
||||
<td colspan="4">
|
||||
<b>{{ machine.name|default:'<i>Pas de nom</i>' }}</b> <i class="glyphicon glyphicon-chevron-right"></i>
|
||||
<b>{{ machine.name|default:'<i>Pas de nom</i>' }}</b> <i class="fa-angle-right"></i>
|
||||
<a href="{% url 'users:profil' userid=machine.user.id %}" title="Voir le profil">
|
||||
<i class="glyphicon glyphicon-user"></i> {{ machine.user }}
|
||||
<i class="fa fa-user"></i> {{ machine.user }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
|
@ -92,7 +92,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td class="text-right">
|
||||
<div class="dropdown" style="width: 128px;">
|
||||
<button class="btn btn-primary btn-sm dropdown-toggle" type="button" id="editioninterface" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<i class="glyphicon glyphicon-edit"></i> <span class="caret"></span>
|
||||
<i class="fa fa-edit"></i> <span class="caret"></span>
|
||||
</button>
|
||||
{% include 'buttons/history.html' with href='machines:history' name='interface' id=interface.id %}
|
||||
{% can_delete interface %}
|
||||
|
@ -102,28 +102,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% can_edit interface %}
|
||||
<li>
|
||||
<a href="{% url 'machines:edit-interface' interface.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i> Editer
|
||||
<i class="fa fa-edit"></i> Editer
|
||||
</a>
|
||||
</li>
|
||||
{% acl_end %}
|
||||
{% can_create Domain interface.id %}
|
||||
<li>
|
||||
<a href="{% url 'machines:index-alias' interface.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i> Gerer les alias
|
||||
<i class="fa fa-edit"></i> Gerer les alias
|
||||
</a>
|
||||
</li>
|
||||
{% acl_end %}
|
||||
{% can_create Ipv6List interface.id %}
|
||||
<li>
|
||||
<a href="{% url 'machines:index-ipv6' interface.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i> Gerer les ipv6
|
||||
<i class="fa fa-edit"></i> Gerer les ipv6
|
||||
</a>
|
||||
</li>
|
||||
{% acl_end %}
|
||||
{% can_create OuverturePortList %}
|
||||
<li>
|
||||
<a href="{% url 'machines:port-config' interface.id%}">
|
||||
<i class="glyphicon glyphicon-edit"></i> Gerer la configuration des ports
|
||||
<i class="fa fa-edit"></i> Gerer la configuration des ports
|
||||
</a>
|
||||
</li>
|
||||
{% acl_end %}
|
||||
|
@ -158,7 +158,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;">
|
||||
<a href="http://{{ al }}">
|
||||
{{ al }}
|
||||
<i class="glyphicon glyphicon-share-alt"></i>
|
||||
<i class="fa fa-share"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
|
|
@ -29,8 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
{% block content %}
|
||||
<h2>Liste des alias de l'interface</h2>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-alias' interface_id %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un alias</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-alias' interface_id %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs alias</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-alias' interface_id %}"><i class="fa fa-plus"></i> Ajouter un alias</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-alias' interface_id %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs alias</a>
|
||||
{% include "machines/aff_alias.html" with alias_list=alias_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -32,40 +32,40 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des extensions</h2>
|
||||
{% can_create Extension %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-extension' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter une extension</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-extension' %}"><i class="fa fa-plus"></i> Ajouter une extension</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-extension' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer une ou plusieurs extensions</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-extension' %}"><i class="fa fa-trash"></i> Supprimer une ou plusieurs extensions</a>
|
||||
{% include "machines/aff_extension.html" with extension_list=extension_list %}
|
||||
|
||||
<h2>Liste des enregistrements SOA</h2>
|
||||
{% can_create SOA %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-soa' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un enregistrement SOA</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-soa' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement SOA</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-soa' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un enregistrement SOA</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-soa' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement SOA</a>
|
||||
{% include "machines/aff_soa.html" with soa_list=soa_list %}
|
||||
<h2>Liste des enregistrements MX</h2>
|
||||
{% can_create Mx %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-mx' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un enregistrement MX</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-mx' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement MX</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-mx' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un enregistrement MX</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-mx' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement MX</a>
|
||||
{% include "machines/aff_mx.html" with mx_list=mx_list %}
|
||||
<h2>Liste des enregistrements NS</h2>
|
||||
{% can_create Ns %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-ns' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un enregistrement NS</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-ns' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement NS</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-ns' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un enregistrement NS</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-ns' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement NS</a>
|
||||
{% include "machines/aff_ns.html" with ns_list=ns_list %}
|
||||
<h2>Liste des enregistrements TXT</h2>
|
||||
{% can_create Txt %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-txt' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un enregistrement TXT</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-txt' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement TXT</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-txt' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un enregistrement TXT</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-txt' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement TXT</a>
|
||||
{% include "machines/aff_txt.html" with txt_list=txt_list %}
|
||||
<h2>Liste des enregistrements SRV</h2>
|
||||
{% can_create Srv %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-srv' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un enregistrement SRV</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-srv' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement SRV</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-srv' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un enregistrement SRV</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-srv' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement SRV</a>
|
||||
{% include "machines/aff_srv.html" with srv_list=srv_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -32,9 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des types d'ip</h2>
|
||||
{% can_create IpType %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-iptype' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un type d'ip</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-iptype' %}"><i class="fa fa-plus"></i> Ajouter un type d'ip</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-iptype' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs types d'ip</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-iptype' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs types d'ip</a>
|
||||
{% include "machines/aff_iptype.html" with iptype_list=iptype_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des ipv6 de l'interface</h2>
|
||||
{% can_create Ipv6List interface_id %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-ipv6list' interface_id %}"><i class="glyphicon glyphicon-plus"></i> Ajouter une ipv6</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-ipv6list' interface_id %}"><i class="fa fa-plus"></i> Ajouter une ipv6</a>
|
||||
{% acl_end %}
|
||||
{% include "machines/aff_ipv6.html" with ipv6_list=ipv6_list %}
|
||||
<br />
|
||||
|
|
|
@ -32,9 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des types de machines</h2>
|
||||
{% can_create MachineType %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-machinetype' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un type de machine</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-machinetype' %}"><i class="fa fa-plus"></i> Ajouter un type de machine</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-machinetype' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs types de machines</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-machinetype' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs types de machines</a>
|
||||
{% include "machines/aff_machinetype.html" with machinetype_list=machinetype_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -34,9 +34,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h5>La correpondance nas-machinetype relie le type de nas à un type de machine.
|
||||
Elle est utile pour l'autoenregistrement des macs par radius, et permet de choisir le type de machine à affecter aux machines en fonction du type de nas</h5>
|
||||
{% can_create Nas %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-nas' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un type de nas</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-nas' %}"><i class="fa fa-plus"></i> Ajouter un type de nas</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-nas' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs types nas</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-nas' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs types nas</a>
|
||||
{% include "machines/aff_nas.html" with nas_list=nas_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% block content %}
|
||||
<h2>Liste des configurations de ports</h2>
|
||||
{% can_create OuverturePortList %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-portlist' %}"><i class="glyphicon glyphicon-plus"></i>Ajouter une configuration</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-portlist' %}"><i class="fa fa-plus"></i>Ajouter une configuration</a>
|
||||
{% acl_end %}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
|
|
|
@ -31,9 +31,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des services</h2>
|
||||
{% can_create machines.Service %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-service' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un service</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-service' %}"><i class="fa fa-plus"></i> Ajouter un service</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-service' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs service</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-service' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs service</a>
|
||||
{% include "machines/aff_service.html" with service_list=service_list %}
|
||||
<h2>Etat des serveurs</h2>
|
||||
{% include "machines/aff_servers.html" with servers_list=servers_list %}
|
||||
|
|
|
@ -32,9 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des vlans</h2>
|
||||
{% can_create Vlan %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-vlan' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un vlan</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-vlan' %}"><i class="fa fa-plus"></i> Ajouter un vlan</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-vlan' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs vlan</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-vlan' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs vlan</a>
|
||||
{% include "machines/aff_vlan.html" with vlan_list=vlan_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -28,49 +28,49 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block sidebar %}
|
||||
{% can_view_all Machine %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Machines
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all MachineType %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index-machinetype" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Types de machines
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Extension %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index-extension" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Extensions et zones
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all IpType %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index-iptype" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Plages d'IP
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Vlan %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index-vlan" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Vlans
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Nas %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index-nas" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Gestion des nas
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all machines.Service %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index-service" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Services (dhcp, dns...)
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all OuverturePortList %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "machines:index-portlist" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Ouverture de ports
|
||||
</a>
|
||||
{% acl_end %}
|
||||
|
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h4>Préférences utilisateur</h4>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalUser' %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
Editer
|
||||
</a>
|
||||
<p>
|
||||
|
@ -72,7 +72,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
<h4>Préférences machines</h4>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalMachine' %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
Editer
|
||||
</a>
|
||||
<p>
|
||||
|
@ -97,7 +97,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
<h4>Préférences topologie</h4>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'OptionalTopologie' %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
Editer
|
||||
</a>
|
||||
<p>
|
||||
|
@ -118,7 +118,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
<h4>Préférences generales</h4>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'GeneralOption' %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
Editer
|
||||
</a>
|
||||
<p>
|
||||
|
@ -155,7 +155,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
<h4>Données de l'association</h4>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'AssoOption' %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
Editer
|
||||
</a>
|
||||
<p>
|
||||
|
@ -192,7 +192,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
<h4>Messages personalisé dans les mails</h4>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:edit-options' 'MailMessageOption' %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
Editer
|
||||
</a>
|
||||
<p>
|
||||
|
@ -209,9 +209,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
<h2>Liste des services page d'accueil</h2>
|
||||
{% can_create preferences.Service%}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-service' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un service</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'preferences:add-service' %}"><i class="fa fa-plus"></i> Ajouter un service</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-services' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs service</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'preferences:del-services' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs service</a>
|
||||
{% include "preferences/aff_service.html" with service_list=service_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
59
re2o/acl.py
59
re2o/acl.py
|
@ -33,7 +33,13 @@ from django.contrib import messages
|
|||
from django.shortcuts import redirect
|
||||
from django.urls import reverse
|
||||
|
||||
import cotisations, logs, machines, preferences, search, topologie, users
|
||||
import cotisations
|
||||
import logs
|
||||
import machines
|
||||
import preferences
|
||||
import search
|
||||
import topologie
|
||||
import users
|
||||
|
||||
|
||||
def can_create(model):
|
||||
|
@ -46,7 +52,8 @@ def can_create(model):
|
|||
def wrapper(request, *args, **kwargs):
|
||||
can, msg = model.can_create(request.user, *args, **kwargs)
|
||||
if not can:
|
||||
messages.error(request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
messages.error(
|
||||
request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('index'))
|
||||
return view(request, *args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -67,21 +74,24 @@ def can_edit(model, *field_list):
|
|||
except model.DoesNotExist:
|
||||
messages.error(request, u"Entrée inexistante")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
can, msg = instance.can_edit(request.user)
|
||||
if not can:
|
||||
messages.error(request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
messages.error(
|
||||
request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
for field in field_list:
|
||||
can_change = getattr(instance, 'can_change_' + field)
|
||||
can, msg = can_change(request.user, *args, **kwargs)
|
||||
if not can:
|
||||
messages.error(request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
messages.error(
|
||||
request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(
|
||||
request.user.id)}
|
||||
))
|
||||
return view(request, instance, *args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -98,9 +108,11 @@ def can_change(model, *field_list):
|
|||
can_change = getattr(model, 'can_change_' + field)
|
||||
can, msg = can_change(request.user, *args, **kwargs)
|
||||
if not can:
|
||||
messages.error(request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
messages.error(
|
||||
request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(
|
||||
request.user.id)}
|
||||
))
|
||||
return view(request, *args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -121,13 +133,14 @@ def can_delete(model):
|
|||
except model.DoesNotExist:
|
||||
messages.error(request, u"Entrée inexistante")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
can, msg = instance.can_delete(request.user)
|
||||
if not can:
|
||||
messages.error(request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
messages.error(
|
||||
request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
return view(request, instance, *args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -149,7 +162,7 @@ def can_delete_set(model):
|
|||
if not instances:
|
||||
messages.error(request, "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
return view(request, instances, *args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -170,13 +183,14 @@ def can_view(model):
|
|||
except model.DoesNotExist:
|
||||
messages.error(request, u"Entrée inexistante")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
can, msg = instance.can_view(request.user)
|
||||
if not can:
|
||||
messages.error(request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
messages.error(
|
||||
request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
return view(request, instance, *args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -190,9 +204,10 @@ def can_view_all(model):
|
|||
def wrapper(request, *args, **kwargs):
|
||||
can, msg = model.can_view_all(request.user)
|
||||
if not can:
|
||||
messages.error(request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
messages.error(
|
||||
request, msg or "Vous ne pouvez pas accéder à ce menu")
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
return view(request, *args, **kwargs)
|
||||
return wrapper
|
||||
|
@ -203,15 +218,16 @@ def can_view_app(app_name):
|
|||
"""Decorator to check if an user can view an application.
|
||||
"""
|
||||
assert app_name in sys.modules.keys()
|
||||
|
||||
def decorator(view):
|
||||
def wrapper(request, *args, **kwargs):
|
||||
app = sys.modules[app_name]
|
||||
can,msg = app.can_view(request.user)
|
||||
can, msg = app.can_view(request.user)
|
||||
if can:
|
||||
return view(request, *args, **kwargs)
|
||||
messages.error(request, msg)
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
return wrapper
|
||||
return decorator
|
||||
|
@ -227,7 +243,6 @@ def can_edit_history(view):
|
|||
"Vous ne pouvez pas éditer l'historique."
|
||||
)
|
||||
return redirect(reverse('users:profil',
|
||||
kwargs={'userid':str(request.user.id)}
|
||||
kwargs={'userid': str(request.user.id)}
|
||||
))
|
||||
return wrapper
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
Write in a python file the list of all contributors sorted by number of commits.
|
||||
This list is extracted from the FedeRez gitlab repository.
|
||||
"""
|
||||
fous moi un truc adapté au dessus aussi
|
||||
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
import os
|
||||
|
|
|
@ -180,13 +180,17 @@ def get_callback(tag_name, obj=None):
|
|||
if tag_name == 'cannot_view_all':
|
||||
return acl_fct(obj.can_view_all, True)
|
||||
if tag_name == 'can_view_app':
|
||||
return acl_fct(sys.modules[obj].can_view, False)
|
||||
return acl_fct(lambda x : (not any(not sys.modules[o].can_view(x) for o in obj), None), False)
|
||||
if tag_name == 'cannot_view_app':
|
||||
return acl_fct(sys.modules[obj].can_view, True)
|
||||
return acl_fct(lambda x : (not any(not sys.modules[o].can_view(x) for o in obj), None), True)
|
||||
if tag_name == 'can_edit_history':
|
||||
return acl_fct(lambda user:(user.has_perm('admin.change_logentry'),None),False)
|
||||
if tag_name == 'cannot_edit_history':
|
||||
return acl_fct(lambda user:(user.has_perm('admin.change_logentry'),None),True)
|
||||
if tag_name == 'can_view_any_app':
|
||||
return acl_fct(lambda x : (any(sys.modules[o].can_view(x) for o in obj), None), False)
|
||||
if tag_name == 'cannot_view_any_app':
|
||||
return acl_fct(lambda x : (any(sys.modules[o].can_view(x) for o in obj), None), True)
|
||||
|
||||
raise template.TemplateSyntaxError(
|
||||
"%r tag is not a valid can_xxx tag" % tag_name
|
||||
|
@ -228,21 +232,24 @@ def acl_history_filter(parser, token):
|
|||
return AclNode(callback, oknodes, konodes)
|
||||
|
||||
|
||||
@register.tag('can_view_any_app')
|
||||
@register.tag('cannot_view_any_app')
|
||||
@register.tag('can_view_app')
|
||||
@register.tag('cannot_view_app')
|
||||
def acl_app_filter(parser, token):
|
||||
"""Templatetag for acl checking on applications."""
|
||||
try:
|
||||
tag_name, app_name = token.split_contents()
|
||||
tag_name, *app_name = token.split_contents()
|
||||
except ValueError:
|
||||
raise template.TemplateSyntaxError(
|
||||
"%r tag require 1 argument : the application"
|
||||
"%r tag require 1 argument : an application"
|
||||
% token.contents.split()[0]
|
||||
)
|
||||
if not app_name in sys.modules.keys():
|
||||
for name in app_name:
|
||||
if not name in sys.modules.keys():
|
||||
raise template.TemplateSyntaxError(
|
||||
"%r is not a registered application for acl."
|
||||
% app_name
|
||||
% name
|
||||
)
|
||||
|
||||
callback = get_callback(tag_name, app_name)
|
||||
|
|
|
@ -26,11 +26,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
{% block sidebar %}
|
||||
<a class="list-group-item list-group-item-warning" href="{% url "search:search" %}">
|
||||
<i class="glyphicon glyphicon-search"></i>
|
||||
<i class="fa fa-search"></i>
|
||||
Recherche simple
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-warning" href="{% url "search:searchp" %}">
|
||||
<i class="glyphicon glyphicon-zoom-in"></i>
|
||||
<i class="fa fa-search-plus"></i>
|
||||
Recherche avancée
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
|
|
@ -36,6 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<meta property="og:url" content="\\{{request.get_host}}" />
|
||||
<meta property="og:image" content="\\{{request.get_host}}/static/logo/re2o.png"/>
|
||||
<meta property="og:description" content="Site de gestion de réseau supporté par FedeRez." />
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
|
||||
{# Load CSS and JavaScript #}
|
||||
{% bootstrap_css %}
|
||||
<link href="/static/css/typeaheadjs.css" rel="stylesheet">
|
||||
|
@ -68,22 +69,36 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</div>
|
||||
<div class="collapse navbar-collapse" id="myNavbar">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="{% url "users:mon-profil" %}">Mon profil</a></li>
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user-circle"></i> {{request.user.pseudo|slice:":15"}} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{% url "users:mon-profil" %}"><i class="fa fa-user"></i> Mon profil</a></li>
|
||||
<li><a href="{% url 'logout' %}"><i class="fa fa-sign-out-alt"></i> Se déconnecter</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% can_view_any_app users machines cotisations %}
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-users"></i> Adhérents<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
{% can_view_app users %}
|
||||
|
||||
<li><a href="{% url "users:index" %}">Adhérents</a></li>
|
||||
<li><a href="{% url 'users:index' %}"><i class="fa fa-users"></i> Gérer les adhérents</a></li>
|
||||
{% acl_end %}
|
||||
{% can_view_app machines %}
|
||||
<li><a href="{% url "machines:index" %}">Machines</a></li>
|
||||
<li><a href="{% url 'machines:index' %}"><i class="fa fa-desktop"></i> Gérer les machines</a></li>
|
||||
{% acl_end %}
|
||||
{% can_view_app cotisations %}
|
||||
<li><a href="{% url "cotisations:index" %}">Cotisations</a></li>
|
||||
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-dollar-sign"></i> Gérer les cotisations</a></li>
|
||||
{% acl_end %}
|
||||
</ul>
|
||||
</li>
|
||||
{% acl_end %}
|
||||
{% can_view_app topologie %}
|
||||
<li><a href="{% url "topologie:index" %}">Topologie</a></li>
|
||||
<li><a href="{% url "topologie:index" %}"><i class="fa fa-sitemap"></i> Topologie</a></li>
|
||||
{% acl_end %}
|
||||
{% can_view_app logs %}
|
||||
<li><a href="{% url "logs:index" %}">Statistiques</a></li>
|
||||
<li><a href="{% url "logs:index" %}"><i class="fa fa-chart-area"></i> Statistiques</a></li>
|
||||
{% acl_end %}
|
||||
</ul>
|
||||
<div class="col-sm-3 col-md-3 navbar-right">
|
||||
|
@ -91,30 +106,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search" name="q" id="search-term" {% if search_term %}value="{{ search_term }}"{% endif %}>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
|
||||
<a href="{% url "search:searchp" %}" class="btn btn-default" role="button"><i class="glyphicon glyphicon-plus"></i></a>
|
||||
<button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
|
||||
<a href="{% url "search:searchp" %}" class="btn btn-default" role="button"><i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{% if request.user.is_authenticated %}
|
||||
<li>
|
||||
<a href="{% url 'logout' %}">
|
||||
<span class="glyphicon glyphicon-log-out"></span> Logout
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
{% if not request.user.is_authenticated %}
|
||||
{% if var_sa %}
|
||||
<li>
|
||||
<a href="{% url 'users:new-user' %}">
|
||||
<span class="glyphicon glyphicon-user"></span> Créer un compte
|
||||
<i class="fa fa-user-plus"></i> Créer un compte
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="{% url 'login' %}">
|
||||
<span class="glyphicon glyphicon-log-in"></span> Login
|
||||
<i class="fa fa-sign-in-alt"></i> Login
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
@ -123,9 +132,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="{% url 'preferences:display-options' %}">
|
||||
<span class="glyphicon glyphicon-cog"></span> Preferences
|
||||
<i class="fa fa-cogs"></i> Preferences
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'about' %}"><i class="fa fa-info-circle"></i> A propos</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% acl_end %}
|
||||
</div>
|
||||
|
@ -186,7 +198,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
<div class="list-group">
|
||||
<a class="list-group-item list-group-item-info" role="button"href="{% url "users:mon-profil" %}">
|
||||
<i class="glyphicon glyphicon-user"></i>
|
||||
<i class="fa fa-user-circle"></i>
|
||||
Voir mon profil
|
||||
</a>
|
||||
</div>
|
||||
|
@ -205,7 +217,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% endfor %}
|
||||
{% if interfaces|length > 5 %}
|
||||
<a class="list-group-item list-group-item-info" role="button" href="{% url "users:mon-profil" %}">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<i class="fa fa-plus"></i>
|
||||
Voir mes machines
|
||||
</a>
|
||||
{% endif %}
|
||||
|
|
|
@ -22,5 +22,5 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
{% endcomment %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url href id %}" title="{{ desc|default:"Ajouter" }}">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
|
|
|
@ -22,5 +22,5 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
{% endcomment %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="{{ desc|default:"Éditer" }}" href="{% url href id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-pencil-alt"></i>
|
||||
</a>
|
||||
|
|
|
@ -22,6 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
{% endcomment %}
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url href name id %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
|
||||
|
|
|
@ -31,18 +31,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% if prefix %}
|
||||
{% with prefix|add:'_'|add:col as colname %}
|
||||
<a role="button" href="{% url_insert_param request.get_full_path col=colname order='asc' %}" title="{{ desc|default:"Tri croissant" }}">
|
||||
<span class="glyphicon glyphicon-triangle-top"></span>
|
||||
<span class="fa fa-caret-up"></span>
|
||||
</a>
|
||||
<a role="button" href="{% url_insert_param request.get_full_path col=colname order='desc' %}" title="{{ desc|default:"Tri décroissant" }}">
|
||||
<span class="glyphicon glyphicon-triangle-bottom"></span>
|
||||
<span class="fa fa-caret-down"></span>
|
||||
</a>
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<a role="button" href="{% url_insert_param request.get_full_path col=col order='asc' %}" title="{{ desc|default:"Tri croissant" }}">
|
||||
<span class="glyphicon glyphicon-triangle-top"></span>
|
||||
<span class="fa fa-caret-up"></span>
|
||||
</a>
|
||||
<a role="button" href="{% url_insert_param request.get_full_path col=col order='desc' %}" title="{{ desc|default:"Tri décroissant" }}">
|
||||
<span class="glyphicon glyphicon-triangle-bottom"></span>
|
||||
<span class="fa fa-caret-down"></span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -22,5 +22,5 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
{% endcomment %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url href id %}" title="{{ desc|default:"Supprimer" }}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
|
|
|
@ -42,16 +42,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>{{room.details}}</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'room' room.pk %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
{% can_edit room %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-room' room.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_delete room %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-room' room.id %}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
</td>
|
||||
|
|
|
@ -40,16 +40,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>{{constructor_switch}}</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'constructor_switch' constructor_switch.pk %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
{% can_edit constructor_switch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-constructor-switch' constructor_switch.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_delete constructor_switch %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-constructor-switch' constructor_switch.id %}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
</td>
|
||||
|
|
|
@ -42,16 +42,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>{{model_switch.constructor}}</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'model_switch' model_switch.pk %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
{% can_edit model_switch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-model-switch' model_switch.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_delete model_switch %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-model-switch' model_switch.id %}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
</td>
|
||||
|
|
|
@ -60,16 +60,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>{{ port.details }}</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'port' port.pk %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
{% can_edit port %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-port' port.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_delete port %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-port' port.pk %}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
</td>
|
||||
|
|
|
@ -46,16 +46,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% if forloop.first %}
|
||||
<td rowspan="{{ stack.switch_set.all|length }}">
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'stack' stack.pk %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
{% can_edit stack %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-stack' stack.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_delete stack %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-stack' stack.pk %}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
</td>
|
||||
|
@ -69,16 +69,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>Aucun</td>
|
||||
<td>
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'stack' stack.pk %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
{% can_edit stack %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-stack' stack.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_delete stack %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-stack' stack.pk %}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
</td>
|
||||
|
|
|
@ -39,16 +39,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>{{stack.details}}</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-info btn-sm" role="button" title="Historique" href="{% url 'topologie:history' 'stack' stack.pk %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
</a>
|
||||
{% can_edit stack %}
|
||||
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-stack' stack.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_delete stack %}
|
||||
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-stack' stack.pk %}">
|
||||
<i class="glyphicon glyphicon-trash"></i>
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
{% acl_end %}
|
||||
</td>
|
||||
|
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Switchs</h2>
|
||||
{% can_create Switch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-switch' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un switch</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-switch' %}"><i class="fa fa-plus"></i> Ajouter un switch</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include "topologie/aff_switch.html" with switch_list=switch_list %}
|
||||
|
|
|
@ -31,13 +31,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Modèles de switches</h2>
|
||||
{% can_create ModelSwitch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-model-switch' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un modèle</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-model-switch' %}"><i class="fa fa-plus"></i> Ajouter un modèle</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include "topologie/aff_model_switch.html" with model_switch_list=model_switch_list %}
|
||||
<h2>Constructeurs de switches</h2>
|
||||
{% can_create ConstructorSwitch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-constructor-switch' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un constructeur</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-constructor-switch' %}"><i class="fa fa-plus"></i> Ajouter un constructeur</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include "topologie/aff_constructor_switch.html" with constructor_switch_list=constructor_switch_list %}
|
||||
|
|
|
@ -30,11 +30,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
{% block content %}
|
||||
<h2>Switch {{ nom_switch }}</h2>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:edit-switch' id_switch %}"><i class="glyphicon glyphicon-edit"></i> Editer</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:edit-switch' id_switch %}"><i class="fa fa-edit"></i> Editer</a>
|
||||
{% can_create Port %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-port' id_switch %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un port</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-port' id_switch %}"><i class="fa fa-plus"></i> Ajouter un port</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:create-ports' id_switch %}"><i class="glyphicon glyphicon-plus"></i> Ajouter des ports</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:create-ports' id_switch %}"><i class="fa fa-plus"></i> Ajouter des ports</a>
|
||||
{% include "topologie/aff_port.html" with port_list=port_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Chambres</h2>
|
||||
{% can_create Room %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-room' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter une chambre</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-room' %}"><i class="fa fa-plus"></i> Ajouter une chambre</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include "topologie/aff_chambres.html" with room_list=room_list %}
|
||||
|
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Stacks</h2>
|
||||
{% can_create Stack %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-stack' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter une stack</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-stack' %}"><i class="fa fa-plus"></i> Ajouter une stack</a>
|
||||
{% acl_end %}
|
||||
{% include "topologie/aff_stacks.html" with stack_list=stack_list %}
|
||||
<br />
|
||||
|
|
|
@ -26,19 +26,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
{% block sidebar %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "topologie:index-room" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Chambres
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "topologie:index" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Switchs
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "topologie:index-stack" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Stacks
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-info" href="{% url "topologie:index-model-switch" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Modèles switches et constructeurs
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
|
|
@ -52,7 +52,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<i class="text-danger">Désactivée</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><a href="{% url "users:profil" club.id%}" class="btn btn-primary btn-sm" role="button"><i class="glyphicon glyphicon-user"></i></a>
|
||||
<td><a href="{% url "users:profil" club.id%}" class="btn btn-primary btn-sm" role="button"><i class="fa fa-user"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% acl_end %}
|
||||
|
|
|
@ -77,7 +77,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<li class="list-group-item col-xs-12 col-sm-6 col-md-4" style="border:none;">
|
||||
{{user}}
|
||||
<a role="button" href="{% url 'users:del-group' user.id listright.id %}" title="{{ desc|default:"Supprimer" }}">
|
||||
<i class="glyphicon glyphicon-remove" style="color:red"></i>
|
||||
<i class="fa fa-times" style="color:red"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
|
|
@ -51,7 +51,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<i class="text-danger">Désactivée</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><a href="{% url "users:profil" user.id%}" class="btn btn-primary btn-sm" role="button"><i class="glyphicon glyphicon-user"></i></a>
|
||||
<td><a href="{% url "users:profil" user.id%}" class="btn btn-primary btn-sm" role="button"><i class="fa fa-user"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -31,9 +31,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>Liste des droits</h2>
|
||||
{% can_create ListRight %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-listright' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un droit ou groupe</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-listright' %}"><i class="fa fa-plus"></i> Ajouter un droit ou groupe</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-listright' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs droits/groupes</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-listright' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs droits/groupes</a>
|
||||
{% include "users/aff_listright.html" with listright_list=listright_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -32,9 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>Liste des Établissements</h2>
|
||||
<h5>Ensemble des établissements d'enseignement ou d'activité des utilisateurs crées</h5>
|
||||
{% can_create School %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-school' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un établissement</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-school' %}"><i class="fa fa-plus"></i> Ajouter un établissement</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-school' %}"><i class="glyphicon glyphicon-trash"></i> Supprimer un ou plusieurs établissements</a>
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-school' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs établissements</a>
|
||||
{% include "users/aff_schools.html" with school_list=school_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h5>Les service users LDAP sont des utilisateurs spéciaux qui disposent d'un accès uniquement sur le ldap pour effectuer des opération d'authentification.
|
||||
Il est recommandé de créer un service-user doté d'un login/mdp par service concerné</h5>
|
||||
{% can_create ServiceUser %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:new-serviceuser' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un service user</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:new-serviceuser' %}"><i class="fa fa-plus"></i> Ajouter un service user</a>
|
||||
{% acl_end %}
|
||||
{% include "users/aff_serviceusers.html" with serviceusers_list=serviceusers_list %}
|
||||
<br />
|
||||
|
|
|
@ -31,27 +31,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>{{ users.class_name }} : {{ users.surname }} {{users.name}}</h2>
|
||||
<div>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' users.id %}">
|
||||
<i class="glyphicon glyphicon-edit"></i>
|
||||
<i class="fa fa-edit"></i>
|
||||
Editer
|
||||
</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' users.id %}">
|
||||
<i class="glyphicon glyphicon-lock"></i>
|
||||
<i class="fa fa-lock"></i>
|
||||
Changer le mot de passe
|
||||
</a>
|
||||
{% can_change User state %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:state' users.id %}">
|
||||
<i class="glyphicon glyphicon-flash"></i>
|
||||
<i class="fa fa-id-badge"></i>
|
||||
Changer le statut
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_change User groups %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:groups' users.id %}">
|
||||
<i class="glyphicon glyphicon-ok"></i>
|
||||
<i class="fa fa-check"></i>
|
||||
Gérer les groupes
|
||||
</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-info btn-sm" role="button" href="{% url 'users:history' 'user' users.id %}">
|
||||
<i class="glyphicon glyphicon-time"></i>
|
||||
<i class="fa fa-history"></i>
|
||||
Historique
|
||||
</a>
|
||||
</div>
|
||||
|
@ -146,7 +146,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<th>Solde</th>
|
||||
<td>{{ users.solde }} €
|
||||
<a class="btn btn-primary btn-sm" style='float:right' role="button" href="{% url 'cotisations:recharge' %}">
|
||||
<i class="glyphicon glyphicon-piggy-bank"></i>
|
||||
<i class="fa fa-euro-sign"></i>
|
||||
Recharger
|
||||
</a>
|
||||
</td>
|
||||
|
@ -159,7 +159,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</table>
|
||||
{% if users.is_class_club %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-club-admin-members' users.club.id %}">
|
||||
<i class="glyphicon glyphicon-lock"></i>
|
||||
<i class="fa fa-lock"></i>
|
||||
Gérer admin et membres
|
||||
</a>
|
||||
<h3>Administrateurs du club</h3>
|
||||
|
@ -199,7 +199,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% endif %}
|
||||
<h2>Machines</h2>
|
||||
{% can_create Machine users.id %}
|
||||
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}"><i class="glyphicon glyphicon-phone"></i> Ajouter une machine</a></h4>
|
||||
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}"><i class="fa fa-desktop"></i> Ajouter une machine</a></h4>
|
||||
{% acl_end %}
|
||||
{% if machines_list %}
|
||||
{% include "machines/aff_machines.html" with machines_list=machines_list %}
|
||||
|
@ -207,21 +207,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<p>Aucune machine</p>
|
||||
{% endif %}
|
||||
<h2>Cotisations</h2>
|
||||
<h4>{% can_create Facture %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Ajouter une cotisation</a> {% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Modifier le solde</a>{% endif%}{% acl_else %}{% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new_facture_solde' user.id %}"><i class="glyphicon glyphicon-piggy-bank"></i> Ajouter une cotisation par solde</a>{% endif %}{% acl_end %}</h4>
|
||||
<h4>{% can_create Facture %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}"><i class="fa fa-euro-sign"></i> Ajouter une cotisation</a> {% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}"><i class="fa fa-euro-sign"></i> Modifier le solde</a>{% endif%}{% acl_else %}{% if user_solde %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new_facture_solde' user.id %}"><i class="fa fa-euro-sign"></i> Ajouter une cotisation par solde</a>{% endif %}{% acl_end %}</h4>
|
||||
{% if facture_list %}
|
||||
{% include "cotisations/aff_cotisations.html" with facture_list=facture_list %}
|
||||
{% else %}
|
||||
<p>Aucune facture</p>
|
||||
{% endif %}
|
||||
<h2>Bannissements</h2>
|
||||
{% can_create Ban %}<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-ban' users.id %}"><i class="glyphicon glyphicon-pushpin"></i> Ajouter un bannissement</a></h4>{% acl_end %}
|
||||
{% can_create Ban %}<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-ban' users.id %}"><i class="fa fa-ban"></i> Ajouter un bannissement</a></h4>{% acl_end %}
|
||||
{% if ban_list %}
|
||||
{% include "users/aff_bans.html" with ban_list=ban_list %}
|
||||
{% else %}
|
||||
<p>Aucun bannissement</p>
|
||||
{% endif %}
|
||||
<h2>Accès à titre gracieux :</h2>
|
||||
{% can_create Whitelist %}<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-whitelist' users.id %}"><i class="glyphicon glyphicon-flag"></i> Accorder un accès à titre gracieux</a></h4>{% acl_end %}
|
||||
{% can_create Whitelist %}<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-whitelist' users.id %}"><i class="fa fa-check-circle"></i> Accorder un accès à titre gracieux</a></h4>{% acl_end %}
|
||||
{% if white_list %}
|
||||
{% include "users/aff_whitelists.html" with white_list=white_list %}
|
||||
{% else %}
|
||||
|
|
|
@ -28,62 +28,62 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% if request.user.is_authenticated%}
|
||||
{% can_create Club %}
|
||||
<a class="list-group-item list-group-item-success" href="{% url "users:new-club" %}">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<i class="fa fa-plus"></i>
|
||||
Créer un club/association
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_create Adherent %}
|
||||
<a class="list-group-item list-group-item-success" href="{% url "users:new-user" %}">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
<i class="fa fa-user-plus"></i>
|
||||
Créer un adhérent
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% endif %}
|
||||
{% can_view_all Club %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "users:index-clubs" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Clubs et assos
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Adherent %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "users:index" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Adherents
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Ban %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "users:index-ban" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Bannissements
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all Whitelist %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "users:index-white" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Accès à titre gracieux
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all School %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "users:index-school" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Établissements
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all ListRight %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "users:index-listright" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Groupes de droits
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_view_all ServiceUser %}
|
||||
<a class="list-group-item list-group-item-info" href="{% url "users:index-serviceusers" %}">
|
||||
<i class="glyphicon glyphicon-list"></i>
|
||||
<i class="fa fa-list-ul"></i>
|
||||
Gérer les service users
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% can_change User state %}
|
||||
<a class="list-group-item list-group-item-danger" href="{% url "users:mass-archive" %}">
|
||||
<i class="glyphicon glyphicon-book"></i>
|
||||
<i class="fa fa-archive"></i>
|
||||
Archiver en masse
|
||||
</a>
|
||||
{% acl_end %}
|
||||
|
|
Loading…
Reference in a new issue