Skip to content

Commit 73a69b3

Browse files
authored
Merge pull request #150 from LandRegistry/navigation
Service navigation
2 parents 34e2df9 + 2d4a9f0 commit 73a69b3

18 files changed

+81
-248
lines changed

.github/workflows/codeql.yml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main", "develop" ]
16+
branches: ["main", "develop"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
19+
branches: ["main"]
2020
schedule:
21-
- cron: '40 16 * * 6'
21+
- cron: "40 16 * * 6"
2222

2323
jobs:
2424
analyze:
@@ -38,45 +38,44 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
language: [ 'javascript-typescript', 'python' ]
41+
language: ["javascript-typescript", "python"]
4242
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
4343
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
4444
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
4545
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
4646

4747
steps:
48-
- name: Checkout repository
49-
uses: actions/checkout@v4
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
5050

51-
# Initializes the CodeQL tools for scanning.
52-
- name: Initialize CodeQL
53-
uses: github/codeql-action/init@v2
54-
with:
55-
languages: ${{ matrix.language }}
56-
# If you wish to specify custom queries, you can do so here or in a config file.
57-
# By default, queries listed here will override any specified in a config file.
58-
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@v2
54+
with:
55+
languages: ${{ matrix.language }}
56+
# If you wish to specify custom queries, you can do so here or in a config file.
57+
# By default, queries listed here will override any specified in a config file.
58+
# Prefix the list here with "+" to use these queries and those in the config file.
5959

60-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61-
# queries: security-extended,security-and-quality
60+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61+
# queries: security-extended,security-and-quality
6262

63+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
64+
# If this step fails, then you should remove it and run the build manually (see below)
65+
- name: Autobuild
66+
uses: github/codeql-action/autobuild@v2
6367

64-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
65-
# If this step fails, then you should remove it and run the build manually (see below)
66-
- name: Autobuild
67-
uses: github/codeql-action/autobuild@v2
68+
# ℹ️ Command-line programs to run using the OS shell.
69+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6870

69-
# ℹ️ Command-line programs to run using the OS shell.
70-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
71+
# If the Autobuild fails above, remove it and uncomment the following three lines.
72+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
7173

72-
# If the Autobuild fails above, remove it and uncomment the following three lines.
73-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
74+
# - run: |
75+
# echo "Run, Build Application using script"
76+
# ./location_of_script_within_repo/buildscript.sh
7477

75-
# - run: |
76-
# echo "Run, Build Application using script"
77-
# ./location_of_script_within_repo/buildscript.sh
78-
79-
- name: Perform CodeQL Analysis
80-
uses: github/codeql-action/analyze@v2
81-
with:
82-
category: "/language:${{matrix.language}}"
78+
- name: Perform CodeQL Analysis
79+
uses: github/codeql-action/analyze@v2
80+
with:
81+
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#
88
# Source repository: https://github.com/actions/dependency-review-action
99
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
10-
name: 'Dependency review'
10+
name: "Dependency review"
1111
on:
1212
pull_request:
13-
branches: [ "main" ]
13+
branches: ["main"]
1414

1515
# If using a dependency submission action in this workflow this permission will need to be set to:
1616
#
@@ -27,9 +27,9 @@ jobs:
2727
dependency-review:
2828
runs-on: ubuntu-latest
2929
steps:
30-
- name: 'Checkout repository'
30+
- name: "Checkout repository"
3131
uses: actions/checkout@v4
32-
- name: 'Dependency Review'
32+
- name: "Dependency Review"
3333
uses: actions/dependency-review-action@v4
3434
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
3535
with:

.github/workflows/python-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Python application
55

66
on:
77
push:
8-
branches: [ "main" ]
8+
branches: ["main"]
99
pull_request:
10-
branches: [ "main" ]
10+
branches: ["main"]
1111

1212
permissions:
1313
contents: read

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GOV.UK Frontend Flask
22

3-
![govuk-frontend 5.6.0](https://img.shields.io/badge/govuk--frontend%20version-5.6.0-005EA5?logo=gov.uk&style=flat)
3+
![govuk-frontend 5.7.1](https://img.shields.io/badge/govuk--frontend%20version-5.7.1-005EA5?logo=gov.uk&style=flat)
44

55
**GOV.UK Frontend Flask 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.**
66

@@ -35,7 +35,7 @@ In the `compose.yml` file you will find a number of environment variables. These
3535
- SERVICE_PHASE
3636
- SERVICE_URL
3737

38-
You must also set a new unique `SECRET_KEY`, which is used to securely sign the session cookie and CSRF tokens. It should be a long random `bytes` or `str`. You can use the output of this Python comand to generate a new key:
38+
You must also set a new unique `SECRET_KEY`, which is used to securely sign the session cookie and CSRF tokens. It should be a long random `bytes` or `str`. You can use the output of this Python command to generate a new key:
3939

4040
```shell
4141
python -c 'import secrets; print(secrets.token_hex())'
@@ -108,7 +108,7 @@ Please refer to the specific packages documentation for more details.
108108

109109
Custom CSS and JavaScript files are merged and minified using [Flask Assets](https://flask-assets.readthedocs.io/en/latest/) and [Webassets](https://webassets.readthedocs.io/en/latest/). This takes all `*.css` files in `app/static/src/css` and all `*.js` files in `app/static/src/js` and outputs a single minified file to both `app/static/dist/css` and `app/static/dist/js` respectively.
110110

111-
CSS is [minified](https://en.wikipedia.org/wiki/Minification_(programming)) using [CSSMin](https://github.com/zacharyvoase/cssmin) and JavaScript is minified using [JSMin](https://github.com/tikitu/jsmin/). This removes all whitespace characters, comments and line breaks to reduce the size of the source code, making its transmission over a network more efficient.
111+
CSS is [minified](<https://en.wikipedia.org/wiki/Minification_(programming)>) using [CSSMin](https://github.com/zacharyvoase/cssmin) and JavaScript is minified using [JSMin](https://github.com/tikitu/jsmin/). This removes all whitespace characters, comments and line breaks to reduce the size of the source code, making its transmission over a network more efficient.
112112

113113
### Cache busting
114114

app/templates/base.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{%- from 'govuk_frontend_jinja/components/error-summary/macro.html' import govukErrorSummary-%}
55
{%- from 'govuk_frontend_jinja/components/notification-banner/macro.html' import govukNotificationBanner -%}
66
{%- from 'govuk_frontend_jinja/components/phase-banner/macro.html' import govukPhaseBanner -%}
7+
{%- from 'govuk_frontend_jinja/components/service-navigation/macro.html' import govukServiceNavigation -%}
78

89
{% set assetPath = url_for('static', filename='').rstrip('/') %}
910

@@ -13,7 +14,7 @@
1314
<meta name="description" content="{{config['SERVICE_NAME']}}">
1415
<meta name="keywords" content="GOV.UK, govuk, gov, government, uk, frontend, ui, user interface, jinja, python, flask, port, template, templating, macro, component, design system, html, forms, wtf, wtforms, widget, widgets, demo, example">
1516
<meta name="author" content="{{config['DEPARTMENT_NAME']}}">
16-
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='govuk-frontend-5.6.0.min.css') }}" />
17+
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='govuk-frontend-5.7.1.min.css') }}" />
1718
{% assets "css" %}<link href="{{ ASSET_URL }}" rel="stylesheet">{% endassets %}
1819
{% endblock %}
1920

@@ -108,10 +109,17 @@
108109

109110
{% block header %}
110111
{{ govukHeader({
111-
'homepageUrl': url_for('main.index'),
112+
'classes': 'govuk-header--full-width-border',
113+
'homepageUrl': 'https://www.gov.uk/'
114+
}) }}
115+
116+
{{ govukServiceNavigation({
112117
'serviceName': config['SERVICE_NAME'],
113118
'serviceUrl': url_for('main.index'),
114-
'useTudorCrown': true
119+
'navigation': [
120+
{'href': url_for('demos.components'), 'text': 'Components'},
121+
{'href': url_for('demos.forms'), 'text': 'Forms'}
122+
]
115123
}) }}
116124
{% endblock %}
117125

@@ -161,9 +169,9 @@
161169
{% endblock %}
162170

163171
{% block bodyEnd %}
164-
<script type="module" src="{{ url_for('static', filename='govuk-frontend-5.6.0.min.js') }}"></script>
172+
<script type="module" src="{{ url_for('static', filename='govuk-frontend-5.7.1.min.js') }}"></script>
165173
<script type="module">
166-
import { initAll } from "{{ url_for('static', filename='govuk-frontend-5.6.0.min.js') }}"
174+
import { initAll } from "{{ url_for('static', filename='govuk-frontend-5.7.1.min.js') }}"
167175
initAll()
168176
</script>
169177
{% assets "js" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}

app/templates/demos/autocomplete.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
{% extends "base.html" %}
22

3-
{%- from 'govuk_frontend_jinja/components/breadcrumbs/macro.html' import govukBreadcrumbs -%}
4-
53
{% block pageTitle %}{%- if form.errors %}Error: {% endif -%}Autocomplete – GOV.UK{% endblock %}
64

7-
{% block beforeContent %}
8-
{{ super() }}
9-
{{ govukBreadcrumbs({
10-
'collapseOnMobile': True,
11-
'items': [
12-
{
13-
'text': "Home",
14-
'href': url_for('main.index')
15-
},
16-
{
17-
'text': "Forms",
18-
'href': url_for('demos.forms')
19-
},
20-
{
21-
'text': "Autocomplete"
22-
}
23-
]
24-
}) }}
25-
{% endblock %}
26-
275
{% block content %}
286
<div class="govuk-grid-row">
297
<div class="govuk-grid-column-two-thirds">

app/templates/demos/bank_details.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
{% extends "base.html" %}
22

3-
{%- from 'govuk_frontend_jinja/components/breadcrumbs/macro.html' import govukBreadcrumbs -%}
4-
53
{% block pageTitle %}{%- if form.errors %}Error: {% endif -%}Bank details – GOV.UK{% endblock %}
64

7-
{% block beforeContent %}
8-
{{ super() }}
9-
{{ govukBreadcrumbs({
10-
'collapseOnMobile': True,
11-
'items': [
12-
{
13-
'text': "Home",
14-
'href': url_for('main.index')
15-
},
16-
{
17-
'text': "Forms",
18-
'href': url_for('demos.forms')
19-
},
20-
{
21-
'text': "Bank details"
22-
}
23-
]
24-
}) }}
25-
{% endblock %}
26-
275
{% block content %}
286
<div class="govuk-grid-row">
297
<div class="govuk-grid-column-two-thirds">

app/templates/demos/component.html

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,6 @@
3939

4040
{% block pageTitle %}{{component | replace("-", " ") | capitalize}} – GOV.UK{% endblock %}
4141

42-
{% block beforeContent %}
43-
{{ super() }}
44-
{{ govukBreadcrumbs({
45-
'collapseOnMobile': True,
46-
'items': [
47-
{
48-
'text': "Home",
49-
'href': url_for('main.index')
50-
},
51-
{
52-
'text': "Components",
53-
'href': url_for('demos.components')
54-
},
55-
{
56-
'text': component | replace("-", " ") | capitalize
57-
}
58-
]
59-
}) }}
60-
{% endblock %}
61-
6242
{% block content %}
6343
<span class="govuk-caption-xl">Components</span>
6444
<h1 class="govuk-heading-xl">{{component | replace("-", " ") | capitalize}}</h1>

app/templates/demos/components.html

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
{% extends "base.html" %}
22

3-
{%- from 'govuk_frontend_jinja/components/breadcrumbs/macro.html' import govukBreadcrumbs -%}
4-
5-
{% block beforeContent %}
6-
{{ super() }}
7-
{{ govukBreadcrumbs({
8-
'collapseOnMobile': True,
9-
'items': [
10-
{
11-
'text': "Home",
12-
'href': url_for('main.index')
13-
},
14-
{
15-
'text': "Components"
16-
}
17-
]
18-
}) }}
19-
{% endblock %}
20-
213
{% block content %}
224
<div class="govuk-grid-row">
235
<div class="govuk-grid-column-two-thirds">

app/templates/demos/conditional_reveal.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
{% extends "base.html" %}
22

3-
{%- from 'govuk_frontend_jinja/components/breadcrumbs/macro.html' import govukBreadcrumbs -%}
4-
53
{% block pageTitle %}{%- if form.errors %}Error: {% endif -%}Conditionally revealed inputs – GOV.UK{% endblock %}
64

7-
{% block beforeContent %}
8-
{{ super() }}
9-
{{ govukBreadcrumbs({
10-
'collapseOnMobile': True,
11-
'items': [
12-
{
13-
'text': "Home",
14-
'href': url_for('main.index')
15-
},
16-
{
17-
'text': "Forms",
18-
'href': url_for('demos.forms')
19-
},
20-
{
21-
'text': "Conditional reveal"
22-
}
23-
]
24-
}) }}
25-
{% endblock %}
26-
275
{% block content %}
286
<div class="govuk-grid-row">
297
<div class="govuk-grid-column-two-thirds">

app/templates/demos/create_account.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,7 @@
11
{% extends "base.html" %}
22

3-
{%- from 'govuk_frontend_jinja/components/breadcrumbs/macro.html' import govukBreadcrumbs -%}
4-
53
{% block pageTitle %}{%- if form.errors %}Error: {% endif -%}Create an account – GOV.UK{% endblock %}
64

7-
{% block beforeContent %}
8-
{{ super() }}
9-
{{ govukBreadcrumbs({
10-
'collapseOnMobile': True,
11-
'items': [
12-
{
13-
'text': "Home",
14-
'href': url_for('main.index')
15-
},
16-
{
17-
'text': "Forms",
18-
'href': url_for('demos.forms')
19-
},
20-
{
21-
'text': "Create account"
22-
}
23-
]
24-
}) }}
25-
{% endblock %}
26-
275
{% block content %}
286
<div class="govuk-grid-row">
297
<div class="govuk-grid-column-two-thirds">

app/templates/demos/forms.html

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
{% extends "base.html" %}
22

3-
{%- from 'govuk_frontend_jinja/components/breadcrumbs/macro.html' import govukBreadcrumbs -%}
4-
5-
{% block beforeContent %}
6-
{{ super() }}
7-
8-
{{ govukBreadcrumbs({
9-
'collapseOnMobile': True,
10-
'items': [
11-
{
12-
'text': "Home",
13-
'href': url_for('main.index')
14-
},
15-
{
16-
'text': "Forms"
17-
}
18-
]
19-
}) }}
20-
{% endblock %}
21-
223
{% block content %}
234
<div class="govuk-grid-row">
245
<div class="govuk-grid-column-two-thirds">

0 commit comments

Comments
 (0)