govuk_publishing_components 23.10.2 → 23.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 737265f42ca1a81cb1a854d9858c053b36da1dd49096d4ab271880e40a0d265a
4
- data.tar.gz: 53e08f6b824be9665c54eb1e421463d63d8a761cc0aa8b432fdea43025fe173f
3
+ metadata.gz: 884556b32a54e514794dba01e0bbac985e9fae36beeea08e458e017ba20bc397
4
+ data.tar.gz: 920499e180389d7f7fb34ad3a84b018a3e8d02a69393244c18027a55a0272031
5
5
  SHA512:
6
- metadata.gz: d668236b7496da22426217927da594ff3dc3da9a903fafe647ca9ab47cc7877d779aef7dd841dde4b1f514571155a149a8d81bc40ff0b4e506ec8d90eeb6b80b
7
- data.tar.gz: 5ea78e25ed6a8ca39346ce90b46262b96c793ebd0fcc84a83715378099f029aa2c72bc29f758ba1b414d81fc7a73a3b21e7bd35603313d621d8c7fb112b1364f
6
+ metadata.gz: e7f807097888f485b69167eadc138c279654952b4e67050312d8f12215d439a503471da4af64198201bc99c6c0b967d1203482350037d29eb1900c330c9af7f8
7
+ data.tar.gz: c360c8660c5e049177a15289856df34b84ccf25c3132361d8dcd5418a1947289afa76ff7ff0aff9ea103e8c8d8220ea57029fd790f7740169c9e6aa1aa9edf1b
@@ -1,11 +1,51 @@
1
- @import 'transition-countdown';
1
+ $transition-campaign-red: #ff003b;
2
+ $transition-campaign-dark-blue: #1e1348;
2
3
 
