-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from nhsuk/frontend-v9
Updating nhsuk frontend library to v9
- Loading branch information
Showing
19 changed files
with
372 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Footer | ||
|
||
## Wagtail Site Settings | ||
|
||
wagtail-nhs-style comes with a wagtail | ||
[site settings](http://docs.wagtail.io/en/v2.4/reference/contrib/settings.html) | ||
model. If you want to allow CMS users to configure the footer in the wagtail | ||
interface, use of the site setting is recommended. | ||
|
||
Add the `wagtailnhsukfrontend.settings` module to your `INSTALLED_APPS` config. | ||
|
||
```python | ||
INSTALLED_APPS = [ | ||
... | ||
'wagtailnhsukfrontend', | ||
'wagtailnhsukfrontend.settings', | ||
... | ||
] | ||
``` | ||
|
||
This will create a new option under `Settings > Footer settings` in the | ||
wagtail interface. | ||
|
||
To include the footer in your template, use the `header` templatetag. | ||
|
||
```python | ||
{% load nhsukfrontendsettings_tags %} | ||
|
||
... | ||
|
||
<body> | ||
... | ||
{% footer %} | ||
</body> | ||
``` | ||
--- | ||
|
||
The NHS.UK footer component can be configured in two styles: | ||
|
||
--- | ||
|
||
## Column-based Footer | ||
|
||
The column-based footer allows content to be organised into up to 4 columns. Each column can contain multiple links to either internal Wagtail pages or external URLs. | ||
|
||
### Enabling Column-based Footer | ||
|
||
1. In Wagtail Admin, navigate to **Settings > Footer Column Settings** | ||
2. Tick **"Enable column-based footer"** | ||
3. Add footer links using the **"Footer Column Links"** panel | ||
4. For each link: | ||
- Select the column number (1–4) | ||
- Enter the link label | ||
- Choose either: | ||
- An internal page using **"Link page"** | ||
- An external URL using **"Link URL"** | ||
|
||
### Template Usage | ||
|
||
```django | ||
{% include 'wagtailnhsukfrontend/footer.html' %} | ||
``` | ||
|
||
The template automatically detects which footer style to use based on your settings. | ||
|
||
## Standard Footer | ||
The standard footer provides a single column of links and can be configured through Settings > Footer Settings. | ||
|
||
### Configuration | ||
1. In Wagtail Admin, navigate to Settings > Footer Settings | ||
2. Add footer links using the "Footer Links" panel | ||
3. For each link: | ||
- Enter the URL | ||
- Enter the link label | ||
|
||
### Template Usage | ||
```django | ||
{% include 'wagtailnhsukfrontend/footer.html' %} | ||
``` | ||
|
||
### Customisation | ||
Both footer styles include: | ||
|
||
- NHS copyright notice | ||
- Semantic HTML with proper ARIA roles | ||
- Responsive design following NHS.UK frontend standards | ||
|
||
|
||
## Reference | ||
|
||
* [Service Manual](https://service-manual.nhs.uk/design-system/components/footer) | ||
* [Frontend Library](https://github.com/nhsuk/nhsuk-frontend/tree/master/packages/components/footer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
|
||
setup( | ||
name="wagtail-nhsuk-frontend", | ||
version="1.5.3", | ||
version="1.6.0", | ||
description="NHSUK Frontend Styles for Wagtail", | ||
author="Brad Morton", | ||
author_email="<[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.18 on 2025-01-31 09:07 | ||
|
||
from django.db import migrations | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('home', '0025_remove_callout_tickbox'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='hubspage', | ||
name='body', | ||
field=wagtail.fields.StreamField([('card_basic', 4), ('primary_card', 7), ('card_clickable', 7), ('card_image', 11), ('card_feature', 13), ('card_group', 16)], block_lookup={0: ('wagtail.blocks.CharBlock', (), {'required': True}), 1: ('wagtail.blocks.IntegerBlock', (), {'default': 3, 'help_text': 'The heading level affects users with screen readers. Ignore this if there is no label. Default=3, Min=2, Max=6.', 'max_value': 6, 'min_value': 2}), 2: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('small', 'Small'), ('medium', 'Medium'), ('large', 'Large')], 'help_text': "The heading size affects the visual size, this follows the front-end library's sizing.", 'required': False}), 3: ('wagtail.blocks.RichTextBlock', (), {'required': False}), 4: ('wagtail.blocks.StructBlock', [[('heading', 0), ('heading_level', 1), ('heading_size', 2), ('body', 3)]], {}), 5: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Interal Page Link for the card', 'label': 'Internal Page', 'required': False}), 6: ('wagtail.blocks.URLBlock', (), {'help_text': 'External Link for the card', 'label': 'URL', 'required': False}), 7: ('wagtail.blocks.StructBlock', [[('heading', 0), ('heading_level', 1), ('heading_size', 2), ('body', 3), ('internal_page', 5), ('url', 6)]], {}), 8: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'required': True}), 9: ('wagtail.blocks.URLBlock', (), {'help_text': 'Optional, if there is a link the entire card will be clickable.', 'label': 'URL', 'required': False}), 10: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Optional, if there is a link the entire card will be clickable.', 'label': 'Internal Page', 'required': False}), 11: ('wagtail.blocks.StructBlock', [[('heading', 0), ('heading_level', 1), ('heading_size', 2), ('body', 3), ('content_image', 8), ('alt_text', 0), ('url', 9), ('internal_page', 10)]], {}), 12: ('wagtail.blocks.RichTextBlock', (), {'required': True}), 13: ('wagtail.blocks.StructBlock', [[('feature_heading', 0), ('heading_level', 1), ('heading_size', 2), ('body', 12)]], {}), 14: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Full-width'), ('one-half', 'One-half'), ('one-third', 'One-third')], 'required': False}), 15: ('wagtail.blocks.StreamBlock', [[('card_basic', 4), ('card_clickable', 7), ('card_image', 11), ('card_feature', 13)]], {'required': True}), 16: ('wagtail.blocks.StructBlock', [[('column', 14), ('body', 15)]], {})}), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
wagtailnhsukfrontend/settings/migrations/0008_footersettingscolumns_footercolumnlinks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Generated by Django 4.2.18 on 2025-01-30 15:09 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import modelcluster.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtailcore', '0094_alter_page_locale'), | ||
('wagtailnhsukfrontendsettings', '0007_organisational_header'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='FooterSettingsColumns', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('enable_column_footer', models.BooleanField(default=False, help_text='Enable the column-based footer layout')), | ||
('site', models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.site')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='FooterColumnLinks', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('sort_order', models.IntegerField(blank=True, editable=False, null=True)), | ||
('column', models.IntegerField(choices=[(1, 'Column 1'), (2, 'Column 2'), (3, 'Column 3'), (4, 'Column 4')], default=1)), | ||
('link_label', models.CharField(max_length=250)), | ||
('link_url', models.URLField(blank=True)), | ||
('link_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.page')), | ||
('setting', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='column_links', to='wagtailnhsukfrontendsettings.footersettingscolumns')), | ||
], | ||
options={ | ||
'ordering': ['sort_order'], | ||
'abstract': False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
wagtailnhsukfrontend/static/wagtailnhsukfrontend/css/nhsuk.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.