convert include to macros

This commit is contained in:
Beverly Nguyen
2024-11-26 12:58:32 -08:00
parent 2fa9c1ed7d
commit 562f835096
11 changed files with 33 additions and 19 deletions

View File

@@ -293,6 +293,7 @@ def benchmark_performance():
@main.route("/using-notify/guidance") @main.route("/using-notify/guidance")
@main.route("/guides/using-notify/guidance")
@user_is_logged_in @user_is_logged_in
def guidance_index(): def guidance_index():
return render_template( return render_template(

View File

@@ -1,8 +1,12 @@
{% macro breadcrumb(title, parent_menu_title, url) %}
<nav class="navigation-service usa-breadcrumb padding-top-0"> <nav class="navigation-service usa-breadcrumb padding-top-0">
<ol class="usa-breadcrumb__list"> <ol class="usa-breadcrumb__list">
<li class="usa-breadcrumb__list-item"> <li class="usa-breadcrumb__list-item">
<span class="usa-breadcrumb__label"><a href="{{ url_for('.best_practices') }}" <span class="usa-breadcrumb__label">
class="usa-link navigation-organization-link">{{ parent_menu_title }}</a></span> <a href="{{ url_for(url) }}" class="usa-link navigation-organization-link">
{{ parent_menu_title }}
</a>
</span>
</li> </li>
{% if title %} {% if title %}
<li class="usa-breadcrumb__list-item"> <li class="usa-breadcrumb__list-item">
@@ -11,3 +15,4 @@
{% endif %} {% endif %}
</ol> </ol>
</nav> </nav>
{% endmacro %}

View File

@@ -7,7 +7,6 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% block content_column_content %}
<!-- {% with title=page_title %}{% include "components/nav_breadcrumb.html" %}{% endwith %} -->
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p>Notify.gov is a text messaging service built by and for the government. We help agencies communicate more <p>Notify.gov is a text messaging service built by and for the government. We help agencies communicate more

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% set page_title = "Security" %} {% set page_title = "Security" %}
@@ -7,7 +8,8 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% block content_column_content %}
<!-- {% with title=page_title %}{% include "components/nav_breadcrumb.html" %}{% endwith %} --> {{ breadcrumbs.breadcrumb(page_title, "About", "main.about_notify") }}
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p class="font-sans-lg text-base">Notify.gov is built for the needs of government agencies with fundamental system <p class="font-sans-lg text-base">Notify.gov is built for the needs of government agencies with fundamental system

View File

@@ -1,4 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% set page_title = "Why text messaging" %} {% set page_title = "Why text messaging" %}
{% block per_page_title %} {% block per_page_title %}
@@ -6,8 +8,7 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% block content_column_content %}
<!-- {% with title=page_title, parent_title="About", url="main.why_text_messaging" %}{% include {{ breadcrumbs.breadcrumb(page_title, "About", "main.about_notify") }}
"components/nav_breadcrumb.html" %}{% endwith %} -->
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% set page_title = "Measuring performance with benchmarking" %} {% set page_title = "Measuring performance with benchmarking" %}
@@ -7,9 +8,8 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% block content_column_content %}
{% with title=page_title, parent_menu_title="Guides" %} {{ breadcrumbs.breadcrumb(page_title, "Guides", "main.best_practices") }}
{% include "components/nav_breadcrumb.html" %}
{% endwith %}
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p class="font-sans-lg text-base">Learn how effective your texting program can be.</p> <p class="font-sans-lg text-base">Learn how effective your texting program can be.</p>

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% set page_title = "Establish clear goals" %} {% set page_title = "Establish clear goals" %}
@@ -7,8 +8,8 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% 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") }}
%}
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p class="font-sans-lg text-base">Start with a singular purpose. Make explicit what you want to achieve.</p> <p class="font-sans-lg text-base">Start with a singular purpose. Make explicit what you want to achieve.</p>

View File

@@ -1,4 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% from "components/guides/circle_number.html" import circle_number %} {% from "components/guides/circle_number.html" import circle_number %}
{% set page_title = "Establish trust" %} {% set page_title = "Establish trust" %}
@@ -8,8 +10,8 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% 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") }}
%}
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p class="font-sans-lg text-base">Help your audience anticipate and welcome your texts.</p> <p class="font-sans-lg text-base">Help your audience anticipate and welcome your texts.</p>

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% set page_title = "Text in multiple languages" %} {% set page_title = "Text in multiple languages" %}
@@ -7,8 +8,8 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% 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") }}
%}
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p class="font-sans-lg text-base"> What to know as you plan translated texts.</p> <p class="font-sans-lg text-base"> What to know as you plan translated texts.</p>

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% set page_title = "Rules and regulations" %} {% set page_title = "Rules and regulations" %}
@@ -7,8 +8,8 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% 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") }}
%}
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p class="font-sans-lg text-base">Understand what is required when texting the public.</p> <p class="font-sans-lg text-base">Understand what is required when texting the public.</p>

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% import "components/nav_breadcrumb.html" as breadcrumbs %}
{% from "components/guides/circle_number.html" import circle_number %} {% from "components/guides/circle_number.html" import circle_number %}
{% set page_title = "Write texts that provoke action" %} {% set page_title = "Write texts that provoke action" %}
@@ -8,8 +9,8 @@
{% endblock %} {% endblock %}
{% block content_column_content %} {% 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") }}
%}
<section class="usa-prose"> <section class="usa-prose">
<h1>{{page_title}}</h1> <h1>{{page_title}}</h1>
<p class="font-sans-lg text-base"> Help your audience know what to do with the information you send.</p> <p class="font-sans-lg text-base"> Help your audience know what to do with the information you send.</p>