3
- .gem-c-contextual-sidebar__brexit-cta {
4
+ .gem-c-contextual-sidebar__brexit-related-links {
4
5
  border-top: 2px solid $govuk-brand-colour;
6
+
7
+ .gem-c-contextual-sidebar__brexit-heading {
8
+ @include govuk-font(19, $weight: bold);
9
+ padding-top: govuk-spacing(3);
10
+ margin-bottom: govuk-spacing(2);
11
+ }
12
+ }
13
+
14
+ .gem-c-contextual-sidebar__brexit-cta {
15
+ @include govuk-font(19);
16
+ margin-bottom: govuk-spacing(6);
17
+ background-color: govuk-colour('light-grey', $legacy: 'grey-4');
18
+ border-top: 4px solid $transition-campaign-red;
19
+ display: block;
20
+ padding: govuk-spacing(3);
21
+ text-decoration: none;
22
+
23
+ .gem-c-contextual-sidebar__brexit-heading {
24
+ @extend %govuk-heading-m;
25
+ color: $transition-campaign-dark-blue;
26
+ }
27
+
28
+ .gem-c-contextual-sidebar__brexit-text {
29
+ @extend %govuk-link;
30
+
31
+ margin-top: 0;
32
+ margin-bottom: 0;
33
+ text-decoration: underline;
34
+
35
+ @include govuk-media-query($from: tablet) {
36
+ margin-bottom: govuk-spacing(2);
37
+ }
38
+ }
39
+
40
+ @include govuk-compatibility(govuk_template) {
41
+ .gem-c-contextual-sidebar__brexit-title {
42
+ margin-bottom: govuk-spacing(3);
43
+ }
44
+ }
5
45
  }
6
46
 
7
- .gem-c-contextual-sidebar__brexit-heading {
8
- @include govuk-font(19, $weight: bold);
9
- padding-top: govuk-spacing(3);
10
- margin-bottom: govuk-spacing(2);
47
+ .gem-c-contextual-sidebar__brexit-cta:focus {
48
+ .gem-c-contextual-sidebar__brexit-text {
49
+ text-decoration: none;
50
+ }
11
51
  }
@@ -2,23 +2,10 @@
2
2
  <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
3
3
 
4
4
  <div class="gem-c-contextual-sidebar">
5
- <% if navigation.show_brexit_cta? && navigation.step_by_step_count.zero? %>
6
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
5
+ <% if navigation.show_brexit_related_links? && navigation.step_by_step_count.zero? %>
6
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_related_links' %>
7
7
  <% elsif navigation.step_by_step_count.zero? && !navigation.transition_countdown_exception? %>
8
- <%= render 'govuk_publishing_components/components/transition_countdown', {
9
- title: t("components.related_navigation.transition.title"),
10
- url: t("components.related_navigation.transition.link_path"),
11
- text: t("components.related_navigation.transition.link_text"),
12
- data_attributes: {
13
- "module": "track-click",
14
- "track-category": "relatedLinkClicked",
15
- "track-action": "1.0 Transition",
16
- "track-label": t("components.related_navigation.transition.link_path"),
17
- "track-dimension": t("components.related_navigation.transition.link_text"),
18
- "track-dimension-index": "29",
19
- },
20
- lang: shared_helper.t_locale("components.related_navigation.transition.title"),
21
- } %>
8
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
22
9
  <% end %>
23
10
 
24
11
  <% if navigation.content_tagged_to_a_reasonable_number_of_step_by_steps? %>
@@ -43,7 +30,7 @@
43
30
  } %>
44
31
  <% end %>
45
32
 
46
- <% if navigation.show_brexit_cta? && navigation.step_by_step_count > 0 %>
47
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
33
+ <% if navigation.show_brexit_related_links? && navigation.step_by_step_count > 0 %>
34
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_related_links' %>
48
35
  <% end %>
49
36
  </div>
@@ -1,6 +1,20 @@
1
+ <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
1
2
  <% link_text = t("components.related_navigation.transition.link_text") %>
2
3
  <% link_path = t("components.related_navigation.transition.link_path") %>
3
- <div class="gem-c-contextual-sidebar__brexit-cta govuk-!-margin-bottom-6" data-module="track-click" lang="en">
4
+
5
+ <% data_attributes = {
6
+ "module": "track-click",
7
+ "track-category": "relatedLinkClicked",
8
+ "track-action": "1.0 Transition",
9
+ "track-label": link_path,
10
+ "track-dimension": link_text,
11
+ "track-dimension-index": "29",
12
+ } %>
13
+
14
+ <%= link_to link_path,
15
+ class: "govuk-link gem-c-contextual-sidebar__brexit-cta",
16
+ data: data_attributes,
17
+ lang: shared_helper.t_locale("components.related_navigation.transition.title") do %>
4
18
  <h2 class="gem-c-contextual-sidebar__brexit-heading"><%= t("components.related_navigation.transition.title") %></h2>
5
- <a href="<%= link_path %>" class="govuk-link" data-track-category="relatedLinkClicked" data-track-action="1.0 Transition" data-track-label="<%= link_path %>" data-track-options='{"dimension29":"<%= link_text %>"}'><%= link_text %></a>
6
- </div>
19
+ <p class="gem-c-contextual-sidebar__brexit-text"><%= link_text %></p>
20
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <% link_text = t("components.related_navigation.transition.link_text") %>
2
+ <% link_path = t("components.related_navigation.transition.link_path") %>
3
+ <div class="gem-c-contextual-sidebar__brexit-related-links govuk-!-margin-bottom-6" data-module="track-click" lang="en">
4
+ <h2 class="gem-c-contextual-sidebar__brexit-heading"><%= t("components.related_navigation.transition.title") %></h2>
5
+ <a href="<%= link_path %>" class="govuk-link" data-track-category="relatedLinkClicked" data-track-action="1.0 Transition" data-track-label="<%= link_path %>" data-track-options='{"dimension29":"<%= link_text %>"}'><%= link_text %></a>
6
+ </div>
@@ -81,7 +81,7 @@ examples:
81
81
  - text: The Highway Code
82
82
  href: "/guidance/the-highway-code"
83
83
  optional: false
84
- with_brexit_cta_and_related_links:
84
+ with_brexit_and_other_related_links:
85
85
  data:
86
86
  content_item:
87
87
  title: "A content item"
@@ -108,7 +108,7 @@ examples:
108
108
  - title: The future of jobs and skills
109
109
  base_path: /government/collections/the-future-of-jobs-and-skills
110
110
  document_type: document_collection
111
- with_brexit_cta_and_step_by_steps:
111
+ with_brexit_related_links_and_step_by_steps:
112
112
  data:
113
113
  content_item:
114
114
  title: "A content item"
@@ -10,9 +10,6 @@ cy:
10
10
  contents: Cynnwys
11
11
  related_navigation:
12
12
  transition:
13
- title: "Pontio Brexit"
13
+ title: "Brexit"
14
14
  link_path: "/transition.cy"
15
- link_text: "Gwiriwch eich bod chi'n barod ar gyfer 2021"
16
- transition_countdown:
17
- day_to_go: "diwrnod i fynd"
18
- days_to_go: "diwrnod i fynd"
15
+ link_text: "Darganfyddwch sut mae’r rheolau newydd yn effeithio arnoch chi"
@@ -77,9 +77,9 @@ en:
77
77
  topical_events: "Topical event"
78
78
  world_locations: "World locations"
79
79
  transition:
80
- title: "Brexit transition"
80
+ title: "Brexit"
81
81
  link_path: "/transition"
82
- link_text: "Check you’re ready for 2021"
82
+ link_text: "Check how the new rules affect you"
83
83
  related_footer_navigation:
84
84
  collections: "Collections"
85
85
  policies: "Policies"
@@ -103,6 +103,3 @@ en:
103
103
  summary_list:
104
104
  edit: "Change"
105
105
  delete: "Delete"
106
- transition_countdown:
107
- day_to_go: "day to go"
108
- days_to_go: "days to go"
@@ -34,7 +34,6 @@ require "govuk_publishing_components/presenters/taxonomy_list_helper"
34
34
  require "govuk_publishing_components/app_helpers/taxon_breadcrumbs"
35
35
  require "govuk_publishing_components/app_helpers/table_helper"
36
36
  require "govuk_publishing_components/app_helpers/brand_helper"
37
- require "govuk_publishing_components/app_helpers/countdown_helper"
38
37
  require "govuk_publishing_components/app_helpers/environment"
39
38
 
40
39
  # Add i18n paths and views for usage outside of a Rails app
@@ -104,7 +104,7 @@ module GovukPublishingComponents
104
104
  false
105
105
  end
106
106
 
107
- def show_brexit_cta?
107
+ def show_brexit_related_links?
108
108
  # If tagged directly to /brexit or /world/brexit
109
109
  # Or if tagged to a taxon which has /brexit as a parent
110
110
  # And is not the brexit checker start page
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "23.10.2".freeze
2
+ VERSION = "23.11.0".freeze
3
3
  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: 23.10.2
4
+ version: 23.11.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: 2020-12-23 00:00:00.000000000 Z
11
+ date: 2020-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -678,13 +678,13 @@ files:
678
678
  - app/views/govuk_publishing_components/components/_taxonomy_list.html.erb
679
679
  - app/views/govuk_publishing_components/components/_textarea.html.erb
680
680
  - app/views/govuk_publishing_components/components/_title.html.erb
681
- - app/views/govuk_publishing_components/components/_transition_countdown.html.erb
682
681
  - app/views/govuk_publishing_components/components/_translation-nav.html.erb
683
682
  - app/views/govuk_publishing_components/components/_warning_text.html.erb
684
683
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_document.svg
685
684
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.svg
686
685
  - app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.svg
687
686
  - app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
687
+ - app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_related_links.html.erb
688
688
  - app/views/govuk_publishing_components/components/docs/accordion.yml
689
689
  - app/views/govuk_publishing_components/components/docs/action_link.yml
690
690
  - app/views/govuk_publishing_components/components/docs/admin_analytics.yml
@@ -758,7 +758,6 @@ files:
758
758
  - app/views/govuk_publishing_components/components/docs/taxonomy_list.yml
759
759
  - app/views/govuk_publishing_components/components/docs/textarea.yml
760
760
  - app/views/govuk_publishing_components/components/docs/title.yml
761
- - app/views/govuk_publishing_components/components/docs/transition_countdown.yml
762
761
  - app/views/govuk_publishing_components/components/docs/translation-nav.yml
763
762
  - app/views/govuk_publishing_components/components/docs/warning_text.yml
764
763
  - app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb
@@ -783,7 +782,6 @@ files:
783
782
  - lib/generators/govuk_publishing_components/templates/component.yml.erb
784
783
  - lib/govuk_publishing_components.rb
785
784
  - lib/govuk_publishing_components/app_helpers/brand_helper.rb
786
- - lib/govuk_publishing_components/app_helpers/countdown_helper.rb
787
785
  - lib/govuk_publishing_components/app_helpers/environment.rb
788
786
  - lib/govuk_publishing_components/app_helpers/table_helper.rb
789
787
  - lib/govuk_publishing_components/app_helpers/taxon_breadcrumbs.rb
@@ -1,35 +0,0 @@
1
- <%
2
- countdown_clock = GovukPublishingComponents::AppHelpers::CountdownHelper.new
3
- shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
4
-
5
- heading_level ||= 2
6
- title ||= nil
7
- text ||= nil
8
- url ||= nil
9
- data_attributes ||= {}
10
- lang ||= "en"
11
- direction ||= "ltr"
12
- css_classes = %w(gem-c-transition-countdown)
13
- css_classes << "gem-c-transition-countdown--cta" if url
14
- css_classes << "govuk-link" if url
15
- %>
16
-
17
- <% countdown = capture do %>
18
- <%= content_tag(shared_helper.get_heading_level, title, class: "gem-c-transition-countdown__title") if title %>
19
- <% if countdown_clock.show? %>
20
- <%= tag.p class: "gem-c-transition-countdown__countdown" do %>
21
- <%= tag.span countdown_clock.days_left.first, class: "gem-c-transition-countdown__countdown-number" %><%= tag.span countdown_clock.days_left.last, class: "gem-c-transition-countdown__countdown-number" %> <%= tag.span countdown_clock.days_text, class: "gem-c-transition-countdown__countdown-text" %>
22
- <% end %>
23
- <% end %>
24
- <%= tag.p text, class: "gem-c-transition-countdown__text" if text %>
25
- <% end %>
26
-
27
- <% if url %>
28
- <%= link_to url, class: css_classes, data: data_attributes, lang: lang, dir: direction do %>
29
- <%= countdown %>
30
- <% end %>
31
- <% else %>
32
- <%= tag.div class: css_classes, lang: lang, dir: direction do %>
33
- <%= countdown %>
34
- <% end %>
35
- <% end %>
@@ -1,17 +0,0 @@
1
- name: Transition countdown
2
- description: A countdown to 01 January 2021 used in the Brexit transition campaign
3
- body: When a URL is set it acts as a link to actions users need to take to prepare for brexit during the transition period
4
- shared_accessibility_criteria:
5
- - link
6
- examples:
7
- default:
8
- data:
9
- call_to_action:
10
- data:
11
- title: Brexit transition
12
- text: Check you’re ready for 2021
13
- url: "https://www.gov.uk/transition"
14
- data_attributes:
15
- "track-category": "Transition"
16
- "track-action": "Brexit transition"
17
- "track-label": "Check you’re ready for 2021"
@@ -1,49 +0,0 @@
1
- module GovukPublishingComponents
2
- module AppHelpers
3
- class CountdownHelper
4
- DEADLINE = Time.new(2020, 12, 31, 23, 59)
5
-
6
- def days_left
7
- sprintf "%02d", days_left_until_deadline
8
- end
9
-
10
- def show?
11
- minutes_left_until_deadline >= 30
12
- end
13
-
14
- def days_text
15
- if days_left_until_deadline == 1
16
- I18n.t!("components.transition_countdown.day_to_go")
17
- else
18
- I18n.t!("components.transition_countdown.days_to_go")
19
- end
20
- end
21
-
22
- private
23
-
24
- def days_left_until_deadline
25
- (minutes_left_until_deadline / 60 / 24).ceil
26
- end
27
-
28
- def minutes_left_until_deadline
29
- (seconds_left_until_deadline / 60)
30
- end
31
-
32
- def seconds_left_until_deadline
33
- end_of_transition_period - now_in_london
34
- end
35
-
36
- def end_of_transition_period
37
- london_time_zone(DEADLINE)
38
- end
39
-
40
- def now_in_london
41
- london_time_zone(Time.now)
42
- end
43
-
44
- def london_time_zone(time)
45
- time.in_time_zone("Europe/London")
46
- end
47
- end
48
- end
49
- end