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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 165109e571c6ba5445e74e15f2be52f24c787509790ad41a4ea88664e9efdb65
|
|
4
|
+
data.tar.gz: be9e4eafdc824e8cc3ae4e3ad5829f33a85a4df2e6ad3ac86a0c89fd52a2a084
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4b8872ec44bbe165d2962f38157b1919f3c6433e13c14a714738bfe001b46cab9ea75d0a6d4e7f8c4fd42f98e8e2a4a3c174ff39e6f8dc1fcdcd2d987613eca
|
|
7
|
+
data.tar.gz: 2a6335737c699d6a6c5d397a1149e1e8f30e02dae6ba84f11f49edb41bc69743f26b98d22cde3e227447f4dafc00ac90e754384d307a9041586730fcbf720d9c
|
|
Binary file
|
|
@@ -59,6 +59,7 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
|
|
|
59
59
|
emergency_banner: document.querySelector('[data-ga4-emergency-banner]') ? 'true' : undefined,
|
|
60
60
|
phase_banner: this.getElementAttribute('data-ga4-phase-banner') || undefined,
|
|
61
61
|
devolved_nations_banner: this.getElementAttribute('data-ga4-devolved-nations-banner') || undefined,
|
|
62
|
+
app_promo_banner: this.getBannerPresence('[data-ga4-app-promo-banner]'),
|
|
62
63
|
cookie_banner: this.getBannerPresence('[data-ga4-cookie-banner]'),
|
|
63
64
|
intervention: this.getBannerPresence('[data-ga4-intervention-banner]'),
|
|
64
65
|
global_bar: this.getBannerPresence('[data-ga4-global-banner]'),
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
window.GOVUK = window.GOVUK || {}
|
|
2
|
+
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
3
|
+
|
|
4
|
+
(function (Modules) {
|
|
5
|
+
class AppPromoBanner {
|
|
6
|
+
constructor ($module) {
|
|
7
|
+
this.$module = $module
|
|
8
|
+
/** @type {HTMLButtonElement | null} */
|
|
9
|
+
this.$closeButton = this.$module.querySelector('.js-close-app-promo-banner')
|
|
10
|
+
this.APP_PROMO_BANNER_COOKIE = 'app_promo_banner'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialise the app promo banner
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
init () {
|
|
18
|
+
// Only display the banner on Android devices
|
|
19
|
+
if (!this.isAndroidDevice()) return
|
|
20
|
+
|
|
21
|
+
// Do not display the app promo banner if the cookie banner is visible
|
|
22
|
+
if (this.isCookieBannerVisible()) return
|
|
23
|
+
|
|
24
|
+
// Do not display the banner if it was previously closed
|
|
25
|
+
const cookieContents = this.getAppPromoBannerCookieContent()
|
|
26
|
+
if (cookieContents && cookieContents.closed === true) return
|
|
27
|
+
|
|
28
|
+
// Do not display the banner if the close button is not found
|
|
29
|
+
if (!this.$closeButton) return
|
|
30
|
+
|
|
31
|
+
this.$closeButton.addEventListener('click', (event) => this.handleClick(event))
|
|
32
|
+
this.showBanner()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the current device is an Android device
|
|
37
|
+
*
|
|
38
|
+
* @returns Boolean
|
|
39
|
+
*/
|
|
40
|
+
isAndroidDevice () {
|
|
41
|
+
return (/Android/i.test(navigator.userAgent))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Checks if the user has accepted cookies and the cookie
|
|
46
|
+
* category the app promo banner is in
|
|
47
|
+
*
|
|
48
|
+
* @returns Boolean
|
|
49
|
+
*/
|
|
50
|
+
isCookiesAndCategoryPermitted () {
|
|
51
|
+
const cookieConsent = window.GOVUK.getConsentCookie()
|
|
52
|
+
const cookieCategory = window.GOVUK.getCookieCategory(this.APP_PROMO_BANNER_COOKIE)
|
|
53
|
+
return (cookieConsent && cookieConsent[cookieCategory])
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the cookie banner is visible
|
|
58
|
+
*
|
|
59
|
+
* @returns Boolean - Cookie banner visible
|
|
60
|
+
*/
|
|
61
|
+
isCookieBannerVisible () {
|
|
62
|
+
/** @type {HTMLDivElement | null} */
|
|
63
|
+
const cookieBanner = document.querySelector('#global-cookie-message')
|
|
64
|
+
return cookieBanner && !cookieBanner.hidden
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Sets the cookie for the app promo banner, including if the
|
|
69
|
+
* the banner should be in the closed state
|
|
70
|
+
*
|
|
71
|
+
* @param {Boolean} isAppBannerClosed
|
|
72
|
+
*/
|
|
73
|
+
setAppBannerCookie (isAppBannerClosed) {
|
|
74
|
+
// Do not set the cookie if cookies and category are not permitted
|
|
75
|
+
if (!this.isCookiesAndCategoryPermitted) return
|
|
76
|
+
|
|
77
|
+
/** @type {AppBannerCookie} */
|
|
78
|
+
const appBannerCookie = { closed: isAppBannerClosed }
|
|
79
|
+
|
|
80
|
+
// This approach will simply set/overwrite the cookie with new values
|
|
81
|
+
const appBannerCookieValue = JSON.stringify(appBannerCookie)
|
|
82
|
+
window.GOVUK.setCookie(this.APP_PROMO_BANNER_COOKIE, appBannerCookieValue, { days: 84 })
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Return the user's cookie settings for the app promo banner,
|
|
87
|
+
* or null if the cookie is not present
|
|
88
|
+
*
|
|
89
|
+
* @returns {AppBannerCookie | null} App promo banner settings
|
|
90
|
+
*/
|
|
91
|
+
getAppPromoBannerCookieContent () {
|
|
92
|
+
const appBannerCookie = window.GOVUK.getCookie(this.APP_PROMO_BANNER_COOKIE)
|
|
93
|
+
return appBannerCookie ? JSON.parse(appBannerCookie) : null
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Handle the click of the close banner button
|
|
98
|
+
*
|
|
99
|
+
* @param {MouseEvent} event - Click event
|
|
100
|
+
*/
|
|
101
|
+
handleClick (event) {
|
|
102
|
+
event.preventDefault()
|
|
103
|
+
this.hideBanner()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Shows the app promo banner
|
|
108
|
+
*
|
|
109
|
+
*/
|
|
110
|
+
showBanner () {
|
|
111
|
+
this.$module.hidden = false
|
|
112
|
+
this.$module.classList.add('gem-c-app-promo-banner--visible')
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Hides the app promo banner and sets a cookie to store
|
|
117
|
+
* the closed state as true
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
hideBanner () {
|
|
121
|
+
this.setAppBannerCookie(true)
|
|
122
|
+
this.$module.hidden = true
|
|
123
|
+
this.$module.classList.remove('gem-c-app-promo-banner--visible')
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
Modules.AppPromoBanner = AppPromoBanner
|
|
128
|
+
})(window.GOVUK.Modules)
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @typedef {object} AppBannerCookie
|
|
132
|
+
* @property {boolean} [closed] - Banner closed state
|
|
133
|
+
* @property {number} [version] - Banner version number
|
|
134
|
+
*/
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
licensing_session: 'essential',
|
|
22
22
|
govuk_contact_referrer: 'essential',
|
|
23
23
|
multivariatetest_cohort_coronavirus_extremely_vulnerable_rate_limit: 'essential',
|
|
24
|
+
app_promo_banner: 'settings',
|
|
24
25
|
dgu_beta_banner_dismissed: 'settings',
|
|
25
26
|
global_banner_seen: 'settings',
|
|
26
27
|
user_nation: 'settings',
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
@import "components/accordion";
|
|
12
12
|
@import "components/action-link";
|
|
13
13
|
@import "components/add-another";
|
|
14
|
+
@import "components/app-promo-banner";
|
|
14
15
|
@import "components/attachment";
|
|
15
16
|
@import "components/attachment-link";
|
|
16
17
|
@import "components/back-link";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@import "govuk_publishing_components/individual_component_support";
|
|
2
|
+
|
|
3
|
+
.gem-c-app-promo-banner {
|
|
4
|
+
display: none;
|
|
5
|
+
padding: govuk-spacing(5) 0;
|
|
6
|
+
border-top: 4px solid $govuk-brand-colour;
|
|
7
|
+
background-color: $govuk-rebrand-template-background-colour;
|
|
8
|
+
@include govuk-text-colour;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.gem-c-app-promo-banner--visible {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.gem-c-app-promo-banner__container {
|
|
16
|
+
display: flex;
|
|
17
|
+
gap: govuk-spacing(3);
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.gem-c-app-promo-banner__icon {
|
|
22
|
+
flex: 0 1 64px;
|
|
23
|
+
min-width: 60px;
|
|
24
|
+
height: auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.gem-c-app-promo-banner__content {
|
|
28
|
+
flex: 1 1 auto;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
row-gap: govuk-spacing(1);
|
|
34
|
+
column-gap: govuk-spacing(3);
|
|
35
|
+
|
|
36
|
+
// Ensures the view link appears beneath the text content
|
|
37
|
+
// on larger screen sizes
|
|
38
|
+
@include govuk-media-query($from: tablet) {
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
align-items: start;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.gem-c-app-promo-banner__text {
|
|
45
|
+
text-wrap-style: balance;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.gem-c-app-promo-banner__close-button {
|
|
49
|
+
border: 0;
|
|
50
|
+
padding: 0;
|
|
51
|
+
color: govuk-tint(govuk-colour("black"), 25%);
|
|
52
|
+
background: none;
|
|
53
|
+
flex: 0 0 24px;
|
|
54
|
+
height: 24px;
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
box-shadow: 0 4px govuk-colour("black");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:focus {
|
|
62
|
+
@include govuk-focused-text;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<%
|
|
2
|
+
add_gem_component_stylesheet("app_promo_banner")
|
|
3
|
+
|
|
4
|
+
disable_ga4 ||= false
|
|
5
|
+
|
|
6
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
|
7
|
+
component_helper.add_class("gem-c-app-promo-banner")
|
|
8
|
+
component_helper.add_role("region")
|
|
9
|
+
component_helper.add_aria_attribute({ label: t("components.app_promo_banner.aria_label")})
|
|
10
|
+
component_helper.set_hidden("hidden")
|
|
11
|
+
component_helper.add_data_attribute({ module: "app-promo-banner", nosnippet: "" })
|
|
12
|
+
component_helper.add_data_attribute({ ga4_app_promo_banner: "" }) unless disable_ga4 # Added to the parent element for the GA4 pageview object to use
|
|
13
|
+
|
|
14
|
+
ga4_event_attributes = {
|
|
15
|
+
event_name: "select_content",
|
|
16
|
+
type: "app promo banner",
|
|
17
|
+
action: "closed",
|
|
18
|
+
section: t("components.app_promo_banner.title_text"),
|
|
19
|
+
text: t("components.app_promo_banner.close"),
|
|
20
|
+
}.to_json unless disable_ga4
|
|
21
|
+
|
|
22
|
+
ga4_link_attributes = {
|
|
23
|
+
event_name: "navigation",
|
|
24
|
+
type: "app promo banner",
|
|
25
|
+
index_link: 1,
|
|
26
|
+
index_total: 1,
|
|
27
|
+
}.to_json unless disable_ga4
|
|
28
|
+
%>
|
|
29
|
+
|
|
30
|
+
<%= tag.div(**component_helper.all_attributes) do %>
|
|
31
|
+
<%= tag.div(class: "govuk-width-container") do %>
|
|
32
|
+
<%= tag.div(class: "gem-c-app-promo-banner__container") do %>
|
|
33
|
+
<%= content_tag(:button, {
|
|
34
|
+
class: "gem-c-app-promo-banner__close-button js-close-app-promo-banner",
|
|
35
|
+
aria: {
|
|
36
|
+
label: t("components.app_promo_banner.close"),
|
|
37
|
+
},
|
|
38
|
+
data: {
|
|
39
|
+
module: disable_ga4 ? nil : "ga4-event-tracker",
|
|
40
|
+
ga4_event: ga4_event_attributes,
|
|
41
|
+
},
|
|
42
|
+
}) do %>
|
|
43
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" focusable="false">
|
|
44
|
+
<circle cx="12" cy="12" r="11.5" stroke="currentColor" />
|
|
45
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="m7 7 10 10m0-10L7 17" />
|
|
46
|
+
</svg>
|
|
47
|
+
<% end %>
|
|
48
|
+
<%= image_tag((asset_path "govuk_publishing_components/app-promo-banner/govuk-app-icon.png"),
|
|
49
|
+
alt: "",
|
|
50
|
+
class: "gem-c-app-promo-banner__icon",
|
|
51
|
+
width: "64",
|
|
52
|
+
height: "64",
|
|
53
|
+
) %>
|
|
54
|
+
<%= tag.div(class: "gem-c-app-promo-banner__content") do %>
|
|
55
|
+
<%= tag.div(class: "gem-c-app-promo-banner__text") do %>
|
|
56
|
+
<%= tag.h2 t("components.app_promo_banner.title_text"), class: "govuk-heading-s govuk-!-margin-bottom-0" %>
|
|
57
|
+
<%= tag.p t("components.app_promo_banner.body_text"), class: "govuk-body-s govuk-!-margin-bottom-0" %>
|
|
58
|
+
<% end %>
|
|
59
|
+
<%= link_to("https://play.google.com/store/apps/details?id=uk.gov.govuk&hl=en_GB",
|
|
60
|
+
class: "govuk-link govuk-body govuk-!-margin-bottom-0",
|
|
61
|
+
data: {
|
|
62
|
+
module: disable_ga4 ? nil : "ga4-link-tracker",
|
|
63
|
+
ga4_link: ga4_link_attributes,
|
|
64
|
+
},
|
|
65
|
+
) do %>
|
|
66
|
+
<%= t("components.app_promo_banner.view") %>
|
|
67
|
+
<%= tag.span("on Google Play", class: "govuk-visually-hidden") %>
|
|
68
|
+
<% end %>
|
|
69
|
+
<% end %>
|
|
70
|
+
<% end %>
|
|
71
|
+
<% end %>
|
|
72
|
+
<% end %>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<%
|
|
2
2
|
add_gem_component_stylesheet("layout-for-public")
|
|
3
3
|
|
|
4
|
-
for_static ||= false
|
|
5
4
|
emergency_banner ||= nil
|
|
6
|
-
full_width ||= false
|
|
7
5
|
global_banner ||= nil
|
|
8
6
|
html_lang ||= "en"
|
|
9
7
|
homepage ||= false
|
|
@@ -17,6 +15,7 @@
|
|
|
17
15
|
omit_header ||= false
|
|
18
16
|
product_name ||= nil
|
|
19
17
|
service_name ||= nil
|
|
18
|
+
show_app_promo_banner ||= false
|
|
20
19
|
show_cross_service_header ||= false
|
|
21
20
|
draft_watermark ||= false
|
|
22
21
|
title ||= "GOV.UK - The best place to find government services and information"
|
|
@@ -76,6 +75,9 @@
|
|
|
76
75
|
<%= render "govuk_publishing_components/components/skip_link", {
|
|
77
76
|
href: "#content",
|
|
78
77
|
} %>
|
|
78
|
+
<% if show_app_promo_banner %>
|
|
79
|
+
<%= render "govuk_publishing_components/components/app_promo_banner" %>
|
|
80
|
+
<% end %>
|
|
79
81
|
<% end %>
|
|
80
82
|
<% unless omit_header %>
|
|
81
83
|
<% if show_cross_service_header %>
|
|
@@ -105,18 +107,10 @@
|
|
|
105
107
|
omit_account_phase_banner: omit_account_phase_banner,
|
|
106
108
|
omit_account_navigation: omit_account_navigation,
|
|
107
109
|
account_nav_location: account_nav_location,
|
|
108
|
-
for_static: for_static,
|
|
109
110
|
} do %>
|
|
110
111
|
<%= yield :before_content %>
|
|
111
112
|
<%= yield %>
|
|
112
113
|
<% end %>
|
|
113
|
-
<% elsif for_static %>
|
|
114
|
-
<div id="wrapper" class="<%= "govuk-width-container" unless full_width %>">
|
|
115
|
-
<%= yield :before_content %>
|
|
116
|
-
<main class="govuk-main-wrapper" id="content">
|
|
117
|
-
<%= yield %>
|
|
118
|
-
</main>
|
|
119
|
-
</div>
|
|
120
114
|
<% else %>
|
|
121
115
|
<%= yield %>
|
|
122
116
|
<% end %>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: App Promo Banner
|
|
2
|
+
description: Displays a banner on Android devices to promote the GOVUK Android App
|
|
3
|
+
body: |
|
|
4
|
+
By default the app promo banner is hidden. The banner is only displayed if JavaScript is enabled and if the device is Android.
|
|
5
|
+
|
|
6
|
+
If the user has provided permission to use the settings cookie in their cookie preferences, then `app_promo_banner` cookie is set which is used to stop the banner reappearing once it has been closed.
|
|
7
|
+
|
|
8
|
+
accessibility_criteria: |
|
|
9
|
+
- Adequate colour contrast between text, icons, and background meeting WCAG 2.2 AA as a minimum
|
|
10
|
+
- Text does not overlap, truncate, or disappear when zoomed
|
|
11
|
+
- “Skip to main” link precedes banner in DOM order and tab sequence
|
|
12
|
+
- Close button can be activated with Enter/Space keys
|
|
13
|
+
- Close button has an accessible name
|
|
14
|
+
- View link is descriptive indicating where it goes to
|
|
15
|
+
- Banner is reachable via keyboard navigation
|
|
16
|
+
- Banner placement does not obscure other critical content or controls
|
|
17
|
+
- Banner can be dismissed without requiring precise pointer actions
|
|
18
|
+
- Banner content is understandable out of context
|
|
19
|
+
- No keyboard trap: focus moves smoothly past the banner once dismissed
|
|
20
|
+
shared_accessibility_criteria:
|
|
21
|
+
- link
|
|
22
|
+
uses_component_wrapper_helper: true
|
|
23
|
+
examples:
|
|
24
|
+
default:
|
|
25
|
+
data:
|
|
26
|
+
without_ga4_tracking:
|
|
27
|
+
description: |
|
|
28
|
+
Disables GA4 tracking on the app promo banner. Tracking is enabled by default. This adds a data module and data-attributes with JSONs to the accordion. See the [ga4-event-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-event-tracker.md) for more information.
|
|
29
|
+
data:
|
|
30
|
+
disable_ga4: true
|
|
@@ -18,22 +18,6 @@ examples:
|
|
|
18
18
|
title: 'Example layout'
|
|
19
19
|
block: |
|
|
20
20
|
<h1>Page content goes here</h1>
|
|
21
|
-
with_static_wrapper:
|
|
22
|
-
description: |
|
|
23
|
-
By default, the layout does not include the `div#wrapper` element, nor the `main` element within that.
|
|
24
|
-
This behaviour is peculiar to the one app that currently uses this layout - static. Static now sets the `for_static: true` flag,
|
|
25
|
-
which causes the wrapper to be included. Other apps in the future will not set that flag, but provide their own wrapper and main elements.
|
|
26
|
-
data:
|
|
27
|
-
for_static: true
|
|
28
|
-
block: |
|
|
29
|
-
<h1>Page content goes here</h1>
|
|
30
|
-
full_width:
|
|
31
|
-
description: By default, the layout applies the `govuk-width-container` class to the main element. We can remove this class by setting `full_width` to `true`. Note this also requires the for_static flag, since that is needed for the main element.
|
|
32
|
-
data:
|
|
33
|
-
for_static: true
|
|
34
|
-
full_width: true
|
|
35
|
-
block: |
|
|
36
|
-
<h1>Page content goes here</h1>
|
|
37
21
|
omit_header:
|
|
38
22
|
description: This allows the header to be omitted which is currently used when rendering CSV previews from Whitehall
|
|
39
23
|
data:
|
|
@@ -18,6 +18,10 @@ shared_accessibility_criteria:
|
|
|
18
18
|
- link
|
|
19
19
|
examples:
|
|
20
20
|
default:
|
|
21
|
+
data:
|
|
22
|
+
organisation:
|
|
23
|
+
name: 'Organisation<br>Name'
|
|
24
|
+
with_a_link:
|
|
21
25
|
data:
|
|
22
26
|
organisation:
|
|
23
27
|
name: 'Organisation<br>Name'
|
|
@@ -158,12 +162,6 @@ examples:
|
|
|
158
162
|
image:
|
|
159
163
|
url: 'https://assets.publishing.service.gov.uk/media/6850134301d3b0e7b62da740/hmps_25_gov_240x188.png'
|
|
160
164
|
alt_text: 'HM Prison Service'
|
|
161
|
-
without_a_link:
|
|
162
|
-
data:
|
|
163
|
-
organisation:
|
|
164
|
-
name: Cabinet Office
|
|
165
|
-
brand: cabinet-office
|
|
166
|
-
crest: 'single-identity'
|
|
167
165
|
as_a_heading:
|
|
168
166
|
description: The `heading_level` option takes a number from 1 to 6.
|
|
169
167
|
data:
|
data/app/views/govuk_publishing_components/components/layout_for_public/_account-layout.html.erb
CHANGED
|
@@ -12,13 +12,7 @@
|
|
|
12
12
|
<div class="govuk-grid-column-two-thirds">
|
|
13
13
|
<div id="wrapper">
|
|
14
14
|
<%= yield :before_content %>
|
|
15
|
-
|
|
16
|
-
<main id="content">
|
|
17
|
-
<%= yield %>
|
|
18
|
-
</main>
|
|
19
|
-
<% else %>
|
|
20
|
-
<%= yield %>
|
|
21
|
-
<% end %>
|
|
15
|
+
<%= yield %>
|
|
22
16
|
</div>
|
|
23
17
|
</div>
|
|
24
18
|
</div>
|
data/config/locales/ar.yml
CHANGED
|
@@ -13,6 +13,12 @@ ar:
|
|
|
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:
|
|
@@ -157,6 +163,10 @@ ar:
|
|
|
157
163
|
selected:
|
|
158
164
|
organisation_schema:
|
|
159
165
|
all_content_search_description: العثور عن كل المحتوى من %{organisation}
|
|
166
|
+
pagination:
|
|
167
|
+
next:
|
|
168
|
+
pagination: ترقيم الصفحات
|
|
169
|
+
previous:
|
|
160
170
|
password_input:
|
|
161
171
|
button:
|
|
162
172
|
button_aria_hide_label:
|
|
@@ -166,10 +176,6 @@ ar:
|
|
|
166
176
|
label:
|
|
167
177
|
password_hidden_announcement:
|
|
168
178
|
password_shown_announcement:
|
|
169
|
-
pagination:
|
|
170
|
-
next:
|
|
171
|
-
pagination: ترقيم الصفحات
|
|
172
|
-
previous:
|
|
173
179
|
print_link:
|
|
174
180
|
text: طباعة هذه الصفحة
|
|
175
181
|
published_dates:
|
data/config/locales/az.yml
CHANGED
|
@@ -13,6 +13,12 @@ az:
|
|
|
13
13
|
hide_all: Bütün bölmələri gizlət
|
|
14
14
|
show_all: Bütün bölmələri göstər
|
|
15
15
|
this_section_visually_hidden: " bu bölmə"
|
|
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} üzrə axtar"
|
|
18
24
|
attachment:
|
|
@@ -154,6 +160,10 @@ az:
|
|
|
154
160
|
selected:
|
|
155
161
|
organisation_schema:
|
|
156
162
|
all_content_search_description: "%{organisation}-dan bütün məzmunu tap"
|
|
163
|
+
pagination:
|
|
164
|
+
next:
|
|
165
|
+
pagination: Səhifələrə bölmə
|
|
166
|
+
previous:
|
|
157
167
|
password_input:
|
|
158
168
|
button:
|
|
159
169
|
button_aria_hide_label:
|
|
@@ -163,10 +173,6 @@ az:
|
|
|
163
173
|
label:
|
|
164
174
|
password_hidden_announcement:
|
|
165
175
|
password_shown_announcement:
|
|
166
|
-
pagination:
|
|
167
|
-
next:
|
|
168
|
-
pagination: Səhifələrə bölmə
|
|
169
|
-
previous:
|
|
170
176
|
print_link:
|
|
171
177
|
text: Bu səhifəni çap et
|
|
172
178
|
published_dates:
|
data/config/locales/be.yml
CHANGED
|
@@ -13,6 +13,12 @@ be:
|
|
|
13
13
|
hide_all: Схаваць усе секцыi
|
|
14
14
|
show_all: Паказаць усе секцыi
|
|
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:
|
|
@@ -160,6 +166,10 @@ be:
|
|
|
160
166
|
selected:
|
|
161
167
|
organisation_schema:
|
|
162
168
|
all_content_search_description: Шукаць увесь змест з %{organisation}
|
|
169
|
+
pagination:
|
|
170
|
+
next:
|
|
171
|
+
pagination: Месцаванне старонак
|
|
172
|
+
previous:
|
|
163
173
|
password_input:
|
|
164
174
|
button:
|
|
165
175
|
button_aria_hide_label:
|
|
@@ -169,10 +179,6 @@ be:
|
|
|
169
179
|
label:
|
|
170
180
|
password_hidden_announcement:
|
|
171
181
|
password_shown_announcement:
|
|
172
|
-
pagination:
|
|
173
|
-
next:
|
|
174
|
-
pagination: Месцаванне старонак
|
|
175
|
-
previous:
|
|
176
182
|
print_link:
|
|
177
183
|
text: Надрукаваць гэтую странiцу
|
|
178
184
|
published_dates:
|
data/config/locales/bg.yml
CHANGED
|
@@ -13,6 +13,12 @@ bg:
|
|
|
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:
|
|
@@ -158,6 +164,10 @@ bg:
|
|
|
158
164
|
selected:
|
|
159
165
|
organisation_schema:
|
|
160
166
|
all_content_search_description: Намиране на цялото съдържание от %{organisation}
|
|
167
|
+
pagination:
|
|
168
|
+
next:
|
|
169
|
+
pagination: Страниране
|
|
170
|
+
previous:
|
|
161
171
|
password_input:
|
|
162
172
|
button:
|
|
163
173
|
button_aria_hide_label:
|
|
@@ -167,10 +177,6 @@ bg:
|
|
|
167
177
|
label:
|
|
168
178
|
password_hidden_announcement:
|
|
169
179
|
password_shown_announcement:
|
|
170
|
-
pagination:
|
|
171
|
-
next:
|
|
172
|
-
pagination: Страниране
|
|
173
|
-
previous:
|
|
174
180
|
print_link:
|
|
175
181
|
text: Отпечатване на страницата
|
|
176
182
|
published_dates:
|
data/config/locales/bn.yml
CHANGED
|
@@ -13,6 +13,12 @@ bn:
|
|
|
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:
|
|
@@ -155,6 +161,10 @@ bn:
|
|
|
155
161
|
selected:
|
|
156
162
|
organisation_schema:
|
|
157
163
|
all_content_search_description: "%{organisation}-এর সকল বিষয়বস্তু খুঁজে বের করুন"
|
|
164
|
+
pagination:
|
|
165
|
+
next:
|
|
166
|
+
pagination: পেজিনেশন
|
|
167
|
+
previous:
|
|
158
168
|
password_input:
|
|
159
169
|
button:
|
|
160
170
|
button_aria_hide_label:
|
|
@@ -164,10 +174,6 @@ bn:
|
|
|
164
174
|
label:
|
|
165
175
|
password_hidden_announcement:
|
|
166
176
|
password_shown_announcement:
|
|
167
|
-
pagination:
|
|
168
|
-
next:
|
|
169
|
-
pagination: পেজিনেশন
|
|
170
|
-
previous:
|
|
171
177
|
print_link:
|
|
172
178
|
text: এই পৃষ্ঠাটি প্রিন্ট করুন
|
|
173
179
|
published_dates:
|
data/config/locales/cs.yml
CHANGED
|
@@ -13,6 +13,12 @@ cs:
|
|
|
13
13
|
hide_all: Skrýt všechny sekce
|
|
14
14
|
show_all: Zobrazit všechny sekce
|
|
15
15
|
this_section_visually_hidden: " tento oddíl"
|
|
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: Hledat v %{title}
|
|
18
24
|
attachment:
|
|
@@ -159,6 +165,10 @@ cs:
|
|
|
159
165
|
selected:
|
|
160
166
|
organisation_schema:
|
|
161
167
|
all_content_search_description: Najít veškerý obsah z %{organisation}
|
|
168
|
+
pagination:
|
|
169
|
+
next:
|
|
170
|
+
pagination: Stránkování
|
|
171
|
+
previous:
|
|
162
172
|
password_input:
|
|
163
173
|
button:
|
|
164
174
|
button_aria_hide_label:
|
|
@@ -168,10 +178,6 @@ cs:
|
|
|
168
178
|
label:
|
|
169
179
|
password_hidden_announcement:
|
|
170
180
|
password_shown_announcement:
|
|
171
|
-
pagination:
|
|
172
|
-
next:
|
|
173
|
-
pagination: Stránkování
|
|
174
|
-
previous:
|
|
175
181
|
print_link:
|
|
176
182
|
text: Vytisknout tuto stránku
|
|
177
183
|
published_dates:
|