mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 01:16:27 +00:00
Improve handling of detailed history button
This commit is contained in:
parent
1f5fa4b43e
commit
c4e034a5a6
4 changed files with 7 additions and 6 deletions
|
@ -42,7 +42,7 @@ def is_facture(baseinvoice):
|
||||||
|
|
||||||
|
|
||||||
@register.inclusion_tag("buttons/history.html")
|
@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.
|
"""Creates the correct history button for an instance.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -57,5 +57,6 @@ def history_button(instance, text=False, html_class=True):
|
||||||
"name": instance._meta.model_name,
|
"name": instance._meta.model_name,
|
||||||
"id": instance.id,
|
"id": instance.id,
|
||||||
"text": text,
|
"text": text,
|
||||||
|
"detailed": detailed,
|
||||||
"class": html_class,
|
"class": html_class,
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 %}
|
{% 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 %}
|
{% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc=tr_create_an_interface %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% history_button machine %}
|
{% history_button machine detailed=True %}
|
||||||
{% can_delete machine %}
|
{% can_delete machine %}
|
||||||
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
|
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
@ -161,7 +161,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% history_button interface %}
|
{% history_button interface detailed=True %}
|
||||||
{% can_delete interface %}
|
{% can_delete interface %}
|
||||||
{% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
|
{% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
|
|
@ -24,8 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% if name == "user" %}
|
{% if detailed %}
|
||||||
<a {% if class%}class="btn btn-info btn-sm"{% endif %} role="button" title="{% trans "History" %}" href="{% url 'logs:user-history' id %}">
|
<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 %}
|
<i class="fa fa-history"></i> {% if text %}{% trans "History" %}{% endif %}
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -176,7 +176,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% trans "Edit the groups" %}
|
{% trans "Edit the groups" %}
|
||||||
</a>
|
</a>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
{% history_button users text=True %}
|
{% history_button users text=True detailed=True %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
Loading…
Reference in a new issue