govuk_publishing_components 8.2.0 → 9.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/images/govuk_publishing_components/govuk-logo.png +0 -0
- data/app/assets/images/govuk_publishing_components/icon-pointer-2x.png +0 -0
- data/app/assets/images/govuk_publishing_components/icon-pointer.png +0 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +3 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +70 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +134 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +29 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +123 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +33 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +15 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +34 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +111 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +11 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +25 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +306 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +49 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +25 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +27 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +22 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +42 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +32 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +22 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +26 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +15 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +29 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +29 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +24 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +24 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +38 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +224 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +41 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/form-download.scss +24 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss +25 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss +19 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +65 -0
- data/app/views/govuk_publishing_components/component_guide/example.html.erb +1 -1
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +1 -1
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +84 -0
- data/app/views/govuk_publishing_components/components/_govspeak.html.erb +14 -0
- data/app/views/govuk_publishing_components/components/_govspeak_html_publication.html.erb +9 -0
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +41 -0
- data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_notice.html.erb +22 -0
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +68 -30
- data/app/views/govuk_publishing_components/components/docs/contents_list.yml +218 -0
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +653 -0
- data/app/views/govuk_publishing_components/components/docs/govspeak_html_publication.yml +183 -0
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +160 -0
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/machine_readable_metadata.yml +17 -1
- data/app/views/govuk_publishing_components/components/docs/notice.yml +27 -0
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +119 -18
- data/config/initializers/assets.rb +3 -0
- data/config/locales/en.yml +2 -0
- data/lib/govuk_publishing_components.rb +2 -1
- data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +27 -0
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +55 -0
- data/lib/govuk_publishing_components/presenters/machine_readable/article_schema.rb +5 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/page.rb +5 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/person_schema.rb +39 -0
- data/lib/govuk_publishing_components/presenters/schema_org.rb +3 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +49 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/track-share-button-clicks.js +0 -26
- data/lib/govuk_publishing_components/presenters/sanitisation.rb +0 -13
@@ -6,4 +6,7 @@ Rails.application.config.assets.precompile += %w(
|
|
6
6
|
govuk_publishing_components/feed-icon-black.png
|
7
7
|
govuk_publishing_components/mail-icon-x2.png
|
8
8
|
govuk_publishing_components/mail-icon.png
|
9
|
+
govuk_publishing_components/icon-pointer.png
|
10
|
+
govuk_publishing_components/icon-pointer-2x.png
|
11
|
+
govuk_publishing_components/govuk-logo.png
|
9
12
|
)
|
data/config/locales/en.yml
CHANGED
@@ -14,10 +14,11 @@ require "govuk_publishing_components/presenters/rummager_taxonomy_sidebar_links"
|
|
14
14
|
require "govuk_publishing_components/presenters/curated_taxonomy_sidebar_links"
|
15
15
|
require "govuk_publishing_components/presenters/content_item"
|
16
16
|
require "govuk_publishing_components/presenters/translation_nav_helper"
|
17
|
-
require "govuk_publishing_components/presenters/sanitisation"
|
18
17
|
require "govuk_publishing_components/presenters/subscription_links_helper"
|
19
18
|
require "govuk_publishing_components/presenters/schema_org"
|
20
19
|
require "govuk_publishing_components/presenters/heading_helper"
|
20
|
+
require "govuk_publishing_components/presenters/contents_list_helper"
|
21
|
+
require "govuk_publishing_components/presenters/image_card_helper"
|
21
22
|
|
22
23
|
require "govuk_publishing_components/app_helpers/taxon_breadcrumbs"
|
23
24
|
require "govuk_publishing_components/app_helpers/brand_helper"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'action_view'
|
2
|
+
|
3
|
+
module GovukPublishingComponents
|
4
|
+
module Presenters
|
5
|
+
class ContentsListHelper
|
6
|
+
include ActionView::Helpers::SanitizeHelper
|
7
|
+
|
8
|
+
def wrap_numbers_with_spans(content_item_link)
|
9
|
+
content_item_text = strip_tags(content_item_link) #just the text of the link
|
10
|
+
|
11
|
+
# Must start with a number
|
12
|
+
# Number must be between 1 and 999 (ie not 2014)
|
13
|
+
# Must be followed by a space
|
14
|
+
# May contain a period `1.`
|
15
|
+
# May be a decimal `1.2`
|
16
|
+
number = /^\d{1,3}(\.?|\.\d{1,2})(?=\s)/.match(content_item_text)
|
17
|
+
|
18
|
+
if number
|
19
|
+
words = content_item_text.sub(number.to_s, '').strip #remove the number from the text
|
20
|
+
content_item_link.sub(content_item_text, "<span class=\"gem-c-contents-list__number\">#{number} </span><span class=\"gem-c-contents-list__numbered-text\">#{words}</span>").squish.html_safe
|
21
|
+
else
|
22
|
+
content_item_link
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module GovukPublishingComponents
|
2
|
+
module Presenters
|
3
|
+
class ImageCardHelper
|
4
|
+
include ActionView::Helpers
|
5
|
+
include ActionView::Context
|
6
|
+
|
7
|
+
attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text
|
8
|
+
|
9
|
+
def initialize(local_assigns)
|
10
|
+
@href = local_assigns[:href]
|
11
|
+
@href_data_attributes = local_assigns[:href_data_attributes]
|
12
|
+
@extra_links = local_assigns[:extra_links]
|
13
|
+
@image_src = local_assigns[:image_src]
|
14
|
+
@image_alt = local_assigns[:image_alt] || ""
|
15
|
+
@context = local_assigns[:context]
|
16
|
+
@description = local_assigns[:description]
|
17
|
+
@large = local_assigns[:large]
|
18
|
+
@heading_text = local_assigns[:heading_text]
|
19
|
+
@heading_level = local_assigns[:heading_level]
|
20
|
+
@extra_links_no_indent = local_assigns[:extra_links_no_indent]
|
21
|
+
end
|
22
|
+
|
23
|
+
def is_tracking?
|
24
|
+
return true if @href_data_attributes
|
25
|
+
if @extra_links
|
26
|
+
@extra_links.each do |link|
|
27
|
+
return true if link[:data_attributes]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
false
|
31
|
+
end
|
32
|
+
|
33
|
+
def image
|
34
|
+
if @image_src
|
35
|
+
content_tag(:figure, class: "gem-c-image-card__image-wrapper") do
|
36
|
+
image_tag(@image_src, class: "gem-c-image-card__image", alt: @image_alt)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def context
|
42
|
+
content_tag(:p, @context, class: "gem-c-image-card__context") if @context
|
43
|
+
end
|
44
|
+
|
45
|
+
def heading_tag
|
46
|
+
return "h#{@heading_level}" if [1, 2, 3, 4, 5, 6].include? @heading_level
|
47
|
+
"h2"
|
48
|
+
end
|
49
|
+
|
50
|
+
def description
|
51
|
+
content_tag(:p, @description, class: "gem-c-image-card__description") if @description
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -24,6 +24,10 @@ module GovukPublishingComponents
|
|
24
24
|
"@type" => "Organization",
|
25
25
|
"name" => "GOV.UK",
|
26
26
|
"url" => "https://www.gov.uk",
|
27
|
+
"logo" => {
|
28
|
+
"@type" => "ImageObject",
|
29
|
+
"url" => page.logo_url,
|
30
|
+
}
|
27
31
|
}
|
28
32
|
}.merge(image_schema).merge(author_schema).merge(body)
|
29
33
|
end
|
@@ -35,7 +39,7 @@ module GovukPublishingComponents
|
|
35
39
|
# Not all formats have a `body` - some have their content split over
|
36
40
|
# multiple fields. In this case we'll skip the `articleBody` field
|
37
41
|
def body
|
38
|
-
return {} unless page.body
|
42
|
+
return {} unless page.body.present?
|
39
43
|
|
40
44
|
{
|
41
45
|
"articleBody" => page.body
|
@@ -24,7 +24,7 @@ module GovukPublishingComponents
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def description
|
27
|
-
content_item["description"]
|
27
|
+
local_assigns[:description] || content_item["description"]
|
28
28
|
end
|
29
29
|
|
30
30
|
def has_image?
|
@@ -42,6 +42,10 @@ module GovukPublishingComponents
|
|
42
42
|
def content_item
|
43
43
|
local_assigns[:content_item]
|
44
44
|
end
|
45
|
+
|
46
|
+
def logo_url
|
47
|
+
local_assigns[:logo_url]
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module GovukPublishingComponents
|
2
|
+
module Presenters
|
3
|
+
class PersonSchema
|
4
|
+
attr_reader :page
|
5
|
+
|
6
|
+
def initialize(page)
|
7
|
+
@page = page
|
8
|
+
end
|
9
|
+
|
10
|
+
def structured_data
|
11
|
+
# http://schema.org/Person
|
12
|
+
{
|
13
|
+
"@context" => "http://schema.org",
|
14
|
+
"@type" => "Person",
|
15
|
+
"mainEntityOfPage" => {
|
16
|
+
"@type" => "WebPage",
|
17
|
+
"@id" => page.canonical_url,
|
18
|
+
},
|
19
|
+
"name" => page.title,
|
20
|
+
"description" => page.body
|
21
|
+
}.merge(image_schema)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
attr_reader :presenter
|
27
|
+
|
28
|
+
def image_schema
|
29
|
+
return {} unless page.has_image?
|
30
|
+
|
31
|
+
{
|
32
|
+
"image" => [
|
33
|
+
page.image_url
|
34
|
+
]
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'govuk_publishing_components/presenters/machine_readable/page'
|
2
2
|
require 'govuk_publishing_components/presenters/machine_readable/article_schema'
|
3
3
|
require 'govuk_publishing_components/presenters/machine_readable/news_article_schema'
|
4
|
+
require 'govuk_publishing_components/presenters/machine_readable/person_schema'
|
4
5
|
|
5
6
|
module GovukPublishingComponents
|
6
7
|
module Presenters
|
@@ -16,6 +17,8 @@ module GovukPublishingComponents
|
|
16
17
|
ArticleSchema.new(page).structured_data
|
17
18
|
elsif page.schema == :news_article
|
18
19
|
NewsArticleSchema.new(page).structured_data
|
20
|
+
elsif page.schema == :person
|
21
|
+
PersonSchema.new(page).structured_data
|
19
22
|
else
|
20
23
|
raise "#{page.schema} is not supported"
|
21
24
|
end
|
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: 9.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-
|
11
|
+
date: 2018-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -302,6 +302,9 @@ files:
|
|
302
302
|
- Rakefile
|
303
303
|
- app/assets/config/govuk_publishing_components_manifest.js
|
304
304
|
- app/assets/images/govuk_publishing_components/feed-icon-black.png
|
305
|
+
- app/assets/images/govuk_publishing_components/govuk-logo.png
|
306
|
+
- app/assets/images/govuk_publishing_components/icon-pointer-2x.png
|
307
|
+
- app/assets/images/govuk_publishing_components/icon-pointer.png
|
305
308
|
- app/assets/images/govuk_publishing_components/mail-icon-x2.png
|
306
309
|
- app/assets/images/govuk_publishing_components/mail-icon.png
|
307
310
|
- app/assets/images/govuk_publishing_components/search-button.png
|
@@ -319,7 +322,6 @@ files:
|
|
319
322
|
- app/assets/javascripts/govuk_publishing_components/lib/history-support.js
|
320
323
|
- app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
|
321
324
|
- app/assets/javascripts/govuk_publishing_components/lib/toggle.js
|
322
|
-
- app/assets/javascripts/govuk_publishing_components/lib/track-share-button-clicks.js
|
323
325
|
- app/assets/stylesheets/component_guide/all_components.scss
|
324
326
|
- app/assets/stylesheets/component_guide/all_components_print.scss
|
325
327
|
- app/assets/stylesheets/component_guide/application.scss
|
@@ -328,15 +330,20 @@ files:
|
|
328
330
|
- app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss
|
329
331
|
- app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss
|
330
332
|
- app/assets/stylesheets/govuk_publishing_components/components/_button.scss
|
333
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss
|
331
334
|
- app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss
|
332
335
|
- app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss
|
333
336
|
- app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss
|
334
337
|
- app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss
|
338
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss
|
339
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss
|
335
340
|
- app/assets/stylesheets/govuk_publishing_components/components/_heading.scss
|
341
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss
|
336
342
|
- app/assets/stylesheets/govuk_publishing_components/components/_input.scss
|
337
343
|
- app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss
|
338
344
|
- app/assets/stylesheets/govuk_publishing_components/components/_label.scss
|
339
345
|
- app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss
|
346
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_notice.scss
|
340
347
|
- app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss
|
341
348
|
- app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss
|
342
349
|
- app/assets/stylesheets/govuk_publishing_components/components/_radio.scss
|
@@ -351,7 +358,30 @@ files:
|
|
351
358
|
- app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss
|
352
359
|
- app/assets/stylesheets/govuk_publishing_components/components/_title.scss
|
353
360
|
- app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss
|
361
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss
|
362
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss
|
363
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss
|
364
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss
|
365
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss
|
366
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss
|
367
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss
|
368
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss
|
369
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss
|
370
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss
|
371
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss
|
372
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss
|
373
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss
|
374
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss
|
375
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss
|
376
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss
|
377
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss
|
378
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss
|
379
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss
|
380
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss
|
381
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss
|
382
|
+
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/form-download.scss
|
354
383
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss
|
384
|
+
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_contents-list-helper.scss
|
355
385
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss
|
356
386
|
- app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss
|
357
387
|
- app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss
|
@@ -359,7 +389,10 @@ files:
|
|
359
389
|
- app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss
|
360
390
|
- app/assets/stylesheets/govuk_publishing_components/components/mixins/_media-down.scss
|
361
391
|
- app/assets/stylesheets/govuk_publishing_components/components/mixins/_touch-friendly-links.scss
|
392
|
+
- app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss
|
362
393
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss
|
394
|
+
- app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss
|
395
|
+
- app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
|
363
396
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss
|
364
397
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
|
365
398
|
- app/assets/stylesheets/govuk_publishing_components/components/print/_title.scss
|
@@ -381,6 +414,7 @@ files:
|
|
381
414
|
- app/views/govuk_publishing_components/components/_back_link.html.erb
|
382
415
|
- app/views/govuk_publishing_components/components/_breadcrumbs.html.erb
|
383
416
|
- app/views/govuk_publishing_components/components/_button.html.erb
|
417
|
+
- app/views/govuk_publishing_components/components/_contents_list.html.erb
|
384
418
|
- app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb
|
385
419
|
- app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb
|
386
420
|
- app/views/govuk_publishing_components/components/_document_list.html.erb
|
@@ -388,13 +422,17 @@ files:
|
|
388
422
|
- app/views/govuk_publishing_components/components/_feedback.html.erb
|
389
423
|
- app/views/govuk_publishing_components/components/_fieldset.html.erb
|
390
424
|
- app/views/govuk_publishing_components/components/_government_navigation.html.erb
|
425
|
+
- app/views/govuk_publishing_components/components/_govspeak.html.erb
|
426
|
+
- app/views/govuk_publishing_components/components/_govspeak_html_publication.html.erb
|
391
427
|
- app/views/govuk_publishing_components/components/_heading.html.erb
|
428
|
+
- app/views/govuk_publishing_components/components/_image_card.html.erb
|
392
429
|
- app/views/govuk_publishing_components/components/_input.html.erb
|
393
430
|
- app/views/govuk_publishing_components/components/_inverse_header.html.erb
|
394
431
|
- app/views/govuk_publishing_components/components/_label.html.erb
|
395
432
|
- app/views/govuk_publishing_components/components/_lead_paragraph.html.erb
|
396
433
|
- app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb
|
397
434
|
- app/views/govuk_publishing_components/components/_meta_tags.html.erb
|
435
|
+
- app/views/govuk_publishing_components/components/_notice.html.erb
|
398
436
|
- app/views/govuk_publishing_components/components/_phase_banner.html.erb
|
399
437
|
- app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
|
400
438
|
- app/views/govuk_publishing_components/components/_radio.html.erb
|
@@ -412,6 +450,7 @@ files:
|
|
412
450
|
- app/views/govuk_publishing_components/components/docs/back_link.yml
|
413
451
|
- app/views/govuk_publishing_components/components/docs/breadcrumbs.yml
|
414
452
|
- app/views/govuk_publishing_components/components/docs/button.yml
|
453
|
+
- app/views/govuk_publishing_components/components/docs/contents_list.yml
|
415
454
|
- app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml
|
416
455
|
- app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml
|
417
456
|
- app/views/govuk_publishing_components/components/docs/document_list.yml
|
@@ -419,13 +458,17 @@ files:
|
|
419
458
|
- app/views/govuk_publishing_components/components/docs/feedback.yml
|
420
459
|
- app/views/govuk_publishing_components/components/docs/fieldset.yml
|
421
460
|
- app/views/govuk_publishing_components/components/docs/government_navigation.yml
|
461
|
+
- app/views/govuk_publishing_components/components/docs/govspeak.yml
|
462
|
+
- app/views/govuk_publishing_components/components/docs/govspeak_html_publication.yml
|
422
463
|
- app/views/govuk_publishing_components/components/docs/heading.yml
|
464
|
+
- app/views/govuk_publishing_components/components/docs/image_card.yml
|
423
465
|
- app/views/govuk_publishing_components/components/docs/input.yml
|
424
466
|
- app/views/govuk_publishing_components/components/docs/inverse_header.yml
|
425
467
|
- app/views/govuk_publishing_components/components/docs/label.yml
|
426
468
|
- app/views/govuk_publishing_components/components/docs/lead_paragraph.yml
|
427
469
|
- app/views/govuk_publishing_components/components/docs/machine_readable_metadata.yml
|
428
470
|
- app/views/govuk_publishing_components/components/docs/meta_tags.yml
|
471
|
+
- app/views/govuk_publishing_components/components/docs/notice.yml
|
429
472
|
- app/views/govuk_publishing_components/components/docs/phase_banner.yml
|
430
473
|
- app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml
|
431
474
|
- app/views/govuk_publishing_components/components/docs/radio.yml
|
@@ -461,17 +504,19 @@ files:
|
|
461
504
|
- lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_parent.rb
|
462
505
|
- lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb
|
463
506
|
- lib/govuk_publishing_components/presenters/content_item.rb
|
507
|
+
- lib/govuk_publishing_components/presenters/contents_list_helper.rb
|
464
508
|
- lib/govuk_publishing_components/presenters/contextual_navigation.rb
|
465
509
|
- lib/govuk_publishing_components/presenters/curated_taxonomy_sidebar_links.rb
|
466
510
|
- lib/govuk_publishing_components/presenters/heading_helper.rb
|
511
|
+
- lib/govuk_publishing_components/presenters/image_card_helper.rb
|
467
512
|
- lib/govuk_publishing_components/presenters/machine_readable/article_schema.rb
|
468
513
|
- lib/govuk_publishing_components/presenters/machine_readable/news_article_schema.rb
|
469
514
|
- lib/govuk_publishing_components/presenters/machine_readable/page.rb
|
515
|
+
- lib/govuk_publishing_components/presenters/machine_readable/person_schema.rb
|
470
516
|
- lib/govuk_publishing_components/presenters/meta_tags.rb
|
471
517
|
- lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb
|
472
518
|
- lib/govuk_publishing_components/presenters/related_navigation_helper.rb
|
473
519
|
- lib/govuk_publishing_components/presenters/rummager_taxonomy_sidebar_links.rb
|
474
|
-
- lib/govuk_publishing_components/presenters/sanitisation.rb
|
475
520
|
- lib/govuk_publishing_components/presenters/schema_org.rb
|
476
521
|
- lib/govuk_publishing_components/presenters/services.rb
|
477
522
|
- lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
2
|
-
|
3
|
-
(function (Modules) {
|
4
|
-
'use strict'
|
5
|
-
|
6
|
-
Modules.GemTrackShareButtonClicks = function () {
|
7
|
-
this.start = function (element) {
|
8
|
-
element.on('click', '.js-share-facebook', trackFacebook)
|
9
|
-
element.on('click', '.js-share-twitter', trackTwitter)
|
10
|
-
|
11
|
-
function trackFacebook () {
|
12
|
-
trackShare('facebook')
|
13
|
-
}
|
14
|
-
|
15
|
-
function trackTwitter () {
|
16
|
-
trackShare('twitter')
|
17
|
-
}
|
18
|
-
|
19
|
-
function trackShare (network) {
|
20
|
-
if (GOVUK.analytics && GOVUK.analytics.trackShare) {
|
21
|
-
GOVUK.analytics.trackShare(network)
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
})(window.GOVUK.Modules)
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module GovukPublishingComponents
|
2
|
-
module Presenters
|
3
|
-
# @private
|
4
|
-
class Sanitisation
|
5
|
-
# Use `sub` on a potentially unsafe string. This method will sanitize
|
6
|
-
# the method first, do the replacement, and mark the result as HTML safe.
|
7
|
-
def self.sub_safely(string, pattern, replacement)
|
8
|
-
escaped_text = ERB::Util.html_escape_once(string.strip)
|
9
|
-
escaped_text.sub(pattern, replacement).html_safe
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|