govuk-components 1.0.1 → 1.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 381764ecf5e843d375020a7fe394acef575c591b08035da10d2d0303ae07925f
|
4
|
+
data.tar.gz: a40ece8066dda10d5bbef274014350967734290aa3f01240a13cd9bb36b52886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 238e795f32101c4f5b91dcc3c4e86b4dc2dce8b39f1ab377f353838afc8cb12e192176575d1b7a816ecc8592e213bbb60f1dc22e9a3ebe3b2f3cbbe0ec156e6e
|
7
|
+
data.tar.gz: 044ea8db203a2ef93781a066bd9c4559c5d45d11f9cdd76c023c7799d5a6caf4d502687f610e094019f1544a2d56bb6fd990d98a496b7457012a854c6b9406b6
|
@@ -7,9 +7,13 @@
|
|
7
7
|
<div class="govuk-notification-banner__content">
|
8
8
|
<% headings.each do |heading| %>
|
9
9
|
<p class="govuk-notification-banner__heading">
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
<% if heading.text.present? %>
|
11
|
+
<%= heading.text %>
|
12
|
+
<% if heading.link_target && heading.link_text %>
|
13
|
+
<%= link_to(heading.link_text, heading.link_target, class: "govuk-notification-banner__link") %>.
|
14
|
+
<% end %>
|
15
|
+
<% else %>
|
16
|
+
<%= heading.content %>
|
13
17
|
<% end %>
|
14
18
|
</p>
|
15
19
|
<% end %>
|
@@ -36,9 +36,9 @@ class GovukComponent::NotificationBanner < GovukComponent::Base
|
|
36
36
|
class Heading < ViewComponent::Slot
|
37
37
|
attr_accessor :text, :link_target, :link_text
|
38
38
|
|
39
|
-
def initialize(text
|
40
|
-
@text
|
41
|
-
@link_text
|
39
|
+
def initialize(text: nil, link_text: nil, link_target: nil)
|
40
|
+
@text = text
|
41
|
+
@link_text = link_text
|
42
42
|
@link_target = link_target
|
43
43
|
end
|
44
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk-components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DfE developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|