From c77bc47286c6122c539b46867498ae3e091607cd Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 11 Jul 2024 15:44:38 +0100 Subject: [PATCH] v0.1.34 --- CHANGELOG.md | 8 +- README.md | 1 + package-lock.json | 8 +- package.json | 2 +- setup.py | 2 +- test/app/components/routes.py | 10 +++ test/app/components/test-templates/files.html | 2 + .../components/test-templates/gallery.html | 2 + .../templates/components/accordion/macro.html | 12 +-- .../components/breadcrumbs/macro.html | 2 +- .../templates/components/button/macro.html | 4 +- .../templates/components/card/macro.html | 10 +-- .../components/checkboxes/macro.html | 6 +- .../components/compound-filters/macro.html | 2 +- .../components/cookie-banner/macro.html | 2 +- .../components/date-input/macro.html | 2 +- .../components/date-search/macro.html | 6 +- .../templates/components/details/macro.html | 2 +- .../components/error-summary/macro.html | 2 +- .../components/featured-records/macro.html | 2 +- .../templates/components/files/macro.html | 35 ++++++++ .../templates/components/footer/macro.html | 2 +- .../templates/components/gallery/macro.html | 85 +++++++++++++++++++ .../components/global-header/macro.html | 2 +- .../templates/components/grid/macro.html | 2 +- .../templates/components/header/macro.html | 2 +- .../templates/components/hero/macro.html | 2 +- .../components/index-grid/macro.html | 6 +- .../components/pagination/macro.html | 2 +- .../components/phase-banner/macro.html | 2 +- .../templates/components/picture/macro.html | 2 +- .../components/quick-filters/macro.html | 2 +- .../templates/components/radios/macro.html | 2 +- .../components/search-field/macro.html | 4 +- .../components/search-filters/macro.html | 2 +- .../templates/components/select/macro.html | 4 +- .../components/sensitive-image/macro.html | 2 +- .../templates/components/sidebar/macro.html | 4 +- .../templates/components/skip-link/macro.html | 2 +- .../templates/components/tabs/macro.html | 2 +- .../components/text-input/macro.html | 6 +- .../templates/components/textarea/macro.html | 4 +- .../templates/components/warning/macro.html | 2 +- .../templates/layouts/base.html | 4 +- 44 files changed, 207 insertions(+), 62 deletions(-) create mode 100644 test/app/components/test-templates/files.html create mode 100644 test/app/components/test-templates/gallery.html create mode 100644 tna_frontend_jinja/templates/components/files/macro.html create mode 100644 tna_frontend_jinja/templates/components/gallery/macro.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 4075ab1..48f8671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/nationalarchives/tna-frontend-jinja/compare/v0.1.33...HEAD) +## [Unreleased](https://github.com/nationalarchives/tna-frontend-jinja/compare/v0.1.34...HEAD) ### Added ### Changed @@ -14,6 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security +## [0.1.34](https://github.com/nationalarchives/tna-frontend-jinja/compare/v0.1.33...v0.1.34) - 2024-07-11 + +### Changed + +- Upgraded TNA Frontend to `v0.1.65` + ## [0.1.33](https://github.com/nationalarchives/tna-frontend-jinja/compare/v0.1.32...v0.1.33) - 2024-06-24 ### Changed diff --git a/README.md b/README.md index d1dd2f5..1826145 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ We test each component against its published [component fixtures](https://github | TNA Frontend Jinja | Compatible TNA Frontend versions | | --------------------- | ------------------------------------------ | +| `0.1.34` | `v0.1.65` | | `0.1.33` | `v0.1.62`, `v0.1.63`, `v0.1.64` | | `0.1.32` | `v0.1.60`, `v0.1.61` | | `0.1.31` | `v0.1.59` | diff --git a/package-lock.json b/package-lock.json index 7531c36..fa9fcca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@nationalarchives/frontend": "0.1.62", + "@nationalarchives/frontend": "0.1.65", "diff": "^5.1.0", "glob": "^10.2.7", "js-beautify": "^1.14.8", @@ -30,9 +30,9 @@ } }, "node_modules/@nationalarchives/frontend": { - "version": "0.1.62", - "resolved": "https://registry.npmjs.org/@nationalarchives/frontend/-/frontend-0.1.62.tgz", - "integrity": "sha512-b5z1v1x9O68OtJSIVWB72H5vKLJBjOBRAwQ4gaP3da5YiqDHxvoHqhx/aqTHaqk5Ynw4EK09khJu4MTwY1zGYQ==" + "version": "0.1.65", + "resolved": "https://registry.npmjs.org/@nationalarchives/frontend/-/frontend-0.1.65.tgz", + "integrity": "sha512-9a6NAQjSfgsVLGucjLJXEPaUwzpWLQcMc3WdHIs+qVBd7hx7UZD5RCmzAEtJgJbROOpeg3AOBJiR8fwcbwA7Xg==" }, "node_modules/@one-ini/wasm": { "version": "0.1.1", diff --git a/package.json b/package.json index 4ecf286..1eb741e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "test": "node test-fixtures.mjs" }, "dependencies": { - "@nationalarchives/frontend": "0.1.62", + "@nationalarchives/frontend": "0.1.65", "diff": "^5.1.0", "glob": "^10.2.7", "js-beautify": "^1.14.8", diff --git a/setup.py b/setup.py index 7ee5ed1..82fe03f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="tna-frontend-jinja", - version="0.1.33", + version="0.1.34", author="Andrew Hosgood", author_email="andrew.hosgood@nationalarchives.gov.uk", description="TNA Frontend Jinja templates", diff --git a/test/app/components/routes.py b/test/app/components/routes.py index 3584172..2a8d578 100644 --- a/test/app/components/routes.py +++ b/test/app/components/routes.py @@ -70,11 +70,21 @@ def featured_records(): return render_component("featured-records.html") +@bp.route("/files") +def files(): + return render_component("files.html") + + @bp.route("/footer") def footer(): return render_component("footer.html") +@bp.route("/gallery") +def gallery(): + return render_component("gallery.html") + + @bp.route("/grid") def grid(): return render_component("grid.html") diff --git a/test/app/components/test-templates/files.html b/test/app/components/test-templates/files.html new file mode 100644 index 0000000..0b85c9a --- /dev/null +++ b/test/app/components/test-templates/files.html @@ -0,0 +1,2 @@ +{%- from "components/files/macro.html" import tnaFiles -%} +{{ tnaFiles(context) }} \ No newline at end of file diff --git a/test/app/components/test-templates/gallery.html b/test/app/components/test-templates/gallery.html new file mode 100644 index 0000000..ad69656 --- /dev/null +++ b/test/app/components/test-templates/gallery.html @@ -0,0 +1,2 @@ +{%- from "components/gallery/macro.html" import tnaGallery -%} +{{ tnaGallery(context) }} \ No newline at end of file diff --git a/tna_frontend_jinja/templates/components/accordion/macro.html b/tna_frontend_jinja/templates/components/accordion/macro.html index f600409..7bb39c6 100644 --- a/tna_frontend_jinja/templates/components/accordion/macro.html +++ b/tna_frontend_jinja/templates/components/accordion/macro.html @@ -1,18 +1,20 @@ {% macro tnaAccordion(params) %} {%- set containerClasses = [params.classes] if params.classes else [] -%} {%- set classes = containerClasses | join(' ') -%} -
+
{%- for item in params['items'] %} -
- {{ item.title }} -
+
+ + {{ item.title }} + +
{%- if item.text %}

{{ item.text }}

{%- else %} {{ item.body | safe }} {%- endif %}
-
+
{%- endfor %}
{% endmacro %} \ No newline at end of file diff --git a/tna_frontend_jinja/templates/components/breadcrumbs/macro.html b/tna_frontend_jinja/templates/components/breadcrumbs/macro.html index 2e142e1..53419ce 100644 --- a/tna_frontend_jinja/templates/components/breadcrumbs/macro.html +++ b/tna_frontend_jinja/templates/components/breadcrumbs/macro.html @@ -4,7 +4,7 @@ {%- set containerClasses = containerClasses + ['tna-breadcrumbs--no-collapse'] -%} {%- endif -%} {%- set classes = ' '.join(containerClasses) -%} -