From 5560a1f72758d733c68a649cbd2f134b37f03e54 Mon Sep 17 00:00:00 2001 From: Matt Shaw Date: Thu, 29 Aug 2024 14:30:27 +0100 Subject: [PATCH 1/3] bump version numbers --- .github/workflows/python-package.yml | 2 +- CHANGELOG.md | 8 +++++++- README.md | 3 ++- setup.py | 2 +- tests/utils/test-entrypoint.sh | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ff8e3ee..790e5a8 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -46,5 +46,5 @@ jobs: run: | (cd tests/utils && nohup python -m flask run --port 3000 &) wait-for-it localhost:3000 - ./govuk-frontend-diff http://localhost:3000 --govuk-frontend-version=v5.5.0 --exclude page-template --ci + ./govuk-frontend-diff http://localhost:3000 --govuk-frontend-version=v5.6.0 --exclude page-template --ci diff --git a/CHANGELOG.md b/CHANGELOG.md index 21b47e9..ac779ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,13 @@ 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.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/LandRegistry/govuk-frontend-jinja/compare/3.2.0...main) +## [Unreleased](https://github.com/LandRegistry/govuk-frontend-jinja/compare/3.3.0...main) + +## [3.3.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.3.0) - xx/xx/2024 + +### Added + +- [GOV.UK Frontend v5.6.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.6.0) support ## [3.2.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.2.0) - 27/08/2024 diff --git a/README.md b/README.md index 98c7c88..df41cf8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GOV.UK Frontend Jinja Macros [![PyPI version](https://badge.fury.io/py/govuk-frontend-jinja.svg)](https://pypi.org/project/govuk-frontend-jinja/) -![govuk-frontend 5.5.0](https://img.shields.io/badge/govuk--frontend%20version-5.5.0-005EA5?logo=gov.uk&style=flat) +![govuk-frontend 5.6.0](https://img.shields.io/badge/govuk--frontend%20version-5.6.0-005EA5?logo=gov.uk&style=flat) [![Python package](https://github.com/LandRegistry/govuk-frontend-jinja/actions/workflows/python-package.yml/badge.svg)](https://github.com/LandRegistry/govuk-frontend-jinja/actions/workflows/python-package.yml) **GOV.UK Frontend Jinja is a [community tool](https://design-system.service.gov.uk/community/resources-and-tools/) of the [GOV.UK Design System](https://design-system.service.gov.uk/). The Design System team is not responsible for it and cannot support you with using it. Contact the [maintainers](#contributors) directly if you need [help](#support) or you want to request a feature.** @@ -16,6 +16,7 @@ The following table shows the version of GOV.UK Frontend Jinja that you should u | GOV.UK Frontend Jinja Version | Target GOV.UK Frontend Version | | ----------------------------- | ------------------------------ | +| [3.3.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.3.0) | [5.6.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.6.0) | | [3.2.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.2.0) | [5.5.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.5.0) | | [3.1.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.1.0) | [5.4.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.4.0) | | [3.0.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.0.0) | [5.1.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.1.0) | diff --git a/setup.py b/setup.py index 422b5ba..1a4f82a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setuptools.setup( name="govuk-frontend-jinja", - version="3.2.0", + version="3.3.0", author="Matt Shaw", author_email="matthew.shaw@landregistry.gov.uk", description="GOV.UK Frontend Jinja Macros", diff --git a/tests/utils/test-entrypoint.sh b/tests/utils/test-entrypoint.sh index d1c874c..c2090e0 100755 --- a/tests/utils/test-entrypoint.sh +++ b/tests/utils/test-entrypoint.sh @@ -5,4 +5,4 @@ set -e flake8 . (cd tests/utils && nohup python -m flask run --port 3000 &) wait-for-it localhost:3000 -./govuk-frontend-diff http://localhost:3000 --govuk-frontend-version=v5.5.0 --exclude page-template --ci +./govuk-frontend-diff http://localhost:3000 --govuk-frontend-version=v5.6.0 --exclude page-template --ci From 3c81c22925ac68705120c9cef8cea88eb745df79 Mon Sep 17 00:00:00 2001 From: Matt Shaw Date: Thu, 29 Aug 2024 15:30:54 +0100 Subject: [PATCH 2/3] add service navigation component --- CHANGELOG.md | 1 + .../components/service-navigation/macro.html | 104 ++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 govuk_frontend_jinja/templates/components/service-navigation/macro.html diff --git a/CHANGELOG.md b/CHANGELOG.md index ac779ef..bf469d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - [GOV.UK Frontend v5.6.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.6.0) support +- [Service navigation component](https://design-system.service.gov.uk/components/service-navigation/) ## [3.2.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/3.2.0) - 27/08/2024 diff --git a/govuk_frontend_jinja/templates/components/service-navigation/macro.html b/govuk_frontend_jinja/templates/components/service-navigation/macro.html new file mode 100644 index 0000000..7419c02 --- /dev/null +++ b/govuk_frontend_jinja/templates/components/service-navigation/macro.html @@ -0,0 +1,104 @@ +{% macro govukServiceNavigation(params) %} +{% from "govuk_frontend_jinja/macros/attributes.html" import govukAttributes %} + +{%- set menuButtonText = params.menuButtonText | default("Menu", true) -%} +{%- set navigationId = params.navigationId | default("navigation", true) %} + +{%- set commonAttributes %} +class="govuk-service-navigation {%- if params.classes %} {{ params.classes }}{% endif %}" +data-module="govuk-service-navigation" +{{- govukAttributes(params.attributes) }} +{% endset -%} + +{%- set innerContent %} +
+ + {# Slot: start #} + {%- if params.slots and params.slots.start %}{{ params.slots.start | safe }}{% endif -%} + +
+ {# Service name #} + {% if params.serviceName %} + + {% if params.serviceUrl %} + + {{ params.serviceName }} + + {% else %} + + {{- params.serviceName -}} + + {% endif %} + + {% endif %} + + {# Navigation #} + {% if params.navigation | length or params.slots and (params.slots.navigationStart or params.slots.navigationEnd) %} + + {% endif %} +
+ + {# Slot: end #} + {%- if params.slots and params.slots.end %}{{ params.slots.end | safe }}{% endif -%} + +
+{% endset -%} + +{# If a service name is included, we use a
element with an + aria-label to create a containing landmark region. Otherwise, the