govuk_publishing_components 21.16.0 → 21.16.1

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: 06c37091574f949ad8140b3d67416f86d27c2b30051a22b5677e9741db034275
4
- data.tar.gz: a4341467f69fc573e80513a05dd7cb7ea6664712dc88e88e6f8832407f738a00
3
+ metadata.gz: 3deb53c838696e8cdd502b0774af651a5c674079ef5e3f5a69f0f82020162852
4
+ data.tar.gz: cdcbd9c547dc673cab6561136515dd1577402a3df5ddb30055f3e943518bb885
5
5
  SHA512:
6
- metadata.gz: 92e2283dbb3527522729b82d2030955805c70ad29f2270aff0dbb663cb8d2b7a3107ea08b8de8f749a543b46e4b58d20ba4846380fb0d004b8d55b27672df07c
7
- data.tar.gz: b6d85184eef98c6582c794e7726ae4289a1bbd0ac3382958d039c84364a9aedb4ea39101a6c0c078a93afcdf2d40fd627ab970aaa177df8bde9d9adcdd691075
6
+ metadata.gz: fe892a3eb3e0d32fa3402e3ab500f9cce34a4eca8c8520ddd6d59e8f2c124a0bb956b55305c58bc5239b1dcb299c6f6bc75b9a053799d0e07a349173ad5c5da3
7
+ data.tar.gz: 4bf254ca7d937f23ea26d0bd2a08975144c091665551a44e32f424a49a28326d1a6c3c9b13481275a99d7e1d46f66b7315ca0668aa10d67246f801e5e1ca27f2
@@ -68,6 +68,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
68
68
  this.$module.showConfirmationMessage()
69
69
  this.$module.cookieBannerConfirmationMessage.focus()
70
70
  window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
71
+ if (window.GOVUK.analyticsInit) {
72
+ window.GOVUK.analyticsInit()
73
+ }
71
74
  }
72
75
 
