From d5388a0fb48b036db37aee6729f16204c47a976c Mon Sep 17 00:00:00 2001 From: Johannes Schriewer Date: Tue, 22 Dec 2020 03:47:35 +0100 Subject: [PATCH] Hide edit buttons if user is not staff --- inventory/templates/inventory/area_detail.html | 17 ++++++++++++----- inventory/templates/inventory/cell.html | 8 ++++++-- .../templates/inventory/workshop_detail.html | 17 ++++++++++++----- .../templates/inventory/workshop_list.html | 8 ++++++-- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/inventory/templates/inventory/area_detail.html b/inventory/templates/inventory/area_detail.html index 3ee95f5..49a3385 100644 --- a/inventory/templates/inventory/area_detail.html +++ b/inventory/templates/inventory/area_detail.html @@ -11,27 +11,34 @@ {% for a in area.area_related.all %}
  • {{ a.name }} - - + {% if user.is_staff %} + + {% endif %}
  • {% empty %}
  • No areas defined
  • {% endfor %} -

    Create new area...

    + {% if user.is_staff %} +

    Create new area...

    + {% endif %}

    Boxes

    -

    Create new container...

    + {% if user.is_staff %} +

    Create new container...

    + {% endif %} {% endblock %} \ No newline at end of file diff --git a/inventory/templates/inventory/cell.html b/inventory/templates/inventory/cell.html index a51f45b..71869e6 100644 --- a/inventory/templates/inventory/cell.html +++ b/inventory/templates/inventory/cell.html @@ -16,7 +16,9 @@ {% endif %}
    - + {% if user.is_staff %} + + {% endif %}
    @@ -28,7 +30,9 @@ {% endif %} {% else %}
    -
    + {% if user.is_staff %} +
    + {% endif %}
    {% endif %} \ No newline at end of file diff --git a/inventory/templates/inventory/workshop_detail.html b/inventory/templates/inventory/workshop_detail.html index cd63715..9c161d1 100644 --- a/inventory/templates/inventory/workshop_detail.html +++ b/inventory/templates/inventory/workshop_detail.html @@ -12,14 +12,18 @@
  • {{ area.name }} ({{ area.description }}) - + {% if user.is_staff %} + + {% endif %}
  • {% empty %}
  • No areas defined
  • {% endfor %} -

    Create new area...

    + {% if user.is_staff %} +

    Create new area...

    + {% endif %}

    Boxes

    -

    Create new box...

    - + {% if user.is_staff %} +

    Create new box...

    + {% endif %} {% endblock %} \ No newline at end of file diff --git a/inventory/templates/inventory/workshop_list.html b/inventory/templates/inventory/workshop_list.html index 85bfa0b..5b394e6 100644 --- a/inventory/templates/inventory/workshop_list.html +++ b/inventory/templates/inventory/workshop_list.html @@ -9,11 +9,15 @@ {% for workshop in object_list %}
  • {{ workshop.name }} - + {% if user.is_staff %} + + {% endif %}
  • {% endfor %} -

    Create new workshop

    + {% if user.is_staff %} +

    Create new workshop...

    + {% endif %} {% endblock %} \ No newline at end of file