8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-04 17:06:27 +00:00

Improve handling of detailed history button

This commit is contained in:
Jean-Romain Garnier 2020-04-23 18:43:34 +02:00 committed by Jean-Romain Garnier
parent 1f5fa4b43e
commit c4e034a5a6
4 changed files with 7 additions and 6 deletions

View file

@ -42,7 +42,7 @@ def is_facture(baseinvoice):
@register.inclusion_tag("buttons/history.html")
def history_button(instance, text=False, html_class=True):
def history_button(instance, text=False, detailed=False, html_class=True):
"""Creates the correct history button for an instance.
Args:
@ -57,5 +57,6 @@ def history_button(instance, text=False, html_class=True):
"name": instance._meta.model_name,
"id": instance.id,
"text": text,
"detailed": detailed,
"class": html_class,
}

View file

@ -67,7 +67,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Create an interface" as tr_create_an_interface %}
{% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc=tr_create_an_interface %}
{% acl_end %}
{% history_button machine %}
{% history_button machine detailed=True %}
{% can_delete machine %}
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
{% acl_end %}
@ -161,7 +161,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% acl_end %}
</ul>
</div>
{% history_button interface %}
{% history_button interface detailed=True %}
{% can_delete interface %}
{% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
{% acl_end %}

View file

@ -24,8 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% if name == "user" %}
<a {% if class%}class="btn btn-info btn-sm"{% endif %} role="button" title="{% trans "History" %}" href="{% url 'logs:user-history' id %}">
{% if detailed %}
<a {% if class%}class="btn btn-info btn-sm"{% endif %} role="button" title="{% trans "History" %}" href="{% url 'logs:detailed-history' id %}">
<i class="fa fa-history"></i> {% if text %}{% trans "History" %}{% endif %}
</a>
{% else %}

View file

@ -176,7 +176,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Edit the groups" %}
</a>
{% acl_end %}
{% history_button users text=True %}
{% history_button users text=True detailed=True %}
</ul>
</div>
<div class="panel-body">