73
76
  CookieBanner.prototype.showConfirmationMessage = function () {
@@ -62,6 +62,8 @@
62
62
 
63
63
  .gem-c-document-list__item-metadata {
64
64
  padding: 0;
65
+ margin: 0;
66
+ @include govuk-font(19);
65
67
  }
66
68
 
67
69
  .gem-c-document-list__attribute {
@@ -8,71 +8,73 @@
8
8
 
9
9
  within_multitype_list ||= false
10
10
  within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
11
- title_with_context_class = " gem-c-document-list__item-title--context"
12
11
 
13
12
  brand ||= false
14
13
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
15
14
  %>
15
+ <% def document(item, brand_helper) %>
16
+ <% title_with_context_class = " gem-c-document-list__item-title--context" %>
17
+ <% if item[:highlight] && item[:highlight_text] %>
18
+ <p class='gem-c-document-list__highlight-text'><%= item[:highlight_text] %></p>
19
+ <% end %>
20
+ <%=
21
+ item_classes = "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
22
+
23
+ if item[:link][:path]
24
+ link_to(
25
+ item[:link][:text],
26
+ item[:link][:path],
27
+ data: item[:link][:data_attributes],
28
+ class: "#{item_classes} gem-c-document-list__item-link",
29
+ )
30
+ else
31
+ content_tag(
32
+ "span",
33
+ item[:link][:text],
34
+ data: item[:link][:data_attributes],
35
+ class: item_classes,
36
+ )
37
+ end
38
+ %>
39
+ <% if item[:link][:context] %>
40
+ <span class="gem-c-document-list__item-context"><%= item[:link][:context] %></span>
41
+ <% end %>
42
+ <% if item[:link][:description] %>
43
+ <p class="gem-c-document-list__item-description" ><%= item[:link][:description] %></p>
44
+ <% end %>
45
+ <% if item[:metadata] %>
46
+ <ul class="gem-c-document-list__item-metadata">
47
+ <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
48
+ <li class="gem-c-document-list__attribute">
49
+ <% if item_metadata_key.to_s.eql?("public_updated_at") %>
50
+ <time datetime="<%= item_metadata_value.iso8601 %>">
51
+ <%= l(item_metadata_value, format: '%e %B %Y') %>
52
+ </time>
53
+ <% else %>
54
+ <%= item_metadata_value %>
55
+ <% end %>
56
+ </li>
57
+ <% end %>
58
+ </ul>
59
+ <% end %>
60
+ <% if item[:subtext] %>
61
+ <p class="gem-c-document-list__subtext"><%= item[:subtext] %></p>
62
+ <% end %>
63
+ <% end %>
16
64
  <% if items.any? %>
17
- <% unless within_multitype_list %>
65
+ <% unless within_multitype_list || items.one? %>
18
66
  <ol class="<%= classes %>">
19
67
  <% end %>
20
68
  <% items.each do |item| %>
21
69
  <% highlight_class = " gem-c-document-list__item--highlight" if item[:highlight] %>
22
70
 
23
- <li class="gem-c-document-list__item<%= within_multitype_list_class %> <%= brand_helper.brand_class %> <%= highlight_class %>">
24
- <% if item[:highlight] && item[:highlight_text] %>
25
- <p class='gem-c-document-list__highlight-text'><%= item[:highlight_text] %></p>
26
- <% end %>
27
-
28
- <%=
29
- item_classes = "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
30
-
31
- if item[:link][:path]
32
- link_to(
33
- item[:link][:text],
34
- item[:link][:path],
35
- data: item[:link][:data_attributes],
36
- class: "#{item_classes} gem-c-document-list__item-link",
37
- )
38
- else
39
- content_tag(
40
- "span",
41
- item[:link][:text],
42
- data: item[:link][:data_attributes],
43
- class: item_classes,
44
- )
45
- end
46
- %>
47
-
48
- <% if item[:link][:context] %>
49
- <span class="gem-c-document-list__item-context"><%= item[:link][:context] %></span>
50
- <% end %>
51
-
52
- <% if item[:link][:description] %>
53
- <p class="gem-c-document-list__item-description" ><%= item[:link][:description] %></p>
54
- <% end %>
55
-
56
- <% if item[:metadata] %>
57
- <ul class="gem-c-document-list__item-metadata">
58
- <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
59
- <li class="gem-c-document-list__attribute">
60
- <% if item_metadata_key.to_s.eql?("public_updated_at") %>
61
- <time datetime="<%= item_metadata_value.iso8601 %>">
62
- <%= l(item_metadata_value, format: '%e %B %Y') %>
63
- </time>
64
- <% else %>
65
- <%= item_metadata_value %>
66
- <% end %>
67
- </li>
68
- <% end %>
69
- </ul>
70
- <% end %>
71
-
72
- <% if item[:subtext] %>
73
- <p class="gem-c-document-list__subtext"><%= item[:subtext] %></p>
74
- <% end %>
75
- </li>
71
+ <% if items.one? %>
72
+ <% document(item, brand_helper) %>
73
+ <% else %>
74
+ <li class="gem-c-document-list__item<%= within_multitype_list_class %> <%= brand_helper.brand_class %> <%= highlight_class %>">
75
+ <% document(item, brand_helper) %>
76
+ </li>
77
+ <% end %>
76
78
  <% end %>
77
79
  <% unless within_multitype_list %>
78
80
  </ol>
@@ -236,3 +236,12 @@ examples:
236
236
  document_type: 'Organisation'
237
237
  context:
238
238
  right_to_left: true
239
+ with_a_single_item:
240
+ data:
241
+ items:
242
+ - link:
243
+ text: 'Alternative provision'
244
+ path: '/government/publications/alternative-provision'
245
+ metadata:
246
+ public_updated_at: 2016-06-27 10:29:44
247
+ document_type: 'Statutory guidance'
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '21.16.0'.freeze
2
+ VERSION = '21.16.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 21.16.0
4
+ version: 21.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev