govuk_publishing_components 10.2.0 → 11.0.0

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: '0649b5020dae2cba694ad63df39cd6cb0b89cd0576c2b5ca3e3dcfcb49ab15ec'
4
- data.tar.gz: 5113282e562ce2007cfc5b42224f5843fcd85046c9c31d7ebbaf105827efc556
3
+ metadata.gz: 154ec0ba2a3a52f59a7ac5f399812d37b323ae2adc3665e7632324f666d999d2
4
+ data.tar.gz: bd0339d107c6f63330401b89b375337eafe10c434d9c64f30533da52c62af5b3
5
5
  SHA512:
6
- metadata.gz: be36558fc5aab493495122f07488db2c715d94a663e1d5aaba56dc21fe34a8ca6fb4a76ab7f64ee365283d0bc8b5b234e6cc8e55f8a209652e333420ed9e0eeb
7
- data.tar.gz: 3ea11fa1c9249fddffa6b9701468ec394bd37da45ace0abe6dfc3c300f494123df2595b4b5f4c75a4fcd4297efdb405c0f2c848e65792b0bbe23d9e364b3e3e2
6
+ metadata.gz: 911320cba45f74c279e24175182f696217cd7df82baf3454eccc8b7d8ba00b9b8551c5c4f3fe549a111690b0e6bcc5991c9cd44b7a908600492e39fd7b1e4058
7
+ data.tar.gz: 3072d1970d946fb3ca9217ad042eb7d5c6e0c591473b6abb8592fb799eca83da3bfe7c4dbd1754b014b5c30d0b670590ba1b569fcc6c284945d2c1f3f20efe4a
@@ -39,7 +39,9 @@ examples:
39
39
  href: "/also-not-a-page"
40
40
  image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
41
41
  image_alt: "some meaningful alt text please"
42
- context: "10 May 2018 - Press release"
42
+ context:
43
+ date: 2016-06-27 10:29:44
44
+ text: "Press release"
43
45
  heading_text: "Government does things"
44
46
  description: "Following a thorough review of existing procedure, a government body has today announced that further work is necessary."
45
47
  with_extra_links:
@@ -69,7 +71,8 @@ examples:
69
71
  href: "/government/people/"
70
72
  image_src: "http://placekitten.com/215/140"
71
73
  image_alt: "some meaningful alt text please"
72
- context: "The Rt Hon"
74
+ context:
75
+ text: "The Rt Hon"
73
76
  heading_text: "John Whiskers MP"
74
77
  extra_links: [
75
78
  {
@@ -149,7 +152,9 @@ examples:
149
152
  href: "/still-not-a-page"
150
153
  image_src: "https://assets.publishing.service.gov.uk/frontend/homepage/leaving-the-eu-bc9992ee672a30d8e8a3e195c9afa750e618748130a4e073a593ba36dfc29af9.jpg"
151
154
  image_alt: "some meaningful alt text please"
152
- context: "14 Jun 2017 - Announcement"
155
+ context:
156
+ date: 2017-06-14 11:30:00
157
+ text: "Announcement"
153
158
  heading_text: "Something has happened nearby possibly"
154
159
  description: "Following a news report that something has happened, further details are emerging of the thing that has happened and what that means for you."
155
160
  with_tracking:
@@ -188,7 +193,8 @@ examples:
188
193
  href: "/government/people/"
189
194
  image_src: "http://placekitten.com/215/140"
190
195
  image_alt: "some meaningful alt text please"
191
- context: "The Rt Hon"
196
+ context:
197
+ text: "The Rt Hon"
192
198
  heading_text: "John Whiskers MP"
193
199
  metadata: "Unpaid"
194
200
  extra_links: [
@@ -67,7 +67,8 @@ examples:
67
67
  image:
68
68
  url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
69
69
  alt: some meaningful alt text please
70
- context: The Rt Hon
70
+ context:
71
+ text: The Rt Hon
71
72
  - link:
72
73
  path: /not-a-page
73
74
  text: News headline
@@ -75,7 +76,8 @@ examples:
75
76
  image:
76
77
  url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
77
78
  alt: some meaningful alt text please
78
- context: The Rt Hon
79
+ context:
80
+ text: The Rt Hon
79
81
  - link:
80
82
  path: /not-a-page
81
83
  text: News headline
@@ -83,7 +85,8 @@ examples:
83
85
  image:
84
86
  url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
85
87
  alt: some meaningful alt text please
86
- context: The Rt Hon
88
+ context:
89
+ text: The Rt Hon
87
90
  - link:
88
91
  path: /not-a-page
89
92
  text: News headline
@@ -91,7 +94,9 @@ examples:
91
94
  image:
92
95
  url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG
93
96
  alt: some meaningful alt text please
94
- context: The Rt Hon
97
+ context:
98
+ text: This is a document
99
+ date: 2016-06-27 10:29:44
95
100
  document_list:
96
101
  items:
97
102
  - link:
@@ -40,7 +40,22 @@ module GovukPublishingComponents
40
40
  end
41
41
 
42
42
  def context
43
- content_tag(:p, @context, class: "gem-c-image-card__context") if @context
43
+ return unless @context
44
+
45
+ content_tag(:p, class: 'gem-c-image-card__context') do
46
+ if @context[:date]
47
+ date = content_tag(:time, l(@context[:date], format: '%e %B %Y'), datetime: @context[:date].iso8601)
48
+ dash = content_tag(:span, ' — ', 'aria-hidden': true)
49
+
50
+ if @context[:text]
51
+ date.concat(dash).concat(@context[:text])
52
+ else
53
+ date
54
+ end
55
+ else
56
+ @context[:text]
57
+ end
58
+ end
44
59
  end
45
60
 
46
61
  def heading_tag
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '10.2.0'.freeze
2
+ VERSION = '11.0.0'.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: 10.2.0
4
+ version: 11.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev