From 3b82e136e02a356b4096a5b15d0b964986c78c53 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Wed, 24 Apr 2024 13:43:17 -0700 Subject: [PATCH 01/15] switched to withnav_template for org_template, settings template --- ...rvice_navigation.html => service_nav.html} | 0 .../{ => new/components}/settings_nav.html | 0 .../new/layouts/withnav_template.html | 57 ------------------- app/templates/new/templates_glossary.md | 4 +- app/templates/{ => old}/main_nav.html | 0 app/templates/{ => old}/org_nav.html | 0 app/templates/{ => old}/org_template.html | 2 +- .../{ => old}/service_navigation.html | 0 .../settings_nav.html} | 0 .../{ => old}/settings_template.html | 0 app/templates/old/withnav_template.html | 35 ++++++++++++ app/templates/views/manage-users.html | 8 ++- .../organizations/organization/billing.html | 2 +- .../organizations/organization/index.html | 2 +- .../organization/settings/edit-domains.html | 2 +- .../organization/settings/edit-name.html | 2 +- .../edit-organization-billing-details.html | 2 +- .../settings/edit-organization-notes.html | 2 +- .../organization/settings/edit-type.html | 2 +- .../organization/settings/index.html | 2 +- .../organization/trial-mode-services.html | 2 +- .../organization/users/index.html | 2 +- .../organization/users/invite-org-user.html | 2 +- app/templates/views/service-settings.html | 8 ++- app/templates/views/signedout.html | 2 +- app/templates/views/user-profile.html | 8 ++- app/templates/withnav_template.html | 50 +++++++++++----- 27 files changed, 107 insertions(+), 89 deletions(-) rename app/templates/new/components/{service_navigation.html => service_nav.html} (100%) rename app/templates/{ => new/components}/settings_nav.html (100%) delete mode 100644 app/templates/new/layouts/withnav_template.html rename app/templates/{ => old}/main_nav.html (100%) rename app/templates/{ => old}/org_nav.html (100%) rename app/templates/{ => old}/org_template.html (96%) rename app/templates/{ => old}/service_navigation.html (100%) rename app/templates/{new/components/settings_navigation.html => old/settings_nav.html} (100%) rename app/templates/{ => old}/settings_template.html (100%) create mode 100644 app/templates/old/withnav_template.html diff --git a/app/templates/new/components/service_navigation.html b/app/templates/new/components/service_nav.html similarity index 100% rename from app/templates/new/components/service_navigation.html rename to app/templates/new/components/service_nav.html diff --git a/app/templates/settings_nav.html b/app/templates/new/components/settings_nav.html similarity index 100% rename from app/templates/settings_nav.html rename to app/templates/new/components/settings_nav.html diff --git a/app/templates/new/layouts/withnav_template.html b/app/templates/new/layouts/withnav_template.html deleted file mode 100644 index 30d38b4bc6..0000000000 --- a/app/templates/new/layouts/withnav_template.html +++ /dev/null @@ -1,57 +0,0 @@ -{% extends "/new/base.html" %} - -{% block per_page_title %} - {% block service_page_title %}{% endblock %}{% if current_service.name %} – {{ current_service.name }}{% endif %} - {% block org_page_title %}{% endblock %}{% if current_org.name %} – {{ current_org.name }}{% endif %} -{% endblock %} - -{% block main %} -
- {% block serviceNavigation %} - {% if current_org.name %} - {% else %} - {% include "new/components/service_navigation.html" %} - {% endif %} - {% endblock %} - {# - The withnav_template can serve as a replacement for both settings_template and org_template.html. - - The file service_navigation.html is included only in withnav_template. It's not used in settings_template. That is one out of the two differences between settings template and withnav template. As a result, when other templates extend settings_template, they include the serviceNavigation block but keep it empty. The settings_template.html is specifically used for these pages in the app: manage-users.html, service-settings.html, and user-profile.html. - - In addition, serviceNavigation should be empty on templates that previously extended org_template. For templates that previously extended org_template.html, there's an addition of the orgNavBreadcrumb block. - {% block orgNavBreadcrumb %} - {% include "/new/components/org_nav_breadcrumb.html" %} - {% endblock %} - #} - {% if current_org.name %} - {% block orgNavBreadcrumb %}{% include "/new/components/org_nav_breadcrumb.html" %}{% endblock %} - {% endif %} -
-
- {% block sideNavigation %} - {% if org_navigation_links %} - {% include "/new/components/org_nav.html" %} - {% else %} - {% include "/new/components/main_nav.html" %} - {% endif %} - {# - Include settings_nav.html for child templates that previously extended settings_template. - - Include "org_nav.html" for child templates that previously extended org_template html - #} - {% endblock %} -
-
- {% block beforeContent %} - {% block backLink %}{% endblock %} - {% endblock %} -
- {% block content %} - {% include 'flash_messages.html' %} - {% block maincolumn_content %}{% endblock %} - {% endblock %} -
-
-
-
-{% endblock %} diff --git a/app/templates/new/templates_glossary.md b/app/templates/new/templates_glossary.md index 1c52e75dcc..126d2ce403 100644 --- a/app/templates/new/templates_glossary.md +++ b/app/templates/new/templates_glossary.md @@ -33,10 +33,10 @@ This document serves as a glossary for the templates directory structure of the ### Old Layout Templates We Don't Need - withoutnav_template.html Delete - main_template.html Delete -- settings_templates.html `withnav_template` can be used to replace `settings_template`. +- settings_templates.html It will be replaced with `withnav_template` . - settings_nav.html (move to /components/ directory) - main_nav.html (move to /components/ directory) - service_navigation.html (move to /components/ directory) -- org_template, could be under it's own directory called /layout/organization +- org_template, It will be replaced with `withnav_template` - org_nav.html (move to /components/ directory) - content_template.html Delete diff --git a/app/templates/main_nav.html b/app/templates/old/main_nav.html similarity index 100% rename from app/templates/main_nav.html rename to app/templates/old/main_nav.html diff --git a/app/templates/org_nav.html b/app/templates/old/org_nav.html similarity index 100% rename from app/templates/org_nav.html rename to app/templates/old/org_nav.html diff --git a/app/templates/org_template.html b/app/templates/old/org_template.html similarity index 96% rename from app/templates/org_template.html rename to app/templates/old/org_template.html index dd3fbee20f..5e04003fd4 100644 --- a/app/templates/org_template.html +++ b/app/templates/old/org_template.html @@ -1,4 +1,4 @@ -{% extends "admin_template.html" %} +{% extends "base.html" %} {% block per_page_title %} {% block org_page_title %}{% endblock %} – {{ current_org.name }} diff --git a/app/templates/service_navigation.html b/app/templates/old/service_navigation.html similarity index 100% rename from app/templates/service_navigation.html rename to app/templates/old/service_navigation.html diff --git a/app/templates/new/components/settings_navigation.html b/app/templates/old/settings_nav.html similarity index 100% rename from app/templates/new/components/settings_navigation.html rename to app/templates/old/settings_nav.html diff --git a/app/templates/settings_template.html b/app/templates/old/settings_template.html similarity index 100% rename from app/templates/settings_template.html rename to app/templates/old/settings_template.html diff --git a/app/templates/old/withnav_template.html b/app/templates/old/withnav_template.html new file mode 100644 index 0000000000..3b6ebfbf28 --- /dev/null +++ b/app/templates/old/withnav_template.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block per_page_title %} + {% block service_page_title %}{% endblock %} – {{ current_service.name }} +{% endblock %} + +{% block main %} +
+ {% include "service_navigation.html" %} +
+ {% if help %} +
+ {% else %} +
+ {% endif %} + {% include "main_nav.html" %} +
+ {% if help %} +
+ {% else %} +
+ {% endif %} + {% block beforeContent %} + {% block backLink %}{% endblock %} + {% endblock %} +
+ {% block content %} + {% include 'flash_messages.html' %} + {% block maincolumn_content %}{% endblock %} + {% endblock %} +
+
+
+
+{% endblock %} diff --git a/app/templates/views/manage-users.html b/app/templates/views/manage-users.html index de71d01841..edf78c4e0b 100644 --- a/app/templates/views/manage-users.html +++ b/app/templates/views/manage-users.html @@ -1,4 +1,4 @@ -{% extends "settings_template.html" %} +{% extends "withnav_template.html" %} {% from "components/tick-cross.html" import tick_cross %} {% from "components/live-search.html" import live_search %} {% from "components/components/button/macro.njk" import usaButton %} @@ -7,6 +7,12 @@ Team members {% endblock %} +{% block serviceNavigation %}{% endblock %} + +{% block sideNavigation %} + {% include "/new/components/settings_nav.html" %} +{% endblock %} + {% block maincolumn_content %}
diff --git a/app/templates/views/organizations/organization/billing.html b/app/templates/views/organizations/organization/billing.html index b7e852a6ab..137c506e9d 100644 --- a/app/templates/views/organizations/organization/billing.html +++ b/app/templates/views/organizations/organization/billing.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/page-header.html" import page_header %} {% block org_page_title %} diff --git a/app/templates/views/organizations/organization/index.html b/app/templates/views/organizations/organization/index.html index 477b85f968..a508d50b12 100644 --- a/app/templates/views/organizations/organization/index.html +++ b/app/templates/views/organizations/organization/index.html @@ -2,7 +2,7 @@ {% from "components/big-number.html" import big_number %} {% from "components/live-search.html" import live_search %} {% from "components/pill.html" import pill %} -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% block org_page_title %} Usage diff --git a/app/templates/views/organizations/organization/settings/edit-domains.html b/app/templates/views/organizations/organization/settings/edit-domains.html index 5428ed1869..335e3b1979 100644 --- a/app/templates/views/organizations/organization/settings/edit-domains.html +++ b/app/templates/views/organizations/organization/settings/edit-domains.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/page-footer.html" import page_footer %} {% from "components/page-header.html" import page_header %} {% from "components/list-entry.html" import list_entry %} diff --git a/app/templates/views/organizations/organization/settings/edit-name.html b/app/templates/views/organizations/organization/settings/edit-name.html index b1e5caef9c..b625957513 100644 --- a/app/templates/views/organizations/organization/settings/edit-name.html +++ b/app/templates/views/organizations/organization/settings/edit-name.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/page-header.html" import page_header %} {% from "components/page-footer.html" import page_footer %} {% from "components/form.html" import form_wrapper %} diff --git a/app/templates/views/organizations/organization/settings/edit-organization-billing-details.html b/app/templates/views/organizations/organization/settings/edit-organization-billing-details.html index 96da00eddb..d7ad903395 100644 --- a/app/templates/views/organizations/organization/settings/edit-organization-billing-details.html +++ b/app/templates/views/organizations/organization/settings/edit-organization-billing-details.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/page-header.html" import page_header %} {% from "components/page-footer.html" import page_footer %} {% from "components/form.html" import form_wrapper %} diff --git a/app/templates/views/organizations/organization/settings/edit-organization-notes.html b/app/templates/views/organizations/organization/settings/edit-organization-notes.html index c703f6f1ca..9679bbb6d0 100644 --- a/app/templates/views/organizations/organization/settings/edit-organization-notes.html +++ b/app/templates/views/organizations/organization/settings/edit-organization-notes.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/page-header.html" import page_header %} {% from "components/page-footer.html" import page_footer %} {% from "components/form.html" import form_wrapper %} diff --git a/app/templates/views/organizations/organization/settings/edit-type.html b/app/templates/views/organizations/organization/settings/edit-type.html index 7c0028355f..8bc65689ad 100644 --- a/app/templates/views/organizations/organization/settings/edit-type.html +++ b/app/templates/views/organizations/organization/settings/edit-type.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/page-footer.html" import page_footer %} {% from "components/page-header.html" import page_header %} {% from "components/form.html" import form_wrapper %} diff --git a/app/templates/views/organizations/organization/settings/index.html b/app/templates/views/organizations/organization/settings/index.html index ddd60bc643..b13c651d1d 100644 --- a/app/templates/views/organizations/organization/settings/index.html +++ b/app/templates/views/organizations/organization/settings/index.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/table.html" import mapping_table, optional_text_field, row, text_field, edit_field with context %} {% block org_page_title %} diff --git a/app/templates/views/organizations/organization/trial-mode-services.html b/app/templates/views/organizations/organization/trial-mode-services.html index 4f18cdf338..2209eaadfa 100644 --- a/app/templates/views/organizations/organization/trial-mode-services.html +++ b/app/templates/views/organizations/organization/trial-mode-services.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/live-search.html" import live_search %} {% block org_page_title %} diff --git a/app/templates/views/organizations/organization/users/index.html b/app/templates/views/organizations/organization/users/index.html index a27d22c693..f0c6679775 100644 --- a/app/templates/views/organizations/organization/users/index.html +++ b/app/templates/views/organizations/organization/users/index.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/table.html" import list_table, row, field, hidden_field_heading %} {% from "components/page-footer.html" import page_footer %} {% from "components/live-search.html" import live_search %} diff --git a/app/templates/views/organizations/organization/users/invite-org-user.html b/app/templates/views/organizations/organization/users/invite-org-user.html index e5b740e07f..ea47280228 100644 --- a/app/templates/views/organizations/organization/users/invite-org-user.html +++ b/app/templates/views/organizations/organization/users/invite-org-user.html @@ -1,4 +1,4 @@ -{% extends "org_template.html" %} +{% extends "withnav_template.html" %} {% from "components/page-footer.html" import page_footer %} {% from "components/page-header.html" import page_header %} diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index 96e274c689..1745bd528b 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -1,4 +1,4 @@ -{% extends "settings_template.html" %} +{% extends "withnav_template.html" %} {% from "components/banner.html" import banner_wrapper %} {% from "components/table.html" import mapping_table, row, settings_row, text_field, optional_text_field, edit_field, field, boolean_field with context %} @@ -6,6 +6,12 @@ Settings {% endblock %} +{% block serviceNavigation %}{% endblock %} + +{% block sideNavigation %} + {% include "/new/components/settings_nav.html" %} +{% endblock %} + {% block maincolumn_content %}

