From b0322b4c0305f022235c0bf470ad86930a9c2673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 8 Oct 2023 01:25:29 +0200 Subject: [PATCH] Added a "new part" button to the navbar This fixes issue #394 --- templates/_navbar.html.twig | 41 +++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/templates/_navbar.html.twig b/templates/_navbar.html.twig index 164848f1..d1a8bc72 100644 --- a/templates/_navbar.html.twig +++ b/templates/_navbar.html.twig @@ -26,6 +26,35 @@ href="{{ path("scan_dialog") }}">{% trans %}navbar.scanner.link{% endtrans %} {% endif %} + + {% if is_granted("@parts.create") %} + {% set show_parts_create_dropdown = is_granted('@info_providers.create_parts') or is_granted('@parts.import') %} + + {% endif %} {% if is_granted('@parts.read') %} @@ -68,14 +97,14 @@ {% if impersonation_active() %} - - {% trans %}user.stop_impersonation{% endtrans %} - + + {% trans %}user.stop_impersonation{% endtrans %} + {% endif %} - - {% trans %}user.logout{% endtrans %} - + + {% trans %}user.logout{% endtrans %} + {% else %}