govuk-components 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/components/govuk_component/footer.html.erb +36 -24
- data/app/components/govuk_component/footer.rb +14 -10
- data/lib/govuk/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: d6f8009727bd1da1e578c97b2b2dfe48b6e86a97f0e7854e16edbb3bf7991154
|
4
|
+
data.tar.gz: a0442f769f7fb611a083b34707210fa11a499708d64c9b9aab0081218262e7f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4cacf374531c0c9cd3f41750cc1e640f543fd4eb21b587690fa653fb683a6a29c515acd1938b24ceeee62b32b772a5becc6fb856102260608ead6f31f5a482c
|
7
|
+
data.tar.gz: 18846eb057b53d9ed93ef5bffe9c3d676a46c9522997d316ac6054fb7348adef0e064a86210a8f9755942a7a5eeeb6556db4263b2aea01b53caeae5d75c864a9
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=DFE-Digital/govuk-components)](https://dependabot.com)
|
8
8
|
[![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-3.10.2-brightgreen)](https://design-system.service.gov.uk)
|
9
9
|
|
10
|
-
This gem provides a suite of reusable components for the [GOV.UK Design System](https://design-system.service.gov.uk/). It is intended to provide a lightweight alternative to the [GOV.UK Publishing Components](https://github.com/alphagov/govuk_publishing_components) library and is built with Github's [ViewComponent](https://github.com/github/view_component) framework.
|
10
|
+
This gem provides a suite of reusable components for the [GOV.UK Design System](https://design-system.service.gov.uk/). It is intended to provide a lightweight alternative to the [GOV.UK Publishing Components](https://github.com/alphagov/govuk_publishing_components) library and is built with Github's [ViewComponent](https://github.com/github/view_component) framework.
|
11
11
|
|
12
12
|
## What's included
|
13
13
|
|
@@ -1,30 +1,42 @@
|
|
1
1
|
<%= tag.footer(class: classes, role: 'contentinfo', **html_attributes) do %>
|
2
2
|
<div class="govuk-width-container ">
|
3
|
-
<% if content.present? %>
|
4
|
-
<%= content %>
|
5
|
-
<% end %>
|
6
3
|
<div class="govuk-footer__meta">
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
4
|
+
<% if meta.present? %>
|
5
|
+
<%= meta.content %>
|
6
|
+
<% else %>
|
7
|
+
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
|
8
|
+
<% if meta_items.any? %>
|
9
|
+
<h2 class="govuk-visually-hidden"><%= meta_items_title %></h2>
|
10
|
+
|
11
|
+
<ul class="govuk-footer__inline-list">
|
12
|
+
<% @meta_items.each do |hyperlink| %>
|
13
|
+
<li class="govuk-footer__inline-list-item">
|
14
|
+
<%= hyperlink %>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
17
|
+
</ul>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% if meta_licence.nil? %>
|
21
|
+
<svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 483.2 195.7" height="17" width="41">
|
22
|
+
<path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145" />
|
23
|
+
</svg>
|
24
|
+
|
25
|
+
<%= tag.span(default_licence, class: "govuk-footer__licence-description") %>
|
26
|
+
<% elsif meta_licence.present? %>
|
27
|
+
<%= tag.span(meta_licence, class: "govuk-footer__licence-description") %>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<% if meta_content.present? %>
|
31
|
+
<%= meta_content.content %>
|
32
|
+
<% end %>
|
33
|
+
</div>
|
34
|
+
<div class="govuk-footer__meta">
|
35
|
+
<div class="govuk-footer__meta-item">
|
36
|
+
<%= copyright %>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
28
40
|
</div>
|
29
41
|
</div>
|
30
42
|
<% end %>
|
@@ -1,13 +1,21 @@
|
|
1
1
|
class GovukComponent::Footer < GovukComponent::Base
|
2
|
-
|
2
|
+
include ViewComponent::Slotable
|
3
3
|
|
4
|
-
|
4
|
+
with_slot :meta_content
|
5
|
+
wrap_slot :meta_content
|
6
|
+
|
7
|
+
with_slot :meta
|
8
|
+
wrap_slot :meta
|
9
|
+
|
10
|
+
attr_accessor :meta_items, :meta_items_title, :meta_licence, :copyright
|
11
|
+
|
12
|
+
def initialize(meta_items: {}, meta_items_title: "Support links", meta_licence: nil, classes: [], html_attributes: {}, copyright_text: default_copright_text, copyright_url: default_copyright_url)
|
5
13
|
super(classes: classes, html_attributes: html_attributes)
|
6
14
|
|
7
|
-
@
|
8
|
-
@
|
9
|
-
@
|
10
|
-
@copyright
|
15
|
+
@meta_items = build_meta_links(meta_items)
|
16
|
+
@meta_items_title = meta_items_title
|
17
|
+
@meta_licence = meta_licence
|
18
|
+
@copyright = build_copyright(copyright_text, copyright_url)
|
11
19
|
end
|
12
20
|
|
13
21
|
private
|
@@ -24,10 +32,6 @@ private
|
|
24
32
|
links.map { |text, href| raw(link_to(text, href, class: %w(govuk-footer__link))) }
|
25
33
|
end
|
26
34
|
|
27
|
-
def default_meta_heading
|
28
|
-
'Supporting links'
|
29
|
-
end
|
30
|
-
|
31
35
|
def default_licence
|
32
36
|
link = link_to("Open Government Licence v3.0", "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/", class: %w(govuk-footer__link))
|
33
37
|
|
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.1.0
|
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-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|