govuk_publishing_components 6.7.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +10 -0
- data/app/views/govuk_publishing_components/components/_heading.html.erb +11 -0
- data/app/views/govuk_publishing_components/components/_search.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/docs/heading.yml +32 -0
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +10 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bba4841a5d552322905968aee5f052211f27c6098b4852773783b31df829f89c
|
4
|
+
data.tar.gz: 4dad4283c06f90c7ba5f344f06ab1e1ae689a525b759aecdfcbbf445e915f9f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ea2543a323847fe1a88c0857f5c4bcc6915399619519c31c884005faf9c1b422d0e92388933519840f39ceae547262ddfcb133332decd0ff312828dc4447f10
|
7
|
+
data.tar.gz: 2514492ef7efafd17c6b6b893f88eefadd92edbc2d821c2b86ce3609c39887789219bf415fb14e08feb25a3e8c30f34b9e40170421210b08f50e6eedc72519ec
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: Heading
|
2
|
+
description: A text heading
|
3
|
+
body: |
|
4
|
+
A heading tag with an optional id attribute, used predominantly to the left of content on consultations and publications.
|
5
|
+
|
6
|
+
Real world examples:
|
7
|
+
|
8
|
+
- [Publication](/government/publications/recognising-the-terrorist-threat)
|
9
|
+
- [Consultation](/government/consultations/proposal-for-the-future-of-rotherham-goldthorpe-jobcentre)
|
10
|
+
accessibility_criteria: |
|
11
|
+
The heading must:
|
12
|
+
|
13
|
+
- be part of a correct heading structure for a page
|
14
|
+
- be semantically represented as a heading
|
15
|
+
- convey the heading level
|
16
|
+
examples:
|
17
|
+
default:
|
18
|
+
data:
|
19
|
+
text: 'Download the full outcome'
|
20
|
+
right_to_left:
|
21
|
+
data:
|
22
|
+
text: 'مستندات'
|
23
|
+
context:
|
24
|
+
right_to_left: true
|
25
|
+
with_id_attribute:
|
26
|
+
data:
|
27
|
+
text: 'Detail of outcome'
|
28
|
+
id: 'detail_of_outcome'
|
29
|
+
specific_heading_level:
|
30
|
+
data:
|
31
|
+
text: 'Original consultation'
|
32
|
+
heading_level: 3
|
@@ -38,6 +38,7 @@ module GovukPublishingComponents
|
|
38
38
|
meta_tags["govuk:content-id"] = content_item[:content_id] if content_item[:content_id]
|
39
39
|
meta_tags["govuk:withdrawn"] = "withdrawn" if content_item[:withdrawn_notice].present?
|
40
40
|
meta_tags["govuk:content-has-history"] = "true" if has_content_history?
|
41
|
+
meta_tags["govuk:static-analytics:strip-dates"] = "true" if should_strip_dates_pii?(content_item, local_assigns)
|
41
42
|
meta_tags["govuk:static-analytics:strip-postcodes"] = "true" if should_strip_postcode_pii?(content_item, local_assigns)
|
42
43
|
|
43
44
|
meta_tags
|
@@ -128,6 +129,15 @@ module GovukPublishingComponents
|
|
128
129
|
root_taxon_set
|
129
130
|
end
|
130
131
|
|
132
|
+
def should_strip_dates_pii?(content_item, local_assigns)
|
133
|
+
# allow override if we explicitly want to strip pii (or not) regardless of
|
134
|
+
# document_type
|
135
|
+
return local_assigns[:strip_dates_pii] if local_assigns.key?(:strip_dates_pii)
|
136
|
+
|
137
|
+
formats_that_might_include_dates = %w[smart_answer]
|
138
|
+
formats_that_might_include_dates.include?(content_item[:document_type])
|
139
|
+
end
|
140
|
+
|
131
141
|
def should_strip_postcode_pii?(content_item, local_assigns)
|
132
142
|
# allow override if we explicitly want to strip pii (or not) regardless of
|
133
143
|
# document_type
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.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: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -324,6 +324,7 @@ files:
|
|
324
324
|
- app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss
|
325
325
|
- app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss
|
326
326
|
- app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss
|
327
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_heading.scss
|
327
328
|
- app/assets/stylesheets/govuk_publishing_components/components/_input.scss
|
328
329
|
- app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss
|
329
330
|
- app/assets/stylesheets/govuk_publishing_components/components/_label.scss
|
@@ -365,6 +366,7 @@ files:
|
|
365
366
|
- app/views/govuk_publishing_components/components/_error_summary.html.erb
|
366
367
|
- app/views/govuk_publishing_components/components/_feedback.html.erb
|
367
368
|
- app/views/govuk_publishing_components/components/_fieldset.html.erb
|
369
|
+
- app/views/govuk_publishing_components/components/_heading.html.erb
|
368
370
|
- app/views/govuk_publishing_components/components/_input.html.erb
|
369
371
|
- app/views/govuk_publishing_components/components/_inverse_header.html.erb
|
370
372
|
- app/views/govuk_publishing_components/components/_label.html.erb
|
@@ -385,6 +387,7 @@ files:
|
|
385
387
|
- app/views/govuk_publishing_components/components/docs/error_summary.yml
|
386
388
|
- app/views/govuk_publishing_components/components/docs/feedback.yml
|
387
389
|
- app/views/govuk_publishing_components/components/docs/fieldset.yml
|
390
|
+
- app/views/govuk_publishing_components/components/docs/heading.yml
|
388
391
|
- app/views/govuk_publishing_components/components/docs/input.yml
|
389
392
|
- app/views/govuk_publishing_components/components/docs/inverse_header.yml
|
390
393
|
- app/views/govuk_publishing_components/components/docs/label.yml
|