govuk_publishing_components 21.16.2 → 21.16.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd3631de36641c59dfc021f733e5ba1eec80cc545c587981cbb88b7f3f65f297
4
- data.tar.gz: a453453992dd254ca22d6e4f8ddfc8b59f0757bf3e975f8dfc6399b6156c8897
3
+ metadata.gz: 87dfcb6b6a7a9bf13805cda32b823913b64a85e4e4fb0f9f09da1e695f770d31
4
+ data.tar.gz: f1f38ace384cbaa3d344624bb5674a8decd2b560747db4e58e140fbb6bc3a102
5
5
  SHA512:
6
- metadata.gz: 7d0dd2487f3ef85760258df4fdf13f8cef21094b0e704aaff16d3922ed85158cc8a1323ed37b55efb198b8a5b148d947f5f9df879a24930d18a692267ac3d664
7
- data.tar.gz: 4b193083739e1552cb41b102bc8c77cfbe12c5afa0f62a15037b1131cfdae3e3a00a540fd9d0e7360ce1f20bf90f6c2c6af6283f46106eeebf5c0f338e10b56c
6
+ metadata.gz: 31f4467a19500873d984b949e941afcf9b985a45e23d20ae51b3c7ad09780bf6c47bbd55f459606caf8453f7db09174040b56dea6b6193b931153addde3007ae
7
+ data.tar.gz: 77f867b995b34a7348be4121b3db7bbdcfcb148da101a1d598911e49b57a64a9cd2e96b76afbf542b3c11a983a9e460d7725b3ec4a03b63f61aab6c7346b1d0c
@@ -62,8 +62,6 @@
62
62
 
63
63
  .gem-c-document-list__item-metadata {
64
64
  padding: 0;
65
- margin: 0;
66
- @include govuk-font(19);
67
65
  }
68
66
 
69
67
  .gem-c-document-list__attribute {
@@ -8,75 +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"
11
12
 
12
13
  brand ||= false
13
14
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
14
15
  %>
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 %>
64
16
  <% if items.any? %>
65
- <% unless within_multitype_list || items.one? %>
17
+ <% unless within_multitype_list %>
66
18
  <ol class="<%= classes %>">
67
19
  <% end %>
68
20
  <% items.each do |item| %>
69
21
  <% highlight_class = " gem-c-document-list__item--highlight" if item[:highlight] %>
70
22
 
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 %>
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>
78
76
  <% end %>
79
- <% unless within_multitype_list || items.one? %>
77
+ <% unless within_multitype_list %>
80
78
  </ol>
81
79
  <% end %>
82
80
  <% end %>
@@ -236,12 +236,3 @@ 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.2'.freeze
2
+ VERSION = '21.16.3'.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: 21.16.2
4
+ version: 21.16.3
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: 2019-12-20 00:00:00.000000000 Z
11
+ date: 2019-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters