govuk_publishing_components 9.15.0 → 9.16.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/app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb +14 -0
- data/app/views/govuk_publishing_components/components/docs/button.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/google_tag_manager_script.yml +13 -0
- data/lib/govuk_publishing_components/presenters/button_helper.rb +3 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66460d0bda9d349279e8f56972ca5c9352da5596045ff45a661463f7821b43ed
|
|
4
|
+
data.tar.gz: 8769b2d1e95d7b55b27c9bf517fca8d93e63394aadb29d28383196300d2b182b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c5a17c49434fc3c1ea118126cd55d02d2dfc81cb4dcc809dcadf54596e8b8acfefeb712d1bbeac327ff6e9b7111e8d253d17e7341b0fd2e1708b34248dd0b53
|
|
7
|
+
data.tar.gz: 6e997e90d3f440701387b3bf0df17a612294308e7c55451e2c0cfd8bda85d370290ac723d3792e3ab8b6be152fd597311b002626c71a20dbd01e0aa3ccd56218
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%
|
|
2
|
+
gtm_auth ||= nil
|
|
3
|
+
gtm_preview ||= nil
|
|
4
|
+
%>
|
|
5
|
+
<script>
|
|
6
|
+
var doNotTrack = ( navigator.doNotTrack === '1' || navigator.doNotTrack === 'yes' || navigator.msDoNotTrack === '1' || window.doNotTrack === '1' )
|
|
7
|
+
if (!doNotTrack) {
|
|
8
|
+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
9
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
10
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
11
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl+'<%= ">m_auth="+gtm_auth if gtm_auth %><%= ">m_preview="+gtm_preview if gtm_preview %>>m_cookies_win=x';f.parentNode.insertBefore(j,f);
|
|
12
|
+
})(window,document,'script','dataLayer',<%= gtm_id %>);
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: Google Tag Manager script
|
|
2
|
+
description: |
|
|
3
|
+
Google Tag Manager script for tracking user interaction:
|
|
4
|
+
- gtm_id is the ID for the Google Tag Manager account
|
|
5
|
+
- gtm_preview allows a tag to be previewed in the Google Tag Manager interface
|
|
6
|
+
- gtm_auth is the identifier of an environment for Google Tag Manager
|
|
7
|
+
accessibility_criteria: |
|
|
8
|
+
The component should not be visible to any users.
|
|
9
|
+
display_html: true
|
|
10
|
+
examples:
|
|
11
|
+
default:
|
|
12
|
+
data:
|
|
13
|
+
gtm_id: GTM-XXXXXXX
|
|
@@ -4,7 +4,7 @@ module GovukPublishingComponents
|
|
|
4
4
|
module Presenters
|
|
5
5
|
class ButtonHelper
|
|
6
6
|
attr_reader :href, :text, :title, :info_text, :rel, :data_attributes,
|
|
7
|
-
:start, :secondary, :secondary_quiet, :margin_bottom
|
|
7
|
+
:start, :secondary, :secondary_quiet, :margin_bottom, :target
|
|
8
8
|
|
|
9
9
|
def initialize(local_assigns)
|
|
10
10
|
@href = local_assigns[:href]
|
|
@@ -17,6 +17,7 @@ module GovukPublishingComponents
|
|
|
17
17
|
@secondary = local_assigns[:secondary]
|
|
18
18
|
@secondary_quiet = local_assigns[:secondary_quiet]
|
|
19
19
|
@margin_bottom = local_assigns[:margin_bottom]
|
|
20
|
+
@target = local_assigns[:target]
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def link?
|
|
@@ -30,6 +31,7 @@ module GovukPublishingComponents
|
|
|
30
31
|
options[:rel] = rel if rel
|
|
31
32
|
options[:data] = data_attributes if data_attributes
|
|
32
33
|
options[:title] = title if title
|
|
34
|
+
options[:target] = target if target
|
|
33
35
|
options
|
|
34
36
|
end
|
|
35
37
|
|
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: 9.
|
|
4
|
+
version: 9.16.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-08-
|
|
11
|
+
date: 2018-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: govuk_app_config
|
|
@@ -449,6 +449,7 @@ files:
|
|
|
449
449
|
- app/views/govuk_publishing_components/components/_error_summary.html.erb
|
|
450
450
|
- app/views/govuk_publishing_components/components/_feedback.html.erb
|
|
451
451
|
- app/views/govuk_publishing_components/components/_fieldset.html.erb
|
|
452
|
+
- app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
|
|
452
453
|
- app/views/govuk_publishing_components/components/_government_navigation.html.erb
|
|
453
454
|
- app/views/govuk_publishing_components/components/_govspeak.html.erb
|
|
454
455
|
- app/views/govuk_publishing_components/components/_govspeak_html_publication.html.erb
|
|
@@ -500,6 +501,7 @@ files:
|
|
|
500
501
|
- app/views/govuk_publishing_components/components/docs/error_summary.yml
|
|
501
502
|
- app/views/govuk_publishing_components/components/docs/feedback.yml
|
|
502
503
|
- app/views/govuk_publishing_components/components/docs/fieldset.yml
|
|
504
|
+
- app/views/govuk_publishing_components/components/docs/google_tag_manager_script.yml
|
|
503
505
|
- app/views/govuk_publishing_components/components/docs/government_navigation.yml
|
|
504
506
|
- app/views/govuk_publishing_components/components/docs/govspeak.yml
|
|
505
507
|
- app/views/govuk_publishing_components/components/docs/govspeak_html_publication.yml
|