govuk_publishing_components 9.2.0 → 9.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +4 -0
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +11 -0
- data/lib/govuk_publishing_components/presenters/translation_nav_helper.rb +5 -0
- 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: c5c04e04ffc3f0c67f68ba588e13a390bac44a5604abedfeb1320d7df82d6bad
|
4
|
+
data.tar.gz: cd5a7cd9d5b025bcf4e5ae7ba036547f3df6db82ced92de361716d6d2fa61ddf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f29339f3ea717ef9df865effb769f66c82e022978112ce4e7be8a0a7280dae8b9f475091f2796d37cf22e4e89cf6de6c0fadfe6868dae05ded7f125150414c56
|
7
|
+
data.tar.gz: a05e3eef6f1bbbeb9cb3a2292cae2e7f7ffcfa273cd3501a3d74059eabed145237fab2b883baf9c8b39e99585d453dc66ba423788008bd28e6fef6fc1a217bb8
|
@@ -5,7 +5,7 @@
|
|
5
5
|
%>
|
6
6
|
<% if translation_helper.has_translations? %>
|
7
7
|
<nav role="navigation"
|
8
|
-
class="gem-c-translation-nav <%= brand_helper.brand_class %>"
|
8
|
+
class="gem-c-translation-nav <%= translation_helper.margin_class %> <%= brand_helper.brand_class %>"
|
9
9
|
aria-label="<%= t("common.translations") %>"
|
10
10
|
<%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
|
11
11
|
>
|
@@ -71,6 +71,17 @@ examples:
|
|
71
71
|
- locale: 'cy'
|
72
72
|
base_path: '/cy'
|
73
73
|
text: 'Cymraeg'
|
74
|
+
with_no_top_margin:
|
75
|
+
data:
|
76
|
+
no_margin_top: true
|
77
|
+
translations:
|
78
|
+
- locale: 'en'
|
79
|
+
base_path: '/en'
|
80
|
+
text: 'English'
|
81
|
+
active: true
|
82
|
+
- locale: 'cy'
|
83
|
+
base_path: '/cy'
|
84
|
+
text: 'Cymraeg'
|
74
85
|
with_tracking:
|
75
86
|
description: Data attributes can be passed for each link as shown.
|
76
87
|
data:
|
@@ -6,6 +6,7 @@ module GovukPublishingComponents
|
|
6
6
|
def initialize(local_assigns)
|
7
7
|
@translations = []
|
8
8
|
@translations = local_assigns[:translations] if local_assigns[:translations]
|
9
|
+
@no_margin_top = local_assigns[:no_margin_top]
|
9
10
|
end
|
10
11
|
|
11
12
|
def has_translations?
|
@@ -18,6 +19,10 @@ module GovukPublishingComponents
|
|
18
19
|
end
|
19
20
|
false
|
20
21
|
end
|
22
|
+
|
23
|
+
def margin_class
|
24
|
+
"gem-c-translation-nav--no-margin-top" if @no_margin_top
|
25
|
+
end
|
21
26
|
end
|
22
27
|
end
|
23
28
|
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.2.
|
4
|
+
version: 9.2.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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|