diff --git a/app/__init__.py b/app/__init__.py index 08e449728..322a12210 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -89,6 +89,7 @@ from app.navigation import ( HeaderNavigation, MainNavigation, OrgNavigation, + SecondaryNavigation, ) from app.notify_client import InviteTokenError from app.notify_client.api_key_api_client import api_key_api_client @@ -129,6 +130,7 @@ navigation = { "main_navigation": MainNavigation(), "header_navigation": HeaderNavigation(), "org_navigation": OrgNavigation(), + "secondary_navigation": SecondaryNavigation(), } diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index 0dd904929..06bff1ca7 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -22,16 +22,26 @@ i.e. @use "uswds-core" as *; -.usa-header--extended .usa-logo { - font-family: family("sans"); - margin: units(4) 0; - @include at-media-max('mobile-lg') { - margin: units(4) 0 units(4) units(2); +.usa-header--extended { + .usa-logo { + font-family: family("sans"); + margin: units(4) 0; + @include at-media-max('mobile-lg') { + margin: units(4) 0 units(4) units(2); + } + img { + @include at-media($theme-header-min-width) { + width: 80px; + height: 70px; + } + } } - img { - @include at-media($theme-header-min-width) { - width: 80px; - height: 70px; + .usa-nav__secondary { + .usa-nav__link { + padding: 0; + &.usa-current { + text-decoration: underline; + } } } } @@ -44,15 +54,12 @@ i.e. &> .usa-nav__primary-item > a { font-size: size("body", 4); } - &> .usa-nav__primary-item:last-child { - margin-left: auto; - @include u-margin-right(-4); - } + // &> .usa-nav__primary-item:last-child { + // margin-left: auto; + // @include u-margin-right(-4); + // } } -.usa-nav__primary - - h1 { font-weight: bold !important; } @@ -270,7 +277,7 @@ td.table-empty-message { } .navigation-service.usa-breadcrumb { - -bottom: 0; + bottom: 0; } // Dashboard diff --git a/app/navigation.py b/app/navigation.py index e824d6de2..94f970540 100644 --- a/app/navigation.py +++ b/app/navigation.py @@ -87,39 +87,7 @@ class HeaderNavigation(Navigation): "uploads", "view_job", "view_jobs", - "confirm_edit_user_email", - "confirm_edit_user_mobile_number", - "edit_user_email", - "edit_user_mobile_number", - "edit_user_permissions", - "invite_user", - "manage_users", - "remove_user_from_service", "usage", - "link_service_to_organization", - "service_add_email_reply_to", - "service_add_sms_sender", - "service_confirm_delete_email_reply_to", - "service_confirm_delete_sms_sender", - "service_edit_email_reply_to", - "service_edit_sms_sender", - "service_email_reply_to", - "service_name_change", - "service_set_auth_type", - "service_set_channel", - "send_files_by_email_contact_details", - "service_set_inbound_number", - "service_set_inbound_sms", - "service_set_international_sms", - "service_set_reply_to_email", - "service_set_sms_prefix", - "service_verify_reply_to_address", - "service_verify_reply_to_address_updates", - "service_settings", - "service_sms_senders", - "set_free_sms_allowance", - "set_message_limit", - "set_rate_limit", }, "pricing": { "how_to_pay", @@ -236,6 +204,21 @@ class MainNavigation(Navigation): "usage": { "usage", }, + "user-profile": { + "user_profile", + "user_profile_confirm_delete_mobile_number", + "user_profile_email", + "user_profile_email_authenticate", + "user_profile_email_confirm", + "user_profile_mobile_number", + "user_profile_mobile_number_authenticate", + "user_profile_mobile_number_confirm", + "user_profile_mobile_number_delete", + "user_profile_name", + "user_profile_password", + "user_profile_preferred_timezone", + "user_profile_disable_platform_admin_view", + }, "settings": { "link_service_to_organization", "service_add_email_reply_to", @@ -297,6 +280,58 @@ class CaseworkNavigation(Navigation): } +class SecondaryNavigation(Navigation): + mapping = { + "settings": { + "link_service_to_organization", + "service_add_email_reply_to", + "service_add_sms_sender", + "service_confirm_delete_email_reply_to", + "service_confirm_delete_sms_sender", + "service_edit_email_reply_to", + "service_edit_sms_sender", + "service_email_reply_to", + "service_name_change", + "service_set_auth_type", + "service_set_channel", + "send_files_by_email_contact_details", + "service_set_inbound_number", + "service_set_inbound_sms", + "service_set_international_sms", + "service_set_reply_to_email", + "service_set_sms_prefix", + "service_verify_reply_to_address", + "service_verify_reply_to_address_updates", + "service_settings", + "service_sms_senders", + "set_free_sms_allowance", + "set_message_limit", + "set_rate_limit", + "confirm_edit_user_email", + "confirm_edit_user_mobile_number", + "edit_user_email", + "edit_user_mobile_number", + "edit_user_permissions", + "invite_user", + "manage_users", + "remove_user_from_service", + "user_profile", + "user_profile_confirm_delete_mobile_number", + "user_profile_email", + "user_profile_email_authenticate", + "user_profile_email_confirm", + "user_profile_mobile_number", + "user_profile_mobile_number_authenticate", + "user_profile_mobile_number_confirm", + "user_profile_mobile_number_delete", + "user_profile_name", + "user_profile_password", + "user_profile_preferred_timezone", + "user_profile_disable_platform_admin_view", + }, + } + + class OrgNavigation(Navigation): mapping = { "dashboard": { diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 86482f829..c48f768ce 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -58,26 +58,37 @@ "text": "Features", "active": header_navigation.is_selected('features') }, - { - "href": url_for('main.user_profile'), - "text": current_user.name, - "active": header_navigation.is_selected('user-profile') - }, { "href": url_for('main.platform_admin_splash_page'), "text": "Platform admin", "active": header_navigation.is_selected('platform-admin') }, - { - "href": url_for('main.sign_out'), - "text": "Sign out" - }, { "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 %} {% else %} {% set navigation = [ { @@ -104,13 +115,29 @@ "href": url_for('main.user_profile'), "text": "User profile", "active": header_navigation.is_selected('user-profile') - }, - { - "href": url_for('main.sign_out'), - "text": "Sign out" } ] %} - {% 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 %} + {% endif %} {% else %} {# {% set navigation = [ @@ -142,6 +169,7 @@ "productName": "Notify", "navigation": navigation, "navigationClasses": "govuk-header__navigation--end", + "secondaryNavigation": secondaryNavigation, "assetsPath": asset_path + "images" }) }} {% endblock %} @@ -236,7 +264,7 @@ Please choose to extend your session or sign out. Your session will expire in 5 minutes or less.
You have been inactive for too long. +
You have been inactive for too long. Your session will expire in .