Smaller fixes and is_staff check
This commit is contained in:
parent
9fd744e186
commit
652ba705c5
4 changed files with 26 additions and 18 deletions
|
@ -1,19 +1,21 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
{% block title %}{{ area.container.display_name }} - {{ area.name }}{% endblock %}
|
{% block title %}{{ area.name }}{% endblock %}
|
||||||
|
|
||||||
{% block header_bar %}
|
{% block header_bar %}
|
||||||
<a href="{{ area.container_url }}"><img class="icon" src="{% static "inventory/img/back.svg" %}"></a>
|
<a href="{{ area.container_url }}"><img class="icon" src="{% static "inventory/img/back.svg" %}"></a>
|
||||||
{{ area.container.display_name }} - {{ area.name }}
|
{{ area.name }}
|
||||||
<span class="small">{{ area.description}}</span>
|
<span class="small">{{ area.description}}</span>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header_icons %}
|
{% block header_icons %}
|
||||||
<li>
|
{% if user.is_staff %}
|
||||||
<a href="{% url "admin:inventory_area_change" object_id=area.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
<li>
|
||||||
</li>
|
<a href="{% url "admin:inventory_area_change" object_id=area.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
{% include 'inventory/set_index.html' with item=area is_index=is_index %}
|
</li>
|
||||||
|
{% include 'inventory/set_index.html' with item=area is_index=is_index %}
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -14,8 +14,10 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header_icons %}
|
{% block header_icons %}
|
||||||
<li>
|
{% if user.is_staff %}
|
||||||
<a href="{% url "admin:inventory_box_change" object_id=object.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
<li>
|
||||||
</li>
|
<a href="{% url "admin:inventory_box_change" object_id=object.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
{% include 'inventory/set_index.html' with item=object is_index=is_index %}
|
</li>
|
||||||
|
{% include 'inventory/set_index.html' with item=object is_index=is_index %}
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -7,13 +7,15 @@
|
||||||
{% block header_bar %}
|
{% block header_bar %}
|
||||||
<a href="{{ item.container_url }}"><img class="icon" src="{% static "inventory/img/back.svg" %}"></a>
|
<a href="{{ item.container_url }}"><img class="icon" src="{% static "inventory/img/back.svg" %}"></a>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
<span class="small">{{ item.description }} {{ item.form_factor }}</span></h2>
|
<span class="small">{{ item.description }}{% if item.form_factor %}, {{ item.form_factor }}{% endif %}</span></h2>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header_icons %}
|
{% block header_icons %}
|
||||||
<li>
|
{% if user.is_staff %}
|
||||||
<a href="{% url "admin:inventory_item_change" object_id=item.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
<li>
|
||||||
</li>
|
<a href="{% url "admin:inventory_item_change" object_id=item.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -10,10 +10,12 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header_icons %}
|
{% block header_icons %}
|
||||||
<li>
|
{% if user.is_staff %}
|
||||||
<a href="{% url "admin:inventory_workshop_change" object_id=workshop.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
<li>
|
||||||
</li>
|
<a href="{% url "admin:inventory_workshop_change" object_id=workshop.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
{% include 'inventory/set_index.html' with item=workshop is_index=is_index %}
|
</li>
|
||||||
|
{% include 'inventory/set_index.html' with item=workshop is_index=is_index %}
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
Loading…
Reference in a new issue