From 86685b2136c0e2f94becab29a7ff65d71faf6570 Mon Sep 17 00:00:00 2001 From: Frank Netscher Date: Thu, 20 Oct 2022 16:55:18 -0500 Subject: [PATCH] Hiding the "My Accounts" button in the nav drop-down if the hideManageAccount setting is True --- server/portal/settings/settings.py | 3 ++- server/portal/templates/includes/header.html | 2 +- server/portal/templates/includes/nav_portal.raw.html | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/portal/settings/settings.py b/server/portal/settings/settings.py index d006f96b2..7dc169930 100644 --- a/server/portal/settings/settings.py +++ b/server/portal/settings/settings.py @@ -651,7 +651,8 @@ def gettext(s): return s # noqa:E731 'PORTAL_ICON_FILENAME', 'DEBUG', 'GOOGLE_ANALYTICS_PROPERTY_ID', - 'PORTAL_NAMESPACE' + 'PORTAL_NAMESPACE', + 'WORKBENCH_SETTINGS' ] """ diff --git a/server/portal/templates/includes/header.html b/server/portal/templates/includes/header.html index 967ad9186..a578e928f 100644 --- a/server/portal/templates/includes/header.html +++ b/server/portal/templates/includes/header.html @@ -26,7 +26,7 @@ {# NOTE: As of 2020-12, search is only available with a Portal #} {% include "includes/nav_search.html" with className="form-inline ml-auto" only %} {# FAQ: Unlike CMS and User Guide, we must pass `user` #} - {% include "includes/nav_portal.html" with className="navbar-nav" user=user only %} + {% include "includes/nav_portal.html" with className="navbar-nav" user=user settings=settings only %} diff --git a/server/portal/templates/includes/nav_portal.raw.html b/server/portal/templates/includes/nav_portal.raw.html index 2c60f22b6..f352a858b 100644 --- a/server/portal/templates/includes/nav_portal.raw.html +++ b/server/portal/templates/includes/nav_portal.raw.html @@ -1,4 +1,6 @@ {# @var user #} +{# @var settings #} + @@ -32,9 +34,11 @@ Onboarding Admin {% endif %} + {% if not settings.WORKBENCH_SETTINGS.hideManageAccount %} My Account + {% endif %} {% if user.is_impersonate %} Stop impersonating {{user.get_username}}