govuk_web_banners 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +48 -24
- data/config/govuk_web_banners/recruitment_banners.yml +31 -1
- data/lib/govuk_web_banners/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e90dcafd54461fe4a723458faccd96d342d6d4d4ad26451ea38431b94d56c2b4
|
4
|
+
data.tar.gz: c12a85485ac267611ca6096fd3185bbb9c84123fb106f0102d9f88e872aeda11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68690f93a35d664a9d6ed0103b6082987196a190b8089005ca0b6fe7a0cf3892106836f6e27c1f0bd033edf33dc9c9ddc5994cad80cca419ea5c2cf95cee6d1c
|
7
|
+
data.tar.gz: a40d8c454e7b64ade2254e18c6ef09965b0023b1d79223771177c703d0182b9ffb14e7db63d3048223b1f054d4431b0bdee3aa589bf8f432895fea9600148a84
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# GovukWebBanners
|
2
|
-
Proof of Concept for centralising handling of Recruitment, Global, and Emergency
|
2
|
+
Proof of Concept for centralising handling of Recruitment, Global, and Emergency
|
3
|
+
banners (currently spread across apps)
|
3
4
|
|
4
5
|
## Usage
|
5
|
-
Currently
|
6
|
+
Currently supports recruitment banners
|
6
7
|
|
7
8
|
## Adding the gem to your application
|
8
9
|
Add this line to your application's Gemfile:
|
@@ -27,20 +28,35 @@ Add the JS dependencies to your existing asset dependencies file:
|
|
27
28
|
//= require govuk_web_banners/dependencies
|
28
29
|
```
|
29
30
|
|
30
|
-
|
31
|
+
## Adding recruitment banners
|
32
|
+
|
33
|
+
Add a call to the partial in the layout or view that you want banners to appear
|
34
|
+
in (typically recruitment banners should be in the layout, below the breadcrumbs
|
35
|
+
and just above the `main` element):
|
31
36
|
|
32
37
|
```
|
33
38
|
<%= render "govuk_web_banners/recruitment_banner" %>
|
34
39
|
```
|
35
40
|
|
36
|
-
|
37
|
-
|
41
|
+
### Required stylesheets
|
42
|
+
|
43
|
+
If you are using individual component stylesheets in your app, you should make
|
44
|
+
sure the call to the recruitment_banner partial is above the call to
|
45
|
+
render_component_stylesheets in your layout.
|
46
|
+
|
47
|
+
If you are _not_ using individual component stylesheets in your app, you will
|
48
|
+
have to make sure the intervention component's styles are included in your
|
49
|
+
application stylesheet:
|
50
|
+
|
51
|
+
`@import "govuk_publishing_components/components/intervention"`
|
38
52
|
|
39
53
|
## Updating banner information in the gem
|
40
54
|
|
41
|
-
Data for the current set of live banners can be found at
|
42
|
-
add a banner to the
|
43
|
-
|
55
|
+
Data for the current set of live banners can be found at
|
56
|
+
`config/govuk_web_banners/recruitment_banners.yml`. To add a banner to the
|
57
|
+
config, add an entry under the banners: array. Note that this array must always
|
58
|
+
be valid, so if there are no banners in the file, it must contain at least
|
59
|
+
`banners: []`
|
44
60
|
|
45
61
|
### Example banner entry
|
46
62
|
|
@@ -57,32 +73,40 @@ banners:
|
|
57
73
|
end_date: 18/11/2024
|
58
74
|
```
|
59
75
|
|
60
|
-
The required keys are `suggestion_text`, `suggestion_link_text`, and
|
61
|
-
banner), and `page_paths` (an array of
|
76
|
+
The required keys are `suggestion_text`, `suggestion_link_text`, and
|
77
|
+
`survey_url` (the values to appear in the banner), and `page_paths` (an array of
|
78
|
+
paths on which the banner should be shown).
|
62
79
|
|
63
|
-
Optional keys are `name` (an identifying name for this banner, not rendered
|
64
|
-
|
65
|
-
specified as `
|
80
|
+
Optional keys are `name` (an identifying name for this banner, not rendered
|
81
|
+
anywhere), and `start_date` / `end_date` (the banner becomes active at the start
|
82
|
+
of the day specified as `start_date`, and stops at the *start* of the day
|
83
|
+
specified as `end_date`). Start and end dates must be in the DD/MM/YYYY format
|
84
|
+
parsable as a YAML -> Date.
|
66
85
|
|
67
86
|
### Keeping the config file valid and tidy
|
68
87
|
|
69
|
-
The config file will be checked during CI, so an invalid file can't be released
|
70
|
-
to make sure it's kept tidy. These checks include:
|
88
|
+
The config file will be checked during CI, so an invalid file can't be released
|
89
|
+
as a gem and we are forced to make sure it's kept tidy. These checks include:
|
71
90
|
|
72
91
|
* the banners array must be a valid YAML array
|
73
|
-
* all banners have a suggestion_text, suggestion_link_text, survey_url and
|
74
|
-
|
92
|
+
* all banners have a suggestion_text, suggestion_link_text, survey_url and
|
93
|
+
page_paths
|
94
|
+
* the same page_path is not present on two banners that are active at the same
|
95
|
+
time
|
75
96
|
* paths must start with a forward-slash (/)
|
76
97
|
|
77
98
|
It will also display warnings (but not fail CI)
|
78
99
|
|
79
|
-
* if there are banners that have expired - you are encouraged to remove obsolete
|
80
|
-
prevent you merging changes.
|
81
|
-
* if page_paths point to pages that are not currently live on GOV.UK - this may
|
82
|
-
is for a page that isn't yet published), or it
|
100
|
+
* if there are banners that have expired - you are encouraged to remove obsolete
|
101
|
+
config, but it will not prevent you merging changes.
|
102
|
+
* if page_paths point to pages that are not currently live on GOV.UK - this may
|
103
|
+
be intentional (if the banner is for a page that isn't yet published), or it
|
104
|
+
may indicate a typo in the path.
|
83
105
|
|
84
|
-
Note that some of this validation code is in the
|
85
|
-
should be tested to ensure the
|
106
|
+
Note that some of this validation code is in the
|
107
|
+
lib/govuk_web_banners/validators path, which should be tested to ensure the
|
108
|
+
checking is valid, but will not be bundled into the released gem.
|
86
109
|
|
87
110
|
## License
|
88
|
-
The gem is available as open source under the terms of the [MIT
|
111
|
+
The gem is available as open source under the terms of the [MIT
|
112
|
+
License](https://opensource.org/licenses/MIT).
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# Example usage of adding a banner to the banners list
|
2
2
|
|
3
|
+
# banners:
|
3
4
|
# - name: Banner 1
|
4
5
|
# suggestion_text: "Help improve GOV.UK"
|
5
6
|
# suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
|
@@ -14,4 +15,33 @@
|
|
14
15
|
#
|
15
16
|
# Note that this file must contain a valid banners array, so if there are no banners
|
16
17
|
# currently included, the file should at least contain banners: []
|
17
|
-
banners:
|
18
|
+
banners:
|
19
|
+
- name: AI banner 11/11/2024
|
20
|
+
suggestion_text: "Help improve GOV.UK"
|
21
|
+
suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
|
22
|
+
survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S
|
23
|
+
page_paths:
|
24
|
+
# government frontend:
|
25
|
+
- /self-assessment-tax-returns
|
26
|
+
- /working-for-yourself
|
27
|
+
- /self-employed-records
|
28
|
+
- /expenses-if-youre-self-employed
|
29
|
+
- /first-company-accounts-and-return
|
30
|
+
- /what-is-the-construction-industry-scheme
|
31
|
+
- /capital-allowances
|
32
|
+
- /simpler-income-tax-cash-basis
|
33
|
+
- /expenses-and-benefits-a-to-z
|
34
|
+
- /capital-gains-tax
|
35
|
+
- /directors-loans
|
36
|
+
- /self-assessment-tax-return-forms
|
37
|
+
- /running-a-limited-company
|
38
|
+
- /calculate-tax-on-company-cars
|
39
|
+
- /introduction-to-business-rates
|
40
|
+
- /calculate-your-business-rates
|
41
|
+
- /apply-for-business-rate-relief
|
42
|
+
- /stop-being-self-employed
|
43
|
+
- /tax-codes
|
44
|
+
# finder-frontend:
|
45
|
+
- /business-finance-support
|
46
|
+
start_date: 11/11/2024
|
47
|
+
end_date: 06/01/2025
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_web_banners
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_publishing_components
|