Browse Source

Improve handling of detailed history button

release-2.9
Jean-Romain Garnier 6 years ago
committed by Gabriel Detraz
parent
commit
ac53084695
  1. 3
      logs/templatetags/logs_extra.py
  2. 4
      machines/templates/machines/aff_machines.html
  3. 4
      templates/buttons/history.html
  4. 2
      users/templates/users/profil.html

3
logs/templatetags/logs_extra.py

@ -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,
}

4
machines/templates/machines/aff_machines.html

@ -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 %}

4
templates/buttons/history.html

@ -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 %}

2
users/templates/users/profil.html

@ -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">

Loading…
Cancel
Save