Settings

diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index 3289dd121c..175f958dee 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -1,4 +1,4 @@ -{% extends "admin_template.html" %} +{% extends "base.html" %} {% from "components/components/button/macro.njk" import usaButton %} {% block meta %} diff --git a/app/templates/views/user-profile.html b/app/templates/views/user-profile.html index abc41d2c01..a03eeab508 100644 --- a/app/templates/views/user-profile.html +++ b/app/templates/views/user-profile.html @@ -1,4 +1,4 @@ -{% extends "settings_template.html" %} +{% extends "withnav_template.html" %} {% from "components/table.html" import list_table, row, field %} {% from "components/table.html" import mapping_table, row, text_field, optional_text_field, edit_field, field, boolean_field with context %} @@ -6,6 +6,12 @@ User profile {% endblock %} +{% block serviceNavigation %}{% endblock %} + +{% block sideNavigation %} + {% include "/new/components/settings_nav.html" %} +{% endblock %} + {% block maincolumn_content %}

User profile

diff --git a/app/templates/withnav_template.html b/app/templates/withnav_template.html index 40d2e10f16..7940f8bc2f 100644 --- a/app/templates/withnav_template.html +++ b/app/templates/withnav_template.html @@ -1,25 +1,47 @@ -{% extends "admin_template.html" %} +{% extends "base.html" %} {% block per_page_title %} - {% block service_page_title %}{% endblock %} – {{ current_service.name }} + {% block service_page_title %}{% endblock %}{% if current_service.name %} – {{ current_service.name }}{% endif %} + {% block org_page_title %}{% endblock %}{% if current_org.name %} – {{ current_org.name }}{% endif %} {% endblock %} {% block main %}
- {% include "service_navigation.html" %} -
- {% if help %} -
- {% else %} -
- {% endif %} - {% include "main_nav.html" %} -
- {% if help %} -
+ {% block serviceNavigation %} + {% if current_org.name %} {% else %} -
+ {% include "new/components/service_nav.html" %} {% endif %} + {% endblock %} + {# + The withnav_template can serve as a replacement for both settings_template and org_template.html. + + The file service_navigation.html is included only in withnav_template. It's not used in settings_template. That is one out of the two differences between settings template and withnav template. As a result, when other templates extend settings_template, they include the serviceNavigation block but keep it empty. The settings_template.html is specifically used for these pages in the app: manage-users.html, service-settings.html, and user-profile.html. + + In addition, serviceNavigation should be empty on templates that previously extended org_template. For templates that previously extended org_template.html, there's an addition of the orgNavBreadcrumb block. + {% block orgNavBreadcrumb %} + {% include "/new/components/org_nav_breadcrumb.html" %} + {% endblock %} + #} + {% if current_org.name %} + {% block orgNavBreadcrumb %}{% include "/new/components/org_nav_breadcrumb.html" %}{% endblock %} + {% endif %} +
+
+ {% block sideNavigation %} + {% if current_org.name %} + {% include "/new/components/org_nav.html" %} + {% else %} + {% include "/new/components/main_nav.html" %} + {% endif %} + {# + Include settings_nav.html for child templates that previously extended settings_template. + + Include "org_nav.html" for child templates that previously extended org_template html + #} + {% endblock %} +
+
{% block beforeContent %} {% block backLink %}{% endblock %} {% endblock %} From 04f1f6244cb1ae8ccf3f107b987d338d565f8d57 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Wed, 24 Apr 2024 13:53:28 -0700 Subject: [PATCH 02/15] fixed file name --- app/templates/old/org_template.html | 2 +- app/templates/old/withnav_template.html | 2 +- app/templates/views/signedout.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/old/org_template.html b/app/templates/old/org_template.html index 5e04003fd4..dd3fbee20f 100644 --- a/app/templates/old/org_template.html +++ b/app/templates/old/org_template.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "admin_template.html" %} {% block per_page_title %} {% block org_page_title %}{% endblock %} – {{ current_org.name }} diff --git a/app/templates/old/withnav_template.html b/app/templates/old/withnav_template.html index 3b6ebfbf28..40d2e10f16 100644 --- a/app/templates/old/withnav_template.html +++ b/app/templates/old/withnav_template.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "admin_template.html" %} {% block per_page_title %} {% block service_page_title %}{% endblock %} – {{ current_service.name }} diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index 175f958dee..3289dd121c 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "admin_template.html" %} {% from "components/components/button/macro.njk" import usaButton %} {% block meta %} From f734e4524236016224abd282eb987c5198861315 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Wed, 24 Apr 2024 13:56:07 -0700 Subject: [PATCH 03/15] added comments --- app/templates/old/main_nav.html | 1 + app/templates/old/org_nav.html | 1 + app/templates/old/org_template.html | 1 + app/templates/old/service_navigation.html | 1 + app/templates/old/settings_nav.html | 1 + app/templates/old/settings_template.html | 1 + app/templates/old/withnav_template.html | 1 + 7 files changed, 7 insertions(+) diff --git a/app/templates/old/main_nav.html b/app/templates/old/main_nav.html index 4aac354d9f..4357dc6548 100644 --- a/app/templates/old/main_nav.html +++ b/app/templates/old/main_nav.html @@ -1,3 +1,4 @@ +{# This template is an old version #} {% if help %} {% include 'partials/tour.html' %} {% else %} diff --git a/app/templates/old/org_nav.html b/app/templates/old/org_nav.html index f7f7a5b93a..0511eb9ff0 100644 --- a/app/templates/old/org_nav.html +++ b/app/templates/old/org_nav.html @@ -1,3 +1,4 @@ +{# This template is an old version #}