govuk_publishing_components 24.13.1 → 24.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -4
- data/config/locales/ar.yml +3 -0
- data/config/locales/az.yml +3 -0
- data/config/locales/be.yml +3 -0
- data/config/locales/bg.yml +3 -0
- data/config/locales/bn.yml +3 -0
- data/config/locales/cs.yml +3 -0
- data/config/locales/cy.yml +3 -0
- data/config/locales/da.yml +3 -0
- data/config/locales/de.yml +3 -0
- data/config/locales/dr.yml +3 -0
- data/config/locales/el.yml +3 -0
- data/config/locales/en.yml +3 -0
- data/config/locales/es-419.yml +3 -0
- data/config/locales/es.yml +3 -0
- data/config/locales/et.yml +3 -0
- data/config/locales/fa.yml +3 -0
- data/config/locales/fi.yml +3 -0
- data/config/locales/fr.yml +3 -0
- data/config/locales/gd.yml +3 -0
- data/config/locales/gu.yml +3 -0
- data/config/locales/he.yml +3 -0
- data/config/locales/hi.yml +3 -0
- data/config/locales/hr.yml +3 -0
- data/config/locales/hu.yml +3 -0
- data/config/locales/hy.yml +3 -0
- data/config/locales/id.yml +3 -0
- data/config/locales/is.yml +3 -0
- data/config/locales/it.yml +3 -0
- data/config/locales/ja.yml +3 -0
- data/config/locales/ka.yml +3 -0
- data/config/locales/kk.yml +3 -0
- data/config/locales/ko.yml +3 -0
- data/config/locales/lt.yml +3 -0
- data/config/locales/lv.yml +3 -0
- data/config/locales/ms.yml +3 -0
- data/config/locales/mt.yml +3 -0
- data/config/locales/nl.yml +3 -0
- data/config/locales/no.yml +3 -0
- data/config/locales/pa-pk.yml +3 -0
- data/config/locales/pa.yml +3 -0
- data/config/locales/pl.yml +3 -0
- data/config/locales/ps.yml +3 -0
- data/config/locales/pt.yml +3 -0
- data/config/locales/ro.yml +3 -0
- data/config/locales/ru.yml +3 -0
- data/config/locales/si.yml +3 -0
- data/config/locales/sk.yml +3 -0
- data/config/locales/sl.yml +3 -0
- data/config/locales/so.yml +3 -0
- data/config/locales/sq.yml +3 -0
- data/config/locales/sr.yml +3 -0
- data/config/locales/sv.yml +3 -0
- data/config/locales/sw.yml +3 -0
- data/config/locales/ta.yml +3 -0
- data/config/locales/th.yml +3 -0
- data/config/locales/tk.yml +3 -0
- data/config/locales/tr.yml +3 -0
- data/config/locales/uk.yml +3 -0
- data/config/locales/ur.yml +3 -0
- data/config/locales/uz.yml +3 -0
- data/config/locales/vi.yml +3 -0
- data/config/locales/zh-hk.yml +3 -0
- data/config/locales/zh-tw.yml +3 -0
- data/config/locales/zh.yml +3 -0
- data/lib/govuk_publishing_components.rb +1 -0
- data/lib/govuk_publishing_components/presenters/brexit_cta_helper.rb +33 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a5f30a829f44913c30260a6dcaa8f09cb443897477370f95d64b977e0ba3e3b
|
4
|
+
data.tar.gz: 7acbcf428ab0bcc171285ece6d46c19fbf1145b2c55e65de79f0ba6c51f2990a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05cc84e714cde48b7fd102495f024ab30284f171ea2fab94b6ef6a7aad9d0642dc78ab8c50b844be7b2eca1efa985e8a2aae4c6e5fa5f6e9f162e87db2d4c53c
|
7
|
+
data.tar.gz: 4cdb13383ef1ce24a5e688e2a0d1b5bf9b349a18290e3e41537f2c7c75881d1ee472a4c795e4d3c300e5d274e46aba3618b49e9e8e2cfb1ceed018112e1ff864
|
@@ -25,6 +25,6 @@
|
|
25
25
|
<% end %>
|
26
26
|
|
27
27
|
<% if navigation.show_brexit_cta? || navigation.show_brexit_related_links? %>
|
28
|
-
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
|
28
|
+
<%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
|
29
29
|
<% end %>
|
30
30
|
</div>
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
<% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
|
2
|
-
<%
|
3
|
-
<%
|
2
|
+
<% cta_helper = GovukPublishingComponents::Presenters::BrexitCtaHelper.new(content_item) %>
|
3
|
+
<%
|
4
|
+
title = t(cta_helper.title_key)
|
5
|
+
link_text = t(cta_helper.link_text_key)
|
6
|
+
link_path = t(cta_helper.link_path_key)
|
7
|
+
lang = shared_helper.t_locale(cta_helper.title_key)
|
8
|
+
%>
|
4
9
|
|
5
10
|
<% data_attributes = {
|
6
11
|
"module": "gem-track-click",
|
@@ -12,12 +17,12 @@
|
|
12
17
|
} %>
|
13
18
|
|
14
19
|
<%= tag.div class: "gem-c-contextual-sidebar__brexit-cta" do %>
|
15
|
-
<%= tag.h2
|
20
|
+
<%= tag.h2 title, class: "gem-c-contextual-sidebar__brexit-heading govuk-heading-s" %>
|
16
21
|
<%= tag.p class: "gem-c-contextual-sidebar__brexit-text govuk-body" do %>
|
17
22
|
<%= link_to link_text,
|
18
23
|
link_path,
|
19
24
|
class: "govuk-link",
|
20
25
|
data: data_attributes,
|
21
|
-
lang:
|
26
|
+
lang: lang %>
|
22
27
|
<% end %>
|
23
28
|
<% end %>
|
data/config/locales/ar.yml
CHANGED
data/config/locales/az.yml
CHANGED
data/config/locales/be.yml
CHANGED
data/config/locales/bg.yml
CHANGED
data/config/locales/bn.yml
CHANGED
data/config/locales/cs.yml
CHANGED
data/config/locales/cy.yml
CHANGED
data/config/locales/da.yml
CHANGED
data/config/locales/de.yml
CHANGED
data/config/locales/dr.yml
CHANGED
data/config/locales/el.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -132,6 +132,9 @@ en:
|
|
132
132
|
link_path: "/brexit"
|
133
133
|
link_text: Check what you need to do
|
134
134
|
title: Brexit
|
135
|
+
hub_page_link_path: "/transition-check/questions"
|
136
|
+
hub_page_link_text: Get a personalised list of actions
|
137
|
+
hub_page_title: Brexit checker
|
135
138
|
world_locations: World locations
|
136
139
|
search_box:
|
137
140
|
input_title: Search
|
data/config/locales/es-419.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/et.yml
CHANGED
data/config/locales/fa.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/gd.yml
CHANGED
data/config/locales/gu.yml
CHANGED
data/config/locales/he.yml
CHANGED
data/config/locales/hi.yml
CHANGED
data/config/locales/hr.yml
CHANGED
data/config/locales/hu.yml
CHANGED
data/config/locales/hy.yml
CHANGED
data/config/locales/id.yml
CHANGED
data/config/locales/is.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/ja.yml
CHANGED
data/config/locales/ka.yml
CHANGED
data/config/locales/kk.yml
CHANGED
data/config/locales/ko.yml
CHANGED
data/config/locales/lt.yml
CHANGED
data/config/locales/lv.yml
CHANGED
data/config/locales/ms.yml
CHANGED
data/config/locales/mt.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/no.yml
CHANGED
data/config/locales/pa-pk.yml
CHANGED
data/config/locales/pa.yml
CHANGED
data/config/locales/pl.yml
CHANGED
data/config/locales/ps.yml
CHANGED
data/config/locales/pt.yml
CHANGED
data/config/locales/ro.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/config/locales/si.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/config/locales/sl.yml
CHANGED
data/config/locales/so.yml
CHANGED
data/config/locales/sq.yml
CHANGED
data/config/locales/sr.yml
CHANGED
data/config/locales/sv.yml
CHANGED
data/config/locales/sw.yml
CHANGED
data/config/locales/ta.yml
CHANGED
data/config/locales/th.yml
CHANGED
data/config/locales/tk.yml
CHANGED
data/config/locales/tr.yml
CHANGED
data/config/locales/uk.yml
CHANGED
data/config/locales/ur.yml
CHANGED
data/config/locales/uz.yml
CHANGED
data/config/locales/vi.yml
CHANGED
data/config/locales/zh-hk.yml
CHANGED
data/config/locales/zh-tw.yml
CHANGED
data/config/locales/zh.yml
CHANGED
@@ -7,6 +7,7 @@ require "govuk_publishing_components/presenters/shared_helper"
|
|
7
7
|
require "govuk_publishing_components/presenters/attachment"
|
8
8
|
require "govuk_publishing_components/presenters/breadcrumbs"
|
9
9
|
require "govuk_publishing_components/presenters/breadcrumb_selector"
|
10
|
+
require "govuk_publishing_components/presenters/brexit_cta_helper"
|
10
11
|
require "govuk_publishing_components/presenters/button_helper"
|
11
12
|
require "govuk_publishing_components/presenters/contextual_navigation"
|
12
13
|
require "govuk_publishing_components/presenters/related_navigation_helper"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module GovukPublishingComponents
|
2
|
+
module Presenters
|
3
|
+
class BrexitCtaHelper
|
4
|
+
BREXIT_HUB_PAGE_IDS = %w[
|
5
|
+
6555e0bf-c270-4cf9-a0c5-d20b95fab7f1
|
6
|
+
91cd6143-69d5-4f27-99ff-a52fb0d51c78
|
7
|
+
].freeze
|
8
|
+
|
9
|
+
def initialize(content_item)
|
10
|
+
@content_item = content_item
|
11
|
+
end
|
12
|
+
|
13
|
+
def title_key
|
14
|
+
use_brexit_hub_page_navigation? ? "components.related_navigation.transition.hub_page_title" : "components.related_navigation.transition.title"
|
15
|
+
end
|
16
|
+
|
17
|
+
def link_text_key
|
18
|
+
use_brexit_hub_page_navigation? ? "components.related_navigation.transition.hub_page_link_text" : "components.related_navigation.transition.link_text"
|
19
|
+
end
|
20
|
+
|
21
|
+
def link_path_key
|
22
|
+
use_brexit_hub_page_navigation? ? "components.related_navigation.transition.hub_page_link_path" : "components.related_navigation.transition.link_path"
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def use_brexit_hub_page_navigation?
|
28
|
+
I18n.locale == :en &&
|
29
|
+
BREXIT_HUB_PAGE_IDS.include?(@content_item["content_id"])
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
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: 24.13.
|
4
|
+
version: 24.13.2
|
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: 2021-06-
|
11
|
+
date: 2021-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -883,6 +883,7 @@ files:
|
|
883
883
|
- lib/govuk_publishing_components/presenters/attachment.rb
|
884
884
|
- lib/govuk_publishing_components/presenters/breadcrumb_selector.rb
|
885
885
|
- lib/govuk_publishing_components/presenters/breadcrumbs.rb
|
886
|
+
- lib/govuk_publishing_components/presenters/brexit_cta_helper.rb
|
886
887
|
- lib/govuk_publishing_components/presenters/button_helper.rb
|
887
888
|
- lib/govuk_publishing_components/presenters/checkboxes_helper.rb
|
888
889
|
- lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors.rb
|