govuk_publishing_components 63.2.0 → 63.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/app-promo-banner/govuk-app-icon.png +0 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/components/app-promo-banner.js +134 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +64 -0
- data/app/views/govuk_publishing_components/components/_app_promo_banner.html.erb +72 -0
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +4 -10
- data/app/views/govuk_publishing_components/components/docs/app_promo_banner.yml +30 -0
- data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +0 -16
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +4 -6
- data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb +1 -7
- data/config/locales/ar.yml +10 -4
- data/config/locales/az.yml +10 -4
- data/config/locales/be.yml +10 -4
- data/config/locales/bg.yml +10 -4
- data/config/locales/bn.yml +10 -4
- data/config/locales/cs.yml +10 -4
- data/config/locales/cy.yml +10 -4
- data/config/locales/da.yml +10 -4
- data/config/locales/de.yml +10 -4
- data/config/locales/dr.yml +10 -4
- data/config/locales/el.yml +10 -4
- data/config/locales/en.yml +6 -0
- data/config/locales/es-419.yml +10 -4
- data/config/locales/es.yml +10 -4
- data/config/locales/et.yml +10 -4
- data/config/locales/fa.yml +10 -4
- data/config/locales/fi.yml +10 -4
- data/config/locales/fr.yml +10 -4
- data/config/locales/gd.yml +10 -4
- data/config/locales/gu.yml +10 -4
- data/config/locales/he.yml +10 -4
- data/config/locales/hi.yml +10 -4
- data/config/locales/hr.yml +10 -4
- data/config/locales/hu.yml +10 -4
- data/config/locales/hy.yml +10 -4
- data/config/locales/id.yml +10 -4
- data/config/locales/is.yml +10 -4
- data/config/locales/it.yml +10 -4
- data/config/locales/ja.yml +10 -4
- data/config/locales/ka.yml +10 -4
- data/config/locales/kk.yml +10 -4
- data/config/locales/ko.yml +10 -4
- data/config/locales/ku.yml +10 -4
- data/config/locales/ky.yml +10 -4
- data/config/locales/lt.yml +10 -4
- data/config/locales/lv.yml +10 -4
- data/config/locales/ms.yml +10 -4
- data/config/locales/mt.yml +10 -4
- data/config/locales/ne.yml +10 -4
- data/config/locales/nl.yml +10 -4
- data/config/locales/no.yml +10 -4
- data/config/locales/pa-pk.yml +10 -4
- data/config/locales/pa.yml +10 -4
- data/config/locales/pl.yml +10 -4
- data/config/locales/ps.yml +10 -4
- data/config/locales/pt.yml +10 -4
- data/config/locales/ro.yml +10 -4
- data/config/locales/ru.yml +10 -4
- data/config/locales/si.yml +10 -4
- data/config/locales/sk.yml +10 -4
- data/config/locales/sl.yml +10 -4
- data/config/locales/so.yml +10 -4
- data/config/locales/sq.yml +10 -4
- data/config/locales/sr.yml +10 -4
- data/config/locales/sv.yml +10 -4
- data/config/locales/sw.yml +10 -4
- data/config/locales/ta.yml +10 -4
- data/config/locales/th.yml +10 -4
- data/config/locales/ti.yml +10 -4
- data/config/locales/tk.yml +10 -4
- data/config/locales/tr.yml +10 -4
- data/config/locales/uk.yml +10 -4
- data/config/locales/ur.yml +10 -4
- data/config/locales/uz.yml +10 -4
- data/config/locales/vi.yml +10 -4
- data/config/locales/zh-hk.yml +10 -4
- data/config/locales/zh-tw.yml +10 -4
- data/config/locales/zh.yml +10 -4
- data/lib/govuk_publishing_components/presenters/organisation_logo_helper.rb +17 -13
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +7 -2
data/config/locales/zh-tw.yml
CHANGED
|
@@ -13,6 +13,12 @@ zh-tw:
|
|
|
13
13
|
hide_all: 隱藏所有區段
|
|
14
14
|
show_all: 展開所有區段
|
|
15
15
|
this_section_visually_hidden: " 這個區段"
|
|
16
|
+
app_promo_banner:
|
|
17
|
+
aria_label:
|
|
18
|
+
body_text:
|
|
19
|
+
close:
|
|
20
|
+
title_text:
|
|
21
|
+
view:
|
|
16
22
|
article_schema:
|
|
17
23
|
scoped_search_description: 在 %{title} 內搜索
|
|
18
24
|
attachment:
|
|
@@ -152,6 +158,10 @@ zh-tw:
|
|
|
152
158
|
selected:
|
|
153
159
|
organisation_schema:
|
|
154
160
|
all_content_search_description: 從 %{organisation} 找到所有內容
|
|
161
|
+
pagination:
|
|
162
|
+
next:
|
|
163
|
+
pagination: 分頁
|
|
164
|
+
previous:
|
|
155
165
|
password_input:
|
|
156
166
|
button:
|
|
157
167
|
button_aria_hide_label:
|
|
@@ -161,10 +171,6 @@ zh-tw:
|
|
|
161
171
|
label:
|
|
162
172
|
password_hidden_announcement:
|
|
163
173
|
password_shown_announcement:
|
|
164
|
-
pagination:
|
|
165
|
-
next:
|
|
166
|
-
pagination: 分頁
|
|
167
|
-
previous:
|
|
168
174
|
print_link:
|
|
169
175
|
text: 列印此頁面
|
|
170
176
|
published_dates:
|
data/config/locales/zh.yml
CHANGED
|
@@ -13,6 +13,12 @@ zh:
|
|
|
13
13
|
hide_all: 隐藏所有小节
|
|
14
14
|
show_all: 显示所有小节
|
|
15
15
|
this_section_visually_hidden: " 本小节"
|
|
16
|
+
app_promo_banner:
|
|
17
|
+
aria_label:
|
|
18
|
+
body_text:
|
|
19
|
+
close:
|
|
20
|
+
title_text:
|
|
21
|
+
view:
|
|
16
22
|
article_schema:
|
|
17
23
|
scoped_search_description: 在 %{title} 内搜索
|
|
18
24
|
attachment:
|
|
@@ -152,6 +158,10 @@ zh:
|
|
|
152
158
|
selected:
|
|
153
159
|
organisation_schema:
|
|
154
160
|
all_content_search_description: 查找 %{organisation} 的全部内容
|
|
161
|
+
pagination:
|
|
162
|
+
next:
|
|
163
|
+
pagination: 分页
|
|
164
|
+
previous:
|
|
155
165
|
password_input:
|
|
156
166
|
button:
|
|
157
167
|
button_aria_hide_label:
|
|
@@ -161,10 +171,6 @@ zh:
|
|
|
161
171
|
label:
|
|
162
172
|
password_hidden_announcement:
|
|
163
173
|
password_shown_announcement:
|
|
164
|
-
pagination:
|
|
165
|
-
next:
|
|
166
|
-
pagination: 分页
|
|
167
|
-
previous:
|
|
168
174
|
print_link:
|
|
169
175
|
text: 打印本页面
|
|
170
176
|
published_dates:
|
|
@@ -4,40 +4,44 @@ module GovukPublishingComponents
|
|
|
4
4
|
include ActionView::Helpers
|
|
5
5
|
include ActionView::Context
|
|
6
6
|
|
|
7
|
-
attr_reader :name, :url, :crest, :image, :logo_image_src, :logo_image_alt, :hide_underline
|
|
8
|
-
|
|
9
7
|
def initialize(local_assigns)
|
|
8
|
+
raise(ArgumentError, "Component requires an organisation including a name") unless minimum_for_component?(local_assigns)
|
|
9
|
+
|
|
10
10
|
@name = local_assigns[:organisation][:name]
|
|
11
11
|
@url = local_assigns[:organisation][:url]
|
|
12
12
|
@crest = local_assigns[:organisation][:crest]
|
|
13
13
|
@image = local_assigns[:organisation][:image] || false
|
|
14
14
|
if @image
|
|
15
|
-
@logo_image_src = local_assigns[:organisation][:image][:url] ||
|
|
16
|
-
@logo_image_alt = local_assigns[:organisation][:image][:alt_text] ||
|
|
15
|
+
@logo_image_src = local_assigns[:organisation][:image][:url] || nil
|
|
16
|
+
@logo_image_alt = local_assigns[:organisation][:image][:alt_text] || nil
|
|
17
17
|
end
|
|
18
18
|
@hide_underline = local_assigns[:hide_underline] || false
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def logo_content
|
|
22
|
-
if image
|
|
23
|
-
image_tag(logo_image_src, alt: logo_image_alt, class: "gem-c-organisation-logo__image")
|
|
22
|
+
if @image
|
|
23
|
+
image_tag(@logo_image_src, alt: @logo_image_alt, class: "gem-c-organisation-logo__image")
|
|
24
24
|
else
|
|
25
|
-
content_tag("span", name, class: "gem-c-organisation-logo__name")
|
|
25
|
+
content_tag("span", @name, class: "gem-c-organisation-logo__name")
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def logo_container_class
|
|
30
|
-
logo_class =
|
|
31
|
-
logo_class
|
|
32
|
-
logo_class
|
|
33
|
-
logo_class
|
|
34
|
-
logo_class
|
|
30
|
+
logo_class = %w[gem-c-organisation-logo__container]
|
|
31
|
+
logo_class << "gem-c-organisation-logo__link" if @url
|
|
32
|
+
logo_class << "gem-c-organisation-logo__link-hide-underline" if @hide_underline
|
|
33
|
+
logo_class << "gem-c-organisation-logo__crest gem-c-organisation-logo__crest--#{@crest}" if crest_has_visual_identity?
|
|
34
|
+
logo_class.join(" ")
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
private
|
|
38
38
|
|
|
39
|
+
def minimum_for_component?(options)
|
|
40
|
+
true unless !options[:organisation] || options[:organisation] && !options[:organisation][:name]
|
|
41
|
+
end
|
|
42
|
+
|
|
39
43
|
def crest_has_visual_identity?
|
|
40
|
-
crest.present? && !%w[no-identity custom].include?(crest)
|
|
44
|
+
@crest.present? && !%w[no-identity custom].include?(@crest)
|
|
41
45
|
end
|
|
42
46
|
end
|
|
43
47
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_publishing_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 63.
|
|
4
|
+
version: 63.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
@@ -413,6 +413,7 @@ files:
|
|
|
413
413
|
- app/assets/config/govuk_publishing_components_manifest.js
|
|
414
414
|
- app/assets/images/govuk_publishing_components/action-link-arrow--light.svg
|
|
415
415
|
- app/assets/images/govuk_publishing_components/action-link-arrow--simple.svg
|
|
416
|
+
- app/assets/images/govuk_publishing_components/app-promo-banner/govuk-app-icon.png
|
|
416
417
|
- app/assets/images/govuk_publishing_components/crests/bis_crest_18px_x2.png
|
|
417
418
|
- app/assets/images/govuk_publishing_components/crests/coastguard_18px_x2.png
|
|
418
419
|
- app/assets/images/govuk_publishing_components/crests/dbt_crest_18px_x2.png
|
|
@@ -485,6 +486,7 @@ files:
|
|
|
485
486
|
- app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js
|
|
486
487
|
- app/assets/javascripts/govuk_publishing_components/components/accordion.js
|
|
487
488
|
- app/assets/javascripts/govuk_publishing_components/components/add-another.js
|
|
489
|
+
- app/assets/javascripts/govuk_publishing_components/components/app-promo-banner.js
|
|
488
490
|
- app/assets/javascripts/govuk_publishing_components/components/button.js
|
|
489
491
|
- app/assets/javascripts/govuk_publishing_components/components/character-count.js
|
|
490
492
|
- app/assets/javascripts/govuk_publishing_components/components/checkboxes.js
|
|
@@ -545,6 +547,7 @@ files:
|
|
|
545
547
|
- app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss
|
|
546
548
|
- app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss
|
|
547
549
|
- app/assets/stylesheets/govuk_publishing_components/components/_add-another.scss
|
|
550
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss
|
|
548
551
|
- app/assets/stylesheets/govuk_publishing_components/components/_attachment-link.scss
|
|
549
552
|
- app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss
|
|
550
553
|
- app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss
|
|
@@ -694,6 +697,7 @@ files:
|
|
|
694
697
|
- app/views/govuk_publishing_components/components/_accordion.html.erb
|
|
695
698
|
- app/views/govuk_publishing_components/components/_action_link.html.erb
|
|
696
699
|
- app/views/govuk_publishing_components/components/_add_another.html.erb
|
|
700
|
+
- app/views/govuk_publishing_components/components/_app_promo_banner.html.erb
|
|
697
701
|
- app/views/govuk_publishing_components/components/_attachment.html.erb
|
|
698
702
|
- app/views/govuk_publishing_components/components/_attachment_link.html.erb
|
|
699
703
|
- app/views/govuk_publishing_components/components/_back_link.html.erb
|
|
@@ -796,6 +800,7 @@ files:
|
|
|
796
800
|
- app/views/govuk_publishing_components/components/docs/accordion.yml
|
|
797
801
|
- app/views/govuk_publishing_components/components/docs/action_link.yml
|
|
798
802
|
- app/views/govuk_publishing_components/components/docs/add_another.yml
|
|
803
|
+
- app/views/govuk_publishing_components/components/docs/app_promo_banner.yml
|
|
799
804
|
- app/views/govuk_publishing_components/components/docs/attachment.yml
|
|
800
805
|
- app/views/govuk_publishing_components/components/docs/attachment_link.yml
|
|
801
806
|
- app/views/govuk_publishing_components/components/docs/back_link.yml
|
|
@@ -2118,7 +2123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
2118
2123
|
- !ruby/object:Gem::Version
|
|
2119
2124
|
version: '0'
|
|
2120
2125
|
requirements: []
|
|
2121
|
-
rubygems_version: 4.0.
|
|
2126
|
+
rubygems_version: 4.0.4
|
|
2122
2127
|
specification_version: 4
|
|
2123
2128
|
summary: A gem to document components in GOV.UK frontend applications
|
|
2124
2129
|
test_files: []
|