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 +4 -4
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +10 -6
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +17 -1
- data/config/locales/cy.yml +2 -0
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ecd392a88efc84f985324f2e6c732735ae963430cb4aad7a160f5aa9d07b1de
|
4
|
+
data.tar.gz: d9d583b2627ebe242d20d9e7d03e75668b9a1c801bb9156a7dab99493ef33aec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
19
|
-
|
20
|
-
|
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
|
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.
|
data/config/locales/cy.yml
CHANGED
@@ -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]
|
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.
|
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-
|
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
|