2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-30 18:50:53 +00:00

Add direct admin links if the user is staff

This commit is contained in:
Oliver Walters
2020-09-30 00:02:10 +10:00
parent 0e5f10c020
commit d1cce7df94
6 changed files with 32 additions and 6 deletions

View File

@ -61,9 +61,12 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
<hr>
<h4>
{% if item.serialized %}
<a href='{% url "part-detail" item.part.pk %}'>{{ item.part.full_name}}</a> # {{ item.serial }}
<a href='{% url "part-detail" item.part.pk %}'>{{ item.part.full_name}}</a> # {{ item.serial }}
{% else %}
<a href='{% url "part-detail" item.part.pk %}'>{{ item.part.full_name }}</a> &times {% decimal item.quantity %}
<a href='{% url "part-detail" item.part.pk %}'>{{ item.part.full_name }}</a> &times {% decimal item.quantity %}
{% endif %}
{% if user.is_staff %}
<a href="{% url 'admin:stock_stockitem_change' item.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
{% endif %}
</h4>

View File

@ -6,7 +6,12 @@
<div class='row'>
<div class='col-sm-6'>
{% if location %}
<h3>{{ location.name }}</h3>
<h3>
{{ location.name }}
{% if user.is_staff %}
<a href="{% url 'admin:stock_stocklocation_change' location.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
{% endif %}
</h3>
<p>{{ location.description }}</p>
{% else %}
<h3>{% trans "Stock" %}</h3>