From ec084ca9b3cda15e12d182a57694eb6c88a2a922 Mon Sep 17 00:00:00 2001 From: Nivesh Mittapally Date: Fri, 30 Jun 2023 15:34:15 +0530 Subject: [PATCH] fix: conditions to show content in navbar --- Access/context_processors.py | 1 + templates/global_layout.html | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Access/context_processors.py b/Access/context_processors.py index 45cdc87b..5a075319 100644 --- a/Access/context_processors.py +++ b/Access/context_processors.py @@ -21,6 +21,7 @@ def add_variables_to_context(request): context["totalAccessCount"] = currentUser.get_total_access_count() context["pendingAccessCount"] = currentUser.get_pending_access_count() context["groupsMemberFor"] = len(currentUser.get_active_groups()) + context["anyApprover"] = currentUser.is_an_approver(get_possible_approver_permissions()) context["pendingGroupAccess"] = currentUser.get_group_pending_access_count() context["pendingActionsCount"] = currentUser.get_pending_approvals_count(all_access_modules) context["is_ops"] = currentUser.is_ops diff --git a/templates/global_layout.html b/templates/global_layout.html index af1aaf0a..3edc1c00 100644 --- a/templates/global_layout.html +++ b/templates/global_layout.html @@ -38,6 +38,7 @@ Dashboard + {% if anyApprover %} {{ pendingActionsCount }} + {% endif %} + {% if user.is_superuser or is_ops %} {{ failureActionsCount }} + {% endif %} + {% if request.user.is_superuser or user.user.is_manager or is_ops %} User Management + {% endif %}