From 562f835096746fbd3c13677491badf789a4bc734 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Tue, 26 Nov 2024 12:58:32 -0800 Subject: [PATCH] convert include to macros --- app/main/views/index.py | 1 + app/templates/components/nav_breadcrumb.html | 9 +++++++-- app/templates/views/about/about.html | 1 - app/templates/views/about/security.html | 4 +++- app/templates/views/about/why-text-messaging.html | 5 +++-- app/templates/views/guides/benchmark-performance.html | 6 +++--- app/templates/views/guides/clear-goals.html | 5 +++-- app/templates/views/guides/establish-trust.html | 6 ++++-- app/templates/views/guides/multiple-languages.html | 5 +++-- app/templates/views/guides/rules-and-regulations.html | 5 +++-- app/templates/views/guides/write-for-action.html | 5 +++-- 11 files changed, 33 insertions(+), 19 deletions(-) diff --git a/app/main/views/index.py b/app/main/views/index.py index 107d440d9..32d33c603 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -293,6 +293,7 @@ def benchmark_performance(): @main.route("/using-notify/guidance") +@main.route("/guides/using-notify/guidance") @user_is_logged_in def guidance_index(): return render_template( diff --git a/app/templates/components/nav_breadcrumb.html b/app/templates/components/nav_breadcrumb.html index 36f85f58a..83305cf9b 100644 --- a/app/templates/components/nav_breadcrumb.html +++ b/app/templates/components/nav_breadcrumb.html @@ -1,8 +1,12 @@ +{% macro breadcrumb(title, parent_menu_title, url) %} +{% endmacro %} diff --git a/app/templates/views/about/about.html b/app/templates/views/about/about.html index 19684c2a7..17180cef7 100644 --- a/app/templates/views/about/about.html +++ b/app/templates/views/about/about.html @@ -7,7 +7,6 @@ {% endblock %} {% block content_column_content %} -

{{page_title}}

Notify.gov is a text messaging service built by and for the government. We help agencies communicate more diff --git a/app/templates/views/about/security.html b/app/templates/views/about/security.html index d6746a39c..0a916035e 100644 --- a/app/templates/views/about/security.html +++ b/app/templates/views/about/security.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} {% set page_title = "Security" %} @@ -7,7 +8,8 @@ {% endblock %} {% block content_column_content %} - +{{ breadcrumbs.breadcrumb(page_title, "About", "main.about_notify") }} +

{{page_title}}

Notify.gov is built for the needs of government agencies with fundamental system diff --git a/app/templates/views/about/why-text-messaging.html b/app/templates/views/about/why-text-messaging.html index 3d70ea363..2b1982225 100644 --- a/app/templates/views/about/why-text-messaging.html +++ b/app/templates/views/about/why-text-messaging.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} + {% set page_title = "Why text messaging" %} {% block per_page_title %} @@ -6,8 +8,7 @@ {% endblock %} {% block content_column_content %} - +{{ breadcrumbs.breadcrumb(page_title, "About", "main.about_notify") }}

{{page_title}}

diff --git a/app/templates/views/guides/benchmark-performance.html b/app/templates/views/guides/benchmark-performance.html index 7a6bb2e9b..5e24dc9cd 100644 --- a/app/templates/views/guides/benchmark-performance.html +++ b/app/templates/views/guides/benchmark-performance.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} {% set page_title = "Measuring performance with benchmarking" %} @@ -7,9 +8,8 @@ {% endblock %} {% block content_column_content %} -{% with title=page_title, parent_menu_title="Guides" %} -{% include "components/nav_breadcrumb.html" %} -{% endwith %} +{{ breadcrumbs.breadcrumb(page_title, "Guides", "main.best_practices") }} +

{{page_title}}

Learn how effective your texting program can be.

diff --git a/app/templates/views/guides/clear-goals.html b/app/templates/views/guides/clear-goals.html index 5c3df8690..71ed0e1a3 100644 --- a/app/templates/views/guides/clear-goals.html +++ b/app/templates/views/guides/clear-goals.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} {% set page_title = "Establish clear goals" %} @@ -7,8 +8,8 @@ {% endblock %} {% block content_column_content %} -{% with title=page_title, parent_menu_title="Guides" %}{% include "components/nav_breadcrumb.html" %}{% endwith -%} +{{ breadcrumbs.breadcrumb(page_title, "Guides", "main.best_practices") }} +

{{page_title}}

Start with a singular purpose. Make explicit what you want to achieve.

diff --git a/app/templates/views/guides/establish-trust.html b/app/templates/views/guides/establish-trust.html index 56e562be1..3383315ba 100644 --- a/app/templates/views/guides/establish-trust.html +++ b/app/templates/views/guides/establish-trust.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} + {% from "components/guides/circle_number.html" import circle_number %} {% set page_title = "Establish trust" %} @@ -8,8 +10,8 @@ {% endblock %} {% block content_column_content %} -{% with title=page_title, parent_menu_title="Guides" %}{% include "components/nav_breadcrumb.html" %}{% endwith -%} +{{ breadcrumbs.breadcrumb(page_title, "Guides", "main.best_practices") }} +

{{page_title}}

Help your audience anticipate and welcome your texts.

diff --git a/app/templates/views/guides/multiple-languages.html b/app/templates/views/guides/multiple-languages.html index 74e65c2f0..dd9c3727f 100644 --- a/app/templates/views/guides/multiple-languages.html +++ b/app/templates/views/guides/multiple-languages.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} {% set page_title = "Text in multiple languages" %} @@ -7,8 +8,8 @@ {% endblock %} {% block content_column_content %} -{% with title=page_title, parent_menu_title="Guides" %}{% include "components/nav_breadcrumb.html" %}{% endwith -%} +{{ breadcrumbs.breadcrumb(page_title, "Guides", "main.best_practices") }} +

{{page_title}}

What to know as you plan translated texts.

diff --git a/app/templates/views/guides/rules-and-regulations.html b/app/templates/views/guides/rules-and-regulations.html index 7f8c1e136..db06ab76e 100644 --- a/app/templates/views/guides/rules-and-regulations.html +++ b/app/templates/views/guides/rules-and-regulations.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} {% set page_title = "Rules and regulations" %} @@ -7,8 +8,8 @@ {% endblock %} {% block content_column_content %} -{% with title=page_title, parent_menu_title="Guides" %}{% include "components/nav_breadcrumb.html" %}{% endwith -%} +{{ breadcrumbs.breadcrumb(page_title, "Guides", "main.best_practices") }} +

{{page_title}}

Understand what is required when texting the public.

diff --git a/app/templates/views/guides/write-for-action.html b/app/templates/views/guides/write-for-action.html index 8d628709e..d3019596c 100644 --- a/app/templates/views/guides/write-for-action.html +++ b/app/templates/views/guides/write-for-action.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% import "components/nav_breadcrumb.html" as breadcrumbs %} {% from "components/guides/circle_number.html" import circle_number %} {% set page_title = "Write texts that provoke action" %} @@ -8,8 +9,8 @@ {% endblock %} {% block content_column_content %} -{% with title=page_title, parent_menu_title="Guides" %}{% include "components/nav_breadcrumb.html" %}{% endwith -%} +{{ breadcrumbs.breadcrumb(page_title, "Guides", "main.best_practices") }} +

{{page_title}}

Help your audience know what to do with the information you send.