mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 15:12:25 +00:00
ACL sur les templates de logs.
This commit is contained in:
parent
077215cda7
commit
f842856878
4 changed files with 19 additions and 17 deletions
|
@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% load logs_extra %}
|
{% load logs_extra %}
|
||||||
|
{% load acl %}
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -47,14 +48,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<td>{{ revision.user }}</td>
|
<td>{{ revision.user }}</td>
|
||||||
<td>{{ revision.date_created }}</td>
|
<td>{{ revision.date_created }}</td>
|
||||||
<td>{{ revision.comment }}</td>
|
<td>{{ revision.comment }}</td>
|
||||||
{% if is_bureau %}
|
{% can_edit_history %}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' revision.id %}">
|
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' revision.id %}">
|
||||||
<i class="glyphicon glyphicon-remove"></i>
|
<i class="glyphicon glyphicon-remove"></i>
|
||||||
Annuler
|
Annuler
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% acl_end %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% load logs_extra %}
|
{% load logs_extra %}
|
||||||
|
{% load acl %}
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -51,14 +51,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</i>)
|
</i>)
|
||||||
</td>
|
</td>
|
||||||
{% if is_bureau %}
|
{% can_edit_history %}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<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="glyphicon glyphicon-remove"></i>
|
||||||
Annuler
|
Annuler
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% acl_end %}
|
||||||
</tr>
|
</tr>
|
||||||
{% elif v.version.content_type.model == 'whitelist' %}
|
{% elif v.version.content_type.model == 'whitelist' %}
|
||||||
<tr class="success">
|
<tr class="success">
|
||||||
|
@ -74,14 +74,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</i>)
|
</i>)
|
||||||
</td>
|
</td>
|
||||||
{% if is_bureau %}
|
{% can_edit_history%}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<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="glyphicon glyphicon-remove"></i>
|
||||||
Annuler
|
Annuler
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% acl_end %}
|
||||||
</tr>
|
</tr>
|
||||||
{% elif v.version.content_type.model == 'user' %}
|
{% elif v.version.content_type.model == 'user' %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -93,14 +93,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
(<i>{{ v.comment }}</i>)
|
(<i>{{ v.comment }}</i>)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% if is_bureau %}
|
{% can_edit_history %}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<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="glyphicon glyphicon-remove"></i>
|
||||||
Annuler
|
Annuler
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% acl_end %}
|
||||||
</tr>
|
</tr>
|
||||||
{% elif v.version.content_type.model == 'vente' %}
|
{% elif v.version.content_type.model == 'vente' %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -112,14 +112,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
(<i>+{{ v.version.object.duration }} mois</i>)
|
(<i>+{{ v.version.object.duration }} mois</i>)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% if is_bureau %}
|
{% can_edit_history %}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<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="glyphicon glyphicon-remove"></i>
|
||||||
Annuler
|
Annuler
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% acl_end %}
|
||||||
</tr>
|
</tr>
|
||||||
{% elif v.version.content_type.model == 'interface' %}
|
{% elif v.version.content_type.model == 'interface' %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -131,14 +131,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
(<i>{{ v.comment }}</i>)
|
(<i>{{ v.comment }}</i>)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% if is_bureau %}
|
{% can_edit_history %}
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'logs:revert-action' v.rev_id %}">
|
<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="glyphicon glyphicon-remove"></i>
|
||||||
Annuler
|
Annuler
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% acl_end %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -23,9 +23,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
|
{% load acl %}
|
||||||
|
|
||||||
{% block sidebar %}
|
{% block sidebar %}
|
||||||
{% if is_cableur %}
|
{% can_view_app logs %}
|
||||||
<a class="list-group-item list-group-item-info" href="{% url "logs:index" %}">
|
<a class="list-group-item list-group-item-info" href="{% url "logs:index" %}">
|
||||||
<i class="glyphicon glyphicon-stats"></i>
|
<i class="glyphicon glyphicon-stats"></i>
|
||||||
Résumé
|
Résumé
|
||||||
|
@ -50,5 +51,5 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<i class="glyphicon glyphicon-stats"></i>
|
<i class="glyphicon glyphicon-stats"></i>
|
||||||
Utilisateurs
|
Utilisateurs
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% acl_end %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -212,7 +212,7 @@ def acl_fct(callback, reverse):
|
||||||
@register.tag('cannot_edit_history')
|
@register.tag('cannot_edit_history')
|
||||||
def acl_history_filter(parser, token):
|
def acl_history_filter(parser, token):
|
||||||
"""Templatetag for acl checking on history."""
|
"""Templatetag for acl checking on history."""
|
||||||
tag_name,_ = token.split_contents()
|
tag_name, = token.split_contents()
|
||||||
|
|
||||||
callback = get_callback(tag_name)
|
callback = get_callback(tag_name)
|
||||||
oknodes = parser.parse(('acl_else', 'acl_end'))
|
oknodes = parser.parse(('acl_else', 'acl_end'))
|
||||||
|
|
Loading…
Reference in a new issue