govuk_publishing_components 9.3.0 → 9.3.1

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: e898b8aad4d901afc19f820509987cb527155bc15e5d54f9c231b8bb46f2d16c
4
- data.tar.gz: b56443a297872d4bff191111d695d86b014418a4256f31b158e503229472c061
3
+ metadata.gz: 6ecd392a88efc84f985324f2e6c732735ae963430cb4aad7a160f5aa9d07b1de
4
+ data.tar.gz: d9d583b2627ebe242d20d9e7d03e75668b9a1c801bb9156a7dab99493ef33aec
5
5
  SHA512:
6
- metadata.gz: deb016b712858cebf2aa9fc3d77c21b3a542a6b29c1ddb6115487f15166f4bd57f041ff65e5dce2bb6bdb92053d80ab7c6542d2867ebb3d65ca6a06c51a70c7a
7
- data.tar.gz: 49e6cbc17a985cd14729dfc704dc93158fe7d84042f06ed38d03a13e93e62bda6eb4ee689fb969a578395d5f1288d1a0adde94bcf4aea0b391763f377e91fac7
6
+ metadata.gz: 9d33af4de552d60af3efbc6aed22224b389292d0415abea37b92118e08a367b0581fc903486f39335ef1aec7f4ed6dc9a2ca95b11984dfe5d736e7c8a3df8fc3
7
+ data.tar.gz: 8aef3fc9b40e1ea24775f59b5a392fd881809a6698949824e9e7b90ce4b7d0d2b56241cf12bcb473b509a7847fab34fd10280e6c7385df8746c2c30722d0d900
@@ -3,7 +3,7 @@
3
3
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
4
4
  card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns)
5
5
  %>
6
- <% if card_helper.href %>
6
+ <% if card_helper.href || card_helper.extra_links.any? %>
7
7
  <div class="gem-c-image-card <%= "gem-c-image-card--large" if card_helper.large %> <%= brand_helper.brand_class %>"
8
8
  <%= "data-module=track-click" if card_helper.is_tracking? %>
9
9
  >
@@ -15,16 +15,20 @@
15
15
  <% if card_helper.heading_text %>
16
16
  <%= content_tag(card_helper.heading_tag,
17
17
  class: "gem-c-image-card__title") do %>
18
- <%= link_to card_helper.heading_text, card_helper.href,
19
- class: "gem-c-image-card__title-link #{brand_helper.color_class}",
20
- data: card_helper.href_data_attributes
21
- %>
18
+ <% if card_helper.href %>
19
+ <%= link_to card_helper.heading_text, card_helper.href,
20
+ class: "gem-c-image-card__title-link #{brand_helper.color_class}",
21
+ data: card_helper.href_data_attributes
22
+ %>
23
+ <% else %>
24
+ <%= card_helper.heading_text %>
25
+ <% end %>
22
26
  <% end %>
23
27
  <% end %>
24
28
 
25
29
  <%= card_helper.description %>
26
30
 
27
- <% if card_helper.extra_links %>
31
+ <% if card_helper.extra_links.any? %>
28
32
  <ul class="gem-c-image-card__list <%= "gem-c-image-card__list--indented" if not card_helper.extra_links_no_indent %>">
29
33
  <% card_helper.extra_links.each do |link| %>
30
34
  <li class="gem-c-image-card__list-item">
@@ -1,7 +1,7 @@
1
1
  name: Image card
2
2
  description: Image and associated text with a link
3
3
  body: |
4
- An image and an associated link, meant for use for news articles and people. Includes optional paragraph and additional links.
4
+ An image and links, meant for use for news articles and people. Includes optional paragraph and additional links.
5
5
 
6
6
  The component is generally to be used within a grid column but has no grid of its own, so the text and the images in the examples below may not always line up. This will normally look tidier, for example [on pages like this](https://www.gov.uk/government/organisations/attorney-generals-office).
7
7
  accessibility_criteria: |
@@ -70,6 +70,22 @@ examples:
70
70
  }
71
71
  ]
72
72
  extra_links_no_indent: true
73
+ extra_links_with_no_main_link:
74
+ description: If extra links are included, the main link is not needed. Note that in this configuration the image is not a link as no link has been supplied.
75
+ data:
76
+ image_src: "http://placekitten.com/215/140"
77
+ image_alt: "some meaningful alt text please"
78
+ heading_text: "John Whiskers MP"
79
+ extra_links: [
80
+ {
81
+ text: "Minister for Cats",
82
+ href: "/government/ministers/"
83
+ },
84
+ {
85
+ text: "Head of Tuna Operations",
86
+ href: "/government/ministers/"
87
+ }
88
+ ]
73
89
  without_heading_text:
74
90
  description: |
75
91
  The only required parameter to the component is href but if no heading_text is supplied the link will not appear. This is to allow the component to use only extra links as shown.
@@ -1,4 +1,6 @@
1
1
  cy:
2
+ common:
3
+ translations: "Cyfieithiadau"
2
4
  components:
3
5
  radio:
4
6
  or: 'neu'
@@ -9,7 +9,7 @@ module GovukPublishingComponents
9
9
  def initialize(local_assigns)
10
10
  @href = local_assigns[:href]
11
11
  @href_data_attributes = local_assigns[:href_data_attributes]
12
- @extra_links = local_assigns[:extra_links]
12
+ @extra_links = local_assigns[:extra_links] || []
13
13
  @image_src = local_assigns[:image_src]
14
14
  @image_alt = local_assigns[:image_alt] || ""
15
15
  @context = local_assigns[:context]
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '9.3.0'.freeze
2
+ VERSION = '9.3.1'.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: 9.3.0
4
+ version: 9.3.1
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: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2018-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config