Skip to content

Commit 0a0f0eb

Browse files
authored
Merge pull request #376 from torchbox/content-prep
All changes from the website evolution around splitting the website into divisions
2 parents 5d2582c + 5793a10 commit 0a0f0eb

File tree

299 files changed

+6386
-2405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+6386
-2405
lines changed

.github/workflows/gh-pages.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Build site (_site directory name is used for Jekyll compatiblity)
4848
run: mkdocs build --config-file ./mkdocs.yml --site-dir ./_site
4949
- name: Upload artifact
50-
uses: actions/upload-pages-artifact@v1
50+
uses: actions/upload-pages-artifact@v3
5151

5252
deploy:
5353
needs: build

docs/custom-features/divisions.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Divisions
2+
3+
The site's target audience can be grouped into divisions; e.g. the charity division, the public sector division, and the Wagtail division. All content going forward can be associated to one of these divisions.
4+
5+
The idea is that if you're a charity organisation, you can find content that's specific and relevant for you because the relevant content will all be in one place.
6+
7+
This feature allows content to be associated to a specific `DivisionPage`, which allows us to display the same theme, logo and navigation for any content related to a division. (Because of this, a page should only have one associated division.)
8+
9+
## Options
10+
11+
The available options are dependent on the `DivisionPage`s that have been created.
12+
13+
## Division configuration
14+
15+
The `tbx.core.utils.models.DivisionMixin` provides a mechanism for associating a specific division with a page. It offers the following functionality:
16+
17+
- `division` field: Adds a ForeignKey field to associate a specific division with a page.
18+
- `final_division`: A cached property that determines the appropriate division to associate to a page. It first checks if the page has a `division` specified. If not, it traverses the page's ancestors to find the first page that either has a `division` specified or is a `DivisionPage`, defaulting to `None`.
19+
20+
---
21+
22+
???+ note
23+
24+
Please ensure that the Editors' guide is updated accordingly whenever any changes are made to this feature. A private link, for Torchbox employees only, can be found at https://intranet.torchbox.com/torchbox-com-project-docs.

docs/custom-features/theme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ The Theme feature enables the customization of page styles through the applicati
66

77
The available color themes are defined using the `tbx.core.utils.models.ColourTheme` enumeration. Each theme option consists of a CSS class name and a human-readable label. The following themes are available:
88

9-
- `ColourTheme.NONE`: No specific theme applied. When the theme is set to "None", this means we don't add a `theme-****` class to the page, and the default theme (_Coral_, at the time of writing these docs) is applied.
9+
- `ColourTheme.NONE`: No specific theme applied. When the theme is set to "None", this means we don't add a `theme-****` class to the page, and the default theme (_Coral_, at the time of writing these docs) is applied (unless the page inherits a theme).
1010
- `ColourTheme.CORAL`: Applies a `theme-coral` class to the page.
11+
- `ColourTheme.NEBULINE`: Applies a `theme-nebuline` class to the page.
1112
- `ColourTheme.LAGOON`: Applies a `theme-lagoon` class to the page.
12-
- `ColourTheme.BANANA`: Applies a `theme-banana` class to the page.
13-
- `ColourTheme.EARTH`: Applies a `theme-earth` class to the page.
13+
- `ColourTheme.GREEN`: Applies a `theme-green` class to the page.
1414

1515
???+ tip
1616

docs/front-end/breakpoints.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ $breakpoints: (
1313
'x-large' '(min-width: 1280px)',
1414
// secondary breakpoints - use sparingly
1515
'small' '(min-width: 410px)',
16-
'xx-large' '(min-width: 1800px)'
16+
'menu' '(min-width: 800px)',
17+
'xx-large' '(min-width: 1440px)',
18+
'xxx-large' '(min-width: 1800px)'
1719
);
1820
```
1921

docs/front-end/fonts.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The site uses 'Outfit' as the main font and 'sans-serif' as the fallback font.
44

5-
Outfit is avaible from [Google Fonts](https://fonts.google.com/specimen/Outfit) and is a variable font. This means that the font can be loaded as a single file and the weight and style can be adjusted using CSS. Any weight between 300 and 600 can be used.
5+
Outfit is avaible from [Google Fonts](https://fonts.google.com/specimen/Outfit) and is a variable font. This means that the font can be loaded as a single file and the weight and style can be adjusted using CSS. Any weight between 200 and 600 can be used.
66

77
We originally limited the number of font variants for reasons of sustainability, although the fact that this is a variable font means that extra weights could be added if required without impacting carbon emissions.
88

@@ -12,7 +12,7 @@ The font is loaded using the following CSS in `sass/base/_fonts.scss`:
1212
@font-face {
1313
font-family: 'Outfit';
1414
font-style: normal;
15-
font-weight: 300 600;
15+
font-weight: 200 600;
1616
font-display: swap;
1717
src: url(../fonts/outfit-variable-font.woff2) format('woff2-variations');
1818
}

docs/front-end/grid.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Any alignment or spacing rules for a component should be added using BEM syntax
3636
grid-column: 2 / span 4;
3737

3838
@include media-query(large) {
39-
grid-column: 4 / span 9;
39+
grid-column: 2 / span 9;
4040
}
4141
}
4242
}

docs/front-end/motif-headings.md

-9
This file was deleted.

docs/front-end/themes_and_modes.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ The CSS to set the mode is an html class of either `.mode-dark` or `.mode-light`
88

99
An editor has an option to select a theme on each page. Selecting a theme on a page will change it for that page, and all child pages, unless another selection is made further down the page tree.
1010

11-
There are currently 4 themes in use: coral, lagoon, banana and earth. The CSS to set the theme is an html class of either `.theme-coral`, `.theme-lagoon`, `.theme-banana` or `.theme-earth`.
11+
There are currently 4 themes in use: coral, nebuline, lagoon and green. The CSS to set the theme is an html class of either `.theme-coral`, `.theme-nebuline`, `.theme-lagoon` or `.theme-green`.
1212

1313
???+ note
1414

15-
If you are adding a new theme, check the colour contrast for all the new accent colours added, used in the drop-caps (remember to check both dark mode and light mode). They need to pass colour contrast as if the entire drop-cap was filled with that colour.
15+
If you are adding a new theme, check the colour contrast for all the new accent colours added, used in the heading motifs (remember to check both dark mode and light mode). They need to pass colour contrast as if the entire heading was filled with that colour.
1616

17-
The drop-caps svgs use a semi-transparent version of the accent colours, and the contrast of the resulting colour also needs to be checked. The [colour contrast checker](https://chromewebstore.google.com/detail/colour-contrast-checker/nmmjeclfkgjdomacpcflgdkgpphpmnfe?hl=en-GB&utm_source=ext_sidebar) is a useful chrome extension to assist with this.
17+
The motifs svgs use a semi-transparent version of the accent colours, and the contrast of the resulting colour also needs to be checked. The [colour contrast checker](https://chromewebstore.google.com/detail/colour-contrast-checker/nmmjeclfkgjdomacpcflgdkgpphpmnfe?hl=en-GB&utm_source=ext_sidebar) is a useful chrome extension to assist with this.
1818

1919
## Defaults
2020

docs/front-end/utility-classes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Most CSS classes used in this build are designed to fit with a particular compon
44

55
Some, such as the `listing` component are designed to be a base with variations across a number of variant components - this is made clear by the component naming: `listing--image.html`, `listing--simple.html` etc.
66

7-
However, we have some utility classes which are designed for re-use, along with the option to to use Tailwind utility classes. Classes that are designed for re-use include `button`, `heading--[xyz]`, `link`, `supporting`, `.body` and `icon--listing-arrow`.
7+
However, we have some utility classes which are designed for re-use, along with the option to to use Tailwind utility classes. Classes that are designed for re-use include `button`, `heading--[xyz]`, `text--[xyz]`, `link`, and `icon--listing-arrow`.
88

99
The same tailwind utility classes that are avialable in `wagtail-kit` are available in this build. `tailwind.config.js` includes the custom spacing for the build, allowing us to use classes such as `mb-spacerMini` where it wouldn't be practical to create a new scss component just for a one-off spacing adjustment.

mkdocs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ nav:
7373
- front-end/tooling.md
7474
- front-end/placeholder-images.md
7575
- front-end/utility-classes.md
76-
- front-end/motif-headings.md
7776
- 'Markdown block and codehilite': 'front-end/markdown-codehilite.md'
7877
- front-end/impact-report.md
7978
- front-end/lite-youtube.md
8079
- front-end/facebook-app-id.md
8180
- front-end/incident-form.md
8281
- 'Navigation': 'navigation.md'
8382
- 'Custom features':
83+
- 'Contact': 'custom-features/contact.md'
84+
- 'Division': 'custom-features/divisions.md'
8485
- 'Migration-friendly StreamFields': 'custom-features/migration-friendly-streamfields.md'
85-
- 'Theme': 'custom-features/theme.md'
8686
- 'Modes': 'custom-features/modes.md'
87-
- 'Contact': 'custom-features/contact.md'
87+
- 'Theme': 'custom-features/theme.md'
8888
- 'Continuous integration': 'continuous-integration.md'
8989
- 'Anonymised data': 'anonymised-data.md'
9090
- 'Data import': 'data-import.md'

package-lock.json

+20-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
},
7070
"dependencies": {
7171
"js-cookie": "^3.0.5",
72-
"lite-youtube-embed": "^0.3.2"
72+
"lite-youtube-embed": "^0.3.2",
73+
"swiper": "^11.2.1"
7374
}
7475
}

poetry.lock

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ mkdocs-material = "^9.5.41"
6060
pymdown-extensions = "^10.11.2"
6161

6262
# Testing
63+
factory-boy = "^3.3.0"
64+
faker = "^33.3.0"
6365
wagtail-factories = "^4.2.1"
6466

6567

tailwind.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
transparent: 'transparent',
2323
background: 'var(--color--background)',
2424
heading: 'var(--color--heading)',
25+
themePrimary: 'var(--color--theme-primary)',
2526
},
2627
screens: {
2728
sm: '410px',
@@ -38,7 +39,9 @@ module.exports = {
3839
spacerMini: '15px',
3940
spacerMiniPlus: '20px',
4041
spacerSmall: '30px',
42+
spacerSmallPlus: '40px',
4143
spacerMedium: '60px',
44+
spacerMediumPlus: '100px',
4245
spacerLarge: '120px',
4346
spacer: '160px',
4447
spacerHalf: '80px',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generated by Django 4.2.16 on 2024-12-09 08:08
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("blog", "0026_add_earth_colour_theme"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="blogindexpage",
14+
name="theme",
15+
field=models.CharField(
16+
blank=True,
17+
choices=[
18+
("", "None"),
19+
("theme-coral", "Coral"),
20+
("theme-nebuline", "Nebuline"),
21+
("theme-lagoon", "Lagoon"),
22+
("theme-green", "Green"),
23+
],
24+
max_length=25,
25+
),
26+
),
27+
migrations.AlterField(
28+
model_name="blogpage",
29+
name="theme",
30+
field=models.CharField(
31+
blank=True,
32+
choices=[
33+
("", "None"),
34+
("theme-coral", "Coral"),
35+
("theme-nebuline", "Nebuline"),
36+
("theme-lagoon", "Lagoon"),
37+
("theme-green", "Green"),
38+
],
39+
max_length=25,
40+
),
41+
),
42+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Generated by Django 5.1.4 on 2025-01-28 09:34
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
("blog", "0027_update_theme_colour_choices"),
10+
("divisions", "0002_divisionmixin_and_navigationsetmixin"),
11+
("navigation", "0007_divisionmixin_and_navigationsetmixin"),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name="blogindexpage",
17+
name="division",
18+
field=models.ForeignKey(
19+
blank=True,
20+
null=True,
21+
on_delete=django.db.models.deletion.SET_NULL,
22+
to="divisions.divisionpage",
23+
),
24+
),
25+
migrations.AddField(
26+
model_name="blogindexpage",
27+
name="override_navigation_set",
28+
field=models.ForeignKey(
29+
blank=True,
30+
null=True,
31+
on_delete=django.db.models.deletion.SET_NULL,
32+
related_name="+",
33+
to="navigation.navigationset",
34+
),
35+
),
36+
migrations.AddField(
37+
model_name="blogpage",
38+
name="division",
39+
field=models.ForeignKey(
40+
blank=True,
41+
null=True,
42+
on_delete=django.db.models.deletion.SET_NULL,
43+
to="divisions.divisionpage",
44+
),
45+
),
46+
migrations.AddField(
47+
model_name="blogpage",
48+
name="override_navigation_set",
49+
field=models.ForeignKey(
50+
blank=True,
51+
null=True,
52+
on_delete=django.db.models.deletion.SET_NULL,
53+
related_name="+",
54+
to="navigation.navigationset",
55+
),
56+
),
57+
]

0 commit comments

Comments
 (0)