Smaller fixes and is_staff check

This commit is contained in:
Johannes Schriewer 2020-12-23 00:43:22 +01:00
parent 9fd744e186
commit 652ba705c5
4 changed files with 26 additions and 18 deletions

View file

@ -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 %}
{% if user.is_staff %}
<li> <li>
<a href="{% url "admin:inventory_area_change" object_id=area.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a> <a href="{% url "admin:inventory_area_change" object_id=area.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
</li> </li>
{% include 'inventory/set_index.html' with item=area is_index=is_index %} {% include 'inventory/set_index.html' with item=area is_index=is_index %}
{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View file

@ -14,8 +14,10 @@
{% endblock %} {% endblock %}
{% block header_icons %} {% block header_icons %}
{% if user.is_staff %}
<li> <li>
<a href="{% url "admin:inventory_box_change" object_id=object.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a> <a href="{% url "admin:inventory_box_change" object_id=object.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
</li> </li>
{% include 'inventory/set_index.html' with item=object is_index=is_index %} {% include 'inventory/set_index.html' with item=object is_index=is_index %}
{% endif %}
{% endblock %} {% endblock %}

View file

@ -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 %}
{% if user.is_staff %}
<li> <li>
<a href="{% url "admin:inventory_item_change" object_id=item.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a> <a href="{% url "admin:inventory_item_change" object_id=item.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
</li> </li>
{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View file

@ -10,10 +10,12 @@
{% endblock %} {% endblock %}
{% block header_icons %} {% block header_icons %}
{% if user.is_staff %}
<li> <li>
<a href="{% url "admin:inventory_workshop_change" object_id=workshop.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a> <a href="{% url "admin:inventory_workshop_change" object_id=workshop.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
</li> </li>
{% include 'inventory/set_index.html' with item=workshop is_index=is_index %} {% include 'inventory/set_index.html' with item=workshop is_index=is_index %}
{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}