From 996db0d60bd7765bbffb79f3bf862daf1027f8ae Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Fri, 1 Mar 2024 10:38:07 -0800 Subject: [PATCH] relative path update --- app/templates/new/base.html | 23 +++++++++++------------ app/templates/new/templates_glossary.md | 6 +++--- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/templates/new/base.html b/app/templates/new/base.html index 7f806b660..b175cff51 100644 --- a/app/templates/new/base.html +++ b/app/templates/new/base.html @@ -1,7 +1,7 @@ -{% 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 -%} +{% 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 -%} @@ -59,16 +59,15 @@ {% endblock %} {% endblock %} -
block skipLink + {% block skipLink %} {{ usaSkipLink({ "href": '#main-content', "text": 'Skip to main content' }) }} {% endblock %} -
-
block header + {% block header %} {% if current_user.is_authenticated %} {% if current_user.platform_admin %} @@ -203,9 +202,9 @@ "assetsPath": asset_path + "images" }) }} {% endblock %} -
+ -
block main + {% block main %}
{% block beforeContent %} @@ -240,9 +239,9 @@
{% endblock %} -
+ -
block footer + {% block footer %} {% if current_service and current_service.research_mode %} @@ -359,7 +358,7 @@ {% endif %} {% endblock %} -
+ {% block bodyEnd %} {% block extra_javascripts %} diff --git a/app/templates/new/templates_glossary.md b/app/templates/new/templates_glossary.md index a34d06b01..894628d89 100644 --- a/app/templates/new/templates_glossary.md +++ b/app/templates/new/templates_glossary.md @@ -6,7 +6,7 @@ This document serves as a glossary for the templates directory structure of the ## Directory Structure - `/templates` - - `base.html`: The main base template from which all other templates inherit. This template is a combination of the old admin_template and main_template.html + - `base.html`: The main base template from which all other templates inherit. This template is a combination of `main_template`, `admin_template`, `settings_template`, and `content_template`. - **/layouts**: Contains base templates and shared layouts used across the site. Simply put, it defines the overall structure or skeleton of the application (less frequently revised). - `withnav_template.html`: A variation of the base layout that includes a sidebar. - `/error`: Templates for handling HTTP errors @@ -20,8 +20,8 @@ This document serves as a glossary for the templates directory structure of the - Use **inheritance** (`{% extends %}`) to build on base layouts. - Employ **components** (`{% include %}`) for reusable UI elements to keep the code DRY and facilitate easier updates. -### Notes -- Macro json files are just guides on how to structure a dict. It's not actually being used as data being passed to components +### Observation Notes +- The macro-options.json files in the header and footer component act as structural guides. They aren't directly used as data passed to the usaFooter function/macro. Instead, these files outline the expected properties and provide a description of their purpose. The `usaFooter` macro component is currently only invoked in the `admin_template`, which will eventually serve as the `base.html` template. This will simplify the approach when we change the footer macros to componenets by eliminating the need to dynamically pass this data from the base.html template.