From d8e9aaee0ff2167a51d19d887d42d018e10adfcb Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Tue, 26 Mar 2024 18:00:01 -0700 Subject: [PATCH] updated header nav and seperated out usabanner --- app/templates/new/base.html | 7 +- app/templates/new/components/header.html | 157 +++---------------- app/templates/new/components/usa_banner.html | 44 ++++++ 3 files changed, 66 insertions(+), 142 deletions(-) create mode 100644 app/templates/new/components/usa_banner.html diff --git a/app/templates/new/base.html b/app/templates/new/base.html index f7aa58f68..4d5279342 100644 --- a/app/templates/new/base.html +++ b/app/templates/new/base.html @@ -1,6 +1,5 @@ {% from "../components/banner.html" import banner %} {% from "../components/components/skip-link/macro.njk" import usaSkipLink -%} -{% from "../components/components/header/macro.njk" import usaHeader -%} {% from "../components/components/footer/macro.njk" import usaFooter -%} @@ -25,13 +24,13 @@ }) }} {% endblock %} - + {# region header #} {% block header %} {% if current_user.is_authenticated %} - {% include "new/components/header.html" %} + {% include 'new/components/usa_banner.html' %} + {% include 'new/components/header.html' %} {% endif %} {% endblock %} - {% block main %} diff --git a/app/templates/new/components/header.html b/app/templates/new/components/header.html index 1f559f447..e21963fed 100644 --- a/app/templates/new/components/header.html +++ b/app/templates/new/components/header.html @@ -1,145 +1,26 @@ +{# setting navigation and secondarynavigation #} +{% set navigation = [ + {"href": url_for("main.show_accounts_or_dashboard"), "text": "Current service", "active": header_navigation.is_selected('accounts-or-dashboard')}, + {"href": url_for('main.get_started'), "text": "Using Notify", "active": header_navigation.is_selected('using_notify')}, + {"href": url_for('main.features'), "text": "Features", "active": header_navigation.is_selected('features')}, + {"href": url_for('main.support'), "text": "Contact us", "active": header_navigation.is_selected('support')} +] %} - -
-
-
-
-
- -
- - -
-
- -
-
{% if current_user.platform_admin %} - {% set navigation = [ - { - "href": url_for("main.show_accounts_or_dashboard"), - "text": "Current service", - "active": header_navigation.is_selected('accounts-or-dashboard') - }, - { - "href": url_for('main.get_started'), - "text": "Using Notify", - "active": header_navigation.is_selected('using_notify') - }, - { - "href": url_for('main.features'), - "text": "Features", - "active": header_navigation.is_selected('features') - }, - { - "href": url_for('main.platform_admin_splash_page'), - "text": "Platform admin", - "active": header_navigation.is_selected('platform-admin') - }, - { - "href": url_for('main.support'), - "text": "Contact us", - "active": header_navigation.is_selected('support') - } - ] %} - {% if current_service %} - {% set secondaryNavigation = [ - { - "href": url_for('main.service_settings', service_id=current_service.id), - "text": "Settings", - "active": secondary_navigation.is_selected('settings') - }, - { - "href": url_for('main.sign_out'), - "text": "Sign out" - } - ] %} - {% else %} - {% set secondaryNavigation = [ - { - "href": url_for('main.sign_out'), - "text": "Sign out" - } - ] %} - {% endif %} + {% set navigation = navigation + [{"href": url_for('main.platform_admin_splash_page'), "text": "Platform admin", "active": header_navigation.is_selected('platform-admin')}] %} {% else %} - {% set navigation = [ - { - "href": url_for("main.show_accounts_or_dashboard"), - "text": "Current service", - "active": header_navigation.is_selected('accounts-or-dashboard') - }, - { - "href": url_for('main.get_started'), - "text": "Using Notify", - "active": header_navigation.is_selected('using_notify') - }, - { - "href": url_for('main.features'), - "text": "Features", - "active": header_navigation.is_selected('features') - }, - { - "href": url_for('main.support'), - "text": "Contact us", - "active": header_navigation.is_selected('support') - }, - { - "href": url_for('main.user_profile'), - "text": "User profile", - "active": header_navigation.is_selected('user-profile') - } - ] %} - {% if current_service %} - {% set secondaryNavigation = [ - { - "href": url_for('main.service_settings', service_id=current_service.id), - "text": "Settings", - "active": secondary_navigation.is_selected('settings') - }, - { - "href": url_for('main.sign_out'), - "text": "Sign out" - } - ] %} - {% else %} - {% set secondaryNavigation = [ - { - "href": url_for('main.sign_out'), - "text": "Sign out" - } - ] %} - {% endif %} + {% set navigation = navigation + [{"href": url_for('main.user_profile'), "text": "User profile", "active": header_navigation.is_selected('user-profile')}] %} {% endif %} - + +{% if current_service %} + {% set secondaryNavigation = [ + {"href": url_for('main.service_settings', service_id=current_service.id), "text": "Settings", "active": secondary_navigation.is_selected('settings')}, + {"href": url_for('main.sign_out'), "text": "Sign out"} + ] %} +{% else %} + {% set secondaryNavigation = [{"href": url_for('main.sign_out'), "text": "Sign out"}] %} +{% endif %} +{# usa header #}
diff --git a/app/templates/new/components/usa_banner.html b/app/templates/new/components/usa_banner.html new file mode 100644 index 000000000..532a2937a --- /dev/null +++ b/app/templates/new/components/usa_banner.html @@ -0,0 +1,44 @@ + +{# usa banner #} +
+
+
+
+
+ +
+ + +
+
+ +
+