govuk_publishing_components 34.1.3 → 34.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/icon-search.svg +3 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +15 -19
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +26 -9
- data/app/controllers/govuk_publishing_components/application_controller.rb +0 -13
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_error_message.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_hint.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_input.html.erb +8 -2
- data/app/views/govuk_publishing_components/components/_label.html.erb +4 -3
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +10 -2
- data/app/views/govuk_publishing_components/components/docs/error_message.yml +13 -0
- data/app/views/govuk_publishing_components/components/docs/hint.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/input.yml +32 -0
- data/app/views/govuk_publishing_components/components/docs/label.yml +11 -0
- data/app/views/govuk_publishing_components/components/docs/textarea.yml +31 -0
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +4 -2
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +4 -4
- data/app/views/layouts/govuk_publishing_components/application.html.erb +2 -2
- data/config/locales/ar.yml +4 -4
- data/config/locales/az.yml +4 -4
- data/config/locales/be.yml +4 -4
- data/config/locales/bg.yml +4 -4
- data/config/locales/bn.yml +4 -4
- data/config/locales/cs.yml +4 -4
- data/config/locales/cy.yml +4 -4
- data/config/locales/da.yml +4 -4
- data/config/locales/de.yml +4 -4
- data/config/locales/dr.yml +4 -4
- data/config/locales/el.yml +4 -4
- data/config/locales/en.yml +6 -6
- data/config/locales/es-419.yml +4 -4
- data/config/locales/es.yml +4 -4
- data/config/locales/et.yml +4 -4
- data/config/locales/fa.yml +4 -4
- data/config/locales/fi.yml +4 -4
- data/config/locales/fr.yml +4 -4
- data/config/locales/gd.yml +4 -4
- data/config/locales/gu.yml +4 -4
- data/config/locales/he.yml +4 -4
- data/config/locales/hi.yml +4 -4
- data/config/locales/hr.yml +4 -4
- data/config/locales/hu.yml +4 -4
- data/config/locales/hy.yml +4 -4
- data/config/locales/id.yml +4 -4
- data/config/locales/is.yml +4 -4
- data/config/locales/it.yml +4 -4
- data/config/locales/ja.yml +4 -4
- data/config/locales/ka.yml +4 -4
- data/config/locales/kk.yml +4 -4
- data/config/locales/ko.yml +4 -4
- data/config/locales/lt.yml +4 -4
- data/config/locales/lv.yml +4 -4
- data/config/locales/ms.yml +4 -4
- data/config/locales/mt.yml +4 -4
- data/config/locales/nl.yml +4 -4
- data/config/locales/no.yml +4 -4
- data/config/locales/pa-pk.yml +4 -4
- data/config/locales/pa.yml +4 -4
- data/config/locales/pl.yml +4 -4
- data/config/locales/ps.yml +4 -4
- data/config/locales/pt.yml +4 -4
- data/config/locales/ro.yml +4 -4
- data/config/locales/ru.yml +4 -4
- data/config/locales/si.yml +4 -4
- data/config/locales/sk.yml +4 -4
- data/config/locales/sl.yml +4 -4
- data/config/locales/so.yml +4 -4
- data/config/locales/sq.yml +4 -4
- data/config/locales/sr.yml +4 -4
- data/config/locales/sv.yml +4 -4
- data/config/locales/sw.yml +4 -4
- data/config/locales/ta.yml +4 -4
- data/config/locales/th.yml +4 -4
- data/config/locales/tk.yml +4 -4
- data/config/locales/tr.yml +4 -4
- data/config/locales/uk.yml +4 -4
- data/config/locales/ur.yml +4 -4
- data/config/locales/uz.yml +4 -4
- data/config/locales/vi.yml +4 -4
- data/config/locales/zh-hk.yml +4 -4
- data/config/locales/zh-tw.yml +4 -4
- data/config/locales/zh.yml +4 -4
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/axe.js +7 -8
- data/node_modules/axe-core/axe.min.js +3 -3
- data/node_modules/axe-core/package.json +1 -1
- data/node_modules/axe-core/sri-history.json +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54771399098f08d7e3116e65b9c98eaa7036d1214eebc3e7a5c086083ad4c2c1
|
4
|
+
data.tar.gz: 362003c9ad5faea353aa8a47aa5a1f94dbe8f60074be83176af996fb5583f58d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c735097c6bd48644ddde9390b4484ee4b66c3742883e8fa8b3d3ab98793a937e62f240335c835f052fdc28876bc4e063a8a7311aa0ccc15267ff872a1b1eed8e
|
7
|
+
data.tar.gz: e852b2021cd42f28bde7905896931be1443aaec8bef0ffcee808fcf4836429181f4985a13c3a28920df8b6c424d12c6408964ff72c6213e5e5c96e0c3103211e
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" width="40" height="40">
|
2
|
+
<path d="M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z" fill="currentColor"/>
|
3
|
+
</svg>
|
@@ -95,32 +95,24 @@
|
|
95
95
|
margin-bottom: 0;
|
96
96
|
width: 100%;
|
97
97
|
|
98
|
-
&:hover {
|
99
|
-
// backup style for browsers that don't support rgba
|
100
|
-
background: govuk-colour("mid-grey");
|
101
|
-
background: rgba(govuk-colour("black"), .2);
|
102
|
-
color: govuk-colour("black");
|
103
|
-
}
|
104
|
-
|
105
|
-
&:active:focus:not(:hover) {
|
106
|
-
background: govuk-colour("yellow");
|
107
|
-
}
|
108
98
|
@include govuk-media-query($from: tablet) {
|
109
99
|
@include govuk-font(16);
|
110
100
|
}
|
111
|
-
}
|
112
|
-
|
113
|
-
.gem-c-feedback__email-link,
|
114
|
-
.gem-c-feedback__prompt-link {
|
115
|
-
position: relative;
|
116
101
|
|
102
|
+
&:focus,
|
117
103
|
&:focus:not(:active):not(:hover) {
|
104
|
+
background: govuk-colour("yellow");
|
118
105
|
border-color: govuk-colour("black");
|
106
|
+
box-shadow: 0 5px 0 govuk-colour("black");
|
119
107
|
}
|
120
108
|
|
121
|
-
&:focus,
|
122
109
|
&:active {
|
123
|
-
color:
|
110
|
+
color: govuk-colour("black");
|
111
|
+
}
|
112
|
+
|
113
|
+
&:hover {
|
114
|
+
background: govuk-colour("mid-grey");
|
115
|
+
color: govuk-colour("black");
|
124
116
|
}
|
125
117
|
}
|
126
118
|
|
@@ -231,13 +223,17 @@
|
|
231
223
|
}
|
232
224
|
|
233
225
|
.gem-c-feedback__email-link {
|
234
|
-
display: block;
|
226
|
+
display: inline-block;
|
235
227
|
margin-top: govuk-spacing(4);
|
236
228
|
|
237
229
|
@include govuk-media-query($from: desktop) {
|
238
|
-
display: inline-block;
|
239
230
|
margin-top: govuk-spacing(2);
|
240
231
|
}
|
232
|
+
|
233
|
+
&:focus,
|
234
|
+
&:active {
|
235
|
+
color: $govuk-focus-text-colour;
|
236
|
+
}
|
241
237
|
}
|
242
238
|
|
243
239
|
// static.css on GOV.UK overwrites the component styles using input[type="text"]
|
@@ -10,7 +10,7 @@ $search-icon-size: 40px;
|
|
10
10
|
width: $search-icon-size;
|
11
11
|
height: $search-icon-size;
|
12
12
|
height: govuk-px-to-rem($search-icon-size);
|
13
|
-
background: url("
|
13
|
+
background: image-url("govuk_publishing_components/icon-search.svg") no-repeat -3px center;
|
14
14
|
}
|
15
15
|
|
16
16
|
// this overrides styles from static that break the look of the component
|
@@ -123,7 +123,6 @@
|
|
123
123
|
.gem-c-subscription-links__item--link {
|
124
124
|
padding: govuk-spacing(2) govuk-spacing(2) govuk-spacing(2) 0;
|
125
125
|
border: 1px solid transparent;
|
126
|
-
border-bottom: 1px solid govuk-colour("dark-grey", $legacy: "grey-1");
|
127
126
|
|
128
127
|
&:focus {
|
129
128
|
border-bottom-color: transparent;
|
@@ -3,21 +3,38 @@
|
|
3
3
|
.steps {
|
4
4
|
padding-left: 0;
|
5
5
|
margin-left: 0;
|
6
|
-
overflow: hidden;
|
7
6
|
|
8
7
|
> li {
|
9
|
-
|
10
|
-
background-repeat: no-repeat;
|
11
|
-
list-style-type: decimal;
|
8
|
+
list-style-type: none;
|
12
9
|
margin-left: 0;
|
13
10
|
padding: .75em 0 .75em 2.5em;
|
11
|
+
position: relative;
|
12
|
+
|
13
|
+
// IE doesn't render this correctly with this element as display:block
|
14
|
+
// (it leaves a space for the :before pseudo element) by setting to
|
15
|
+
// display inline block and a width of 100% it works correctly.
|
16
|
+
display: inline-block;
|
17
|
+
width: 100%;
|
18
|
+
box-sizing: border-box;
|
19
|
+
|
20
|
+
&:before {
|
21
|
+
background-color: govuk-colour("black");
|
22
|
+
border-radius: 50%;
|
23
|
+
color: govuk-colour("white");
|
24
|
+
float: left;
|
25
|
+
font-size: 80%;
|
26
|
+
height: 1.75em;
|
27
|
+
left: .3em;
|
28
|
+
line-height: 1.75em;
|
29
|
+
position: absolute;
|
30
|
+
text-align: center;
|
31
|
+
top: .9em;
|
32
|
+
width: 1.75em;
|
33
|
+
}
|
14
34
|
|
15
35
|
@for $i from 1 through 30 {
|
16
|
-
&:nth-child(#{$i}) {
|
17
|
-
|
18
|
-
background-repeat: no-repeat;
|
19
|
-
background-position: .2em .7em;
|
20
|
-
background-size: 1.4em 1.4em;
|
36
|
+
&:nth-child(#{$i}):before {
|
37
|
+
content: "#{$i}";
|
21
38
|
}
|
22
39
|
}
|
23
40
|
}
|
@@ -5,19 +5,6 @@ module GovukPublishingComponents
|
|
5
5
|
before_action :set_x_frame_options_header
|
6
6
|
before_action :set_disable_slimmer_header
|
7
7
|
|
8
|
-
if defined? content_security_policy
|
9
|
-
content_security_policy do |p|
|
10
|
-
# don't do anything if the app doesn't have a content security policy
|
11
|
-
next unless p.directives.any?
|
12
|
-
|
13
|
-
# Unfortunately the axe core script uses a dependency that uses eval
|
14
|
-
# see: https://github.com/dequelabs/axe-core/issues/1175
|
15
|
-
# Thus all components shown by govuk_publishing_components need this
|
16
|
-
# enabled
|
17
|
-
p.script_src(*p.script_src, :unsafe_eval)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
8
|
private
|
22
9
|
|
23
10
|
def set_x_frame_options_header
|
@@ -12,8 +12,8 @@
|
|
12
12
|
accordion_classes << (shared_helper.get_margin_bottom)
|
13
13
|
|
14
14
|
translations = {
|
15
|
-
show_text: "
|
16
|
-
hide_text: "
|
15
|
+
show_text: "common.show",
|
16
|
+
hide_text: "common.hide",
|
17
17
|
show_all_text: "components.accordion.show_all",
|
18
18
|
hide_all_text: "components.accordion.hide_all",
|
19
19
|
this_section_visually_hidden: "components.accordion.this_section_visually_hidden",
|
@@ -4,12 +4,13 @@
|
|
4
4
|
css_classes = %w( gem-c-error-message govuk-error-message )
|
5
5
|
css_classes << classes if classes
|
6
6
|
items ||= []
|
7
|
+
right_to_left ||= false
|
7
8
|
|
8
9
|
if items.any?
|
9
10
|
errors = items.map { |item| capture { item[:text] } }
|
10
11
|
text = raw(errors.join("<br />"))
|
11
12
|
end
|
12
13
|
%>
|
13
|
-
<%= tag.p id: id, class: css_classes do %>
|
14
|
+
<%= tag.p id: id, class: css_classes, dir: right_to_left ? "rtl" : nil do %>
|
14
15
|
<span class="govuk-visually-hidden">Error:</span> <%= text %>
|
15
16
|
<% end %>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
gtm_attributes << "gtm_preview=" + gtm_preview if gtm_preview
|
8
8
|
gtm_attributes = gtm_attributes.join('&')
|
9
9
|
%>
|
10
|
-
|
10
|
+
<%= javascript_tag nonce: true do -%>
|
11
11
|
var doNotTrack = ( navigator.doNotTrack === '1' || navigator.doNotTrack === 'yes' || navigator.msDoNotTrack === '1' || window.doNotTrack === '1' )
|
12
12
|
if (!doNotTrack) {
|
13
13
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
@@ -16,4 +16,4 @@ if (!doNotTrack) {
|
|
16
16
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl+'&<%= raw gtm_attributes %>';f.parentNode.insertBefore(j,f);
|
17
17
|
})(window,document,'script','dataLayer','<%= gtm_id %>');
|
18
18
|
}
|
19
|
-
|
19
|
+
<% end -%>
|
@@ -1,11 +1,12 @@
|
|
1
1
|
<%
|
2
2
|
id ||= "hint-#{SecureRandom.hex(4)}"
|
3
|
+
right_to_left ||= false
|
3
4
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
4
5
|
|
5
6
|
css_classes = %w( gem-c-hint govuk-hint )
|
6
7
|
css_classes << shared_helper.get_margin_bottom
|
7
8
|
%>
|
8
9
|
|
9
|
-
<%= tag.div id: id, class: css_classes do %>
|
10
|
+
<%= tag.div id: id, class: css_classes, dir: right_to_left ? "rtl" : nil do %>
|
10
11
|
<%= text %>
|
11
12
|
<% end %>
|
@@ -31,6 +31,8 @@
|
|
31
31
|
heading_level ||= nil
|
32
32
|
prefix ||= nil
|
33
33
|
suffix ||= nil
|
34
|
+
right_to_left ||= false
|
35
|
+
right_to_left_help = right_to_left_help.nil? ? right_to_left : right_to_left_help
|
34
36
|
|
35
37
|
css_classes = %w(gem-c-input govuk-input)
|
36
38
|
css_classes << "govuk-input--error" if has_error
|
@@ -70,7 +72,8 @@
|
|
70
72
|
<% label_markup = capture do %>
|
71
73
|
<%= render "govuk_publishing_components/components/label", {
|
72
74
|
html_for: id,
|
73
|
-
heading_size: heading_size
|
75
|
+
heading_size: heading_size,
|
76
|
+
right_to_left: right_to_left_help
|
74
77
|
}.merge(label.symbolize_keys) %>
|
75
78
|
<% end %>
|
76
79
|
|
@@ -86,7 +89,8 @@
|
|
86
89
|
<% if hint %>
|
87
90
|
<%= render "govuk_publishing_components/components/hint", {
|
88
91
|
id: hint_id,
|
89
|
-
text: hint
|
92
|
+
text: hint,
|
93
|
+
right_to_left: right_to_left_help
|
90
94
|
} %>
|
91
95
|
<% end %>
|
92
96
|
|
@@ -95,6 +99,7 @@
|
|
95
99
|
id: error_id,
|
96
100
|
text: error_message,
|
97
101
|
items: error_items,
|
102
|
+
right_to_left: right_to_left_help
|
98
103
|
} %>
|
99
104
|
<% end %>
|
100
105
|
|
@@ -107,6 +112,7 @@
|
|
107
112
|
autofocus: autofocus,
|
108
113
|
class: css_classes,
|
109
114
|
data: data,
|
115
|
+
dir: right_to_left ? "rtl" : nil,
|
110
116
|
enterkeyhint: checked_enterkeyhint,
|
111
117
|
id: id,
|
112
118
|
inputmode: inputmode,
|
@@ -7,6 +7,7 @@
|
|
7
7
|
bold ||= false
|
8
8
|
heading_size = false unless shared_helper.valid_heading_size?(heading_size)
|
9
9
|
is_page_heading ||= false
|
10
|
+
right_to_left ||= false
|
10
11
|
|
11
12
|
css_classes = %w[gem-c-label govuk-label]
|
12
13
|
css_classes << "govuk-label--s" if bold
|
@@ -19,14 +20,14 @@
|
|
19
20
|
|
20
21
|
<% if is_page_heading %>
|
21
22
|
<%= tag.h1 text, class: "govuk-label-wrapper" do %>
|
22
|
-
<%= tag.label text, id: id, for: html_for, class: css_classes %>
|
23
|
+
<%= tag.label text, id: id, for: html_for, class: css_classes, dir: right_to_left ? "rtl" : nil %>
|
23
24
|
<% end %>
|
24
25
|
<% else %>
|
25
|
-
<%= tag.label text, id: id, for: html_for, class: css_classes %>
|
26
|
+
<%= tag.label text, id: id, for: html_for, class: css_classes, dir: right_to_left ? "rtl" : nil %>
|
26
27
|
<% end %>
|
27
28
|
|
28
29
|
<% if hint_text.present? %>
|
29
|
-
<%= tag.
|
30
|
+
<%= tag.div id: hint_id, class: hint_text_css_classes, dir: right_to_left ? "rtl" : nil do %>
|
30
31
|
<%= hint_text %>
|
31
32
|
<% end %>
|
32
33
|
<% end %>
|
@@ -14,9 +14,9 @@
|
|
14
14
|
<%= yield :head %>
|
15
15
|
</head>
|
16
16
|
<body class="gem-c-layout-for-admin govuk-template__body">
|
17
|
-
|
17
|
+
<%= javascript_tag nonce: true do -%>
|
18
18
|
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
|
19
|
-
|
19
|
+
<% end -%>
|
20
20
|
<%= yield %>
|
21
21
|
<%= javascript_include_tag "application" %>
|
22
22
|
</body>
|
@@ -81,9 +81,9 @@
|
|
81
81
|
<%= yield :head %>
|
82
82
|
</head>
|
83
83
|
<%= tag.body class: body_css_classes do %>
|
84
|
-
|
84
|
+
<%= javascript_tag nonce: true do -%>
|
85
85
|
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
|
86
|
-
|
86
|
+
<% end -%>
|
87
87
|
<%= render "govuk_publishing_components/components/skip_link", {
|
88
88
|
href: "#content"
|
89
89
|
} %>
|
@@ -36,7 +36,7 @@
|
|
36
36
|
</svg><%= sl_helper.email_signup_link_text %>
|
37
37
|
<% end %>
|
38
38
|
<%= link_to email_link_text, sl_helper.email_signup_link, {
|
39
|
-
class: "govuk-link
|
39
|
+
class: "govuk-link gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
|
40
40
|
data: sl_helper.email_signup_link_data_attributes,
|
41
41
|
lang: email_signup_link_text_locale
|
42
42
|
} %>
|
@@ -17,6 +17,8 @@
|
|
17
17
|
hint_id = "hint-#{SecureRandom.hex(4)}"
|
18
18
|
has_error ||= error_message || error_items.any?
|
19
19
|
error_id = "error-#{SecureRandom.hex(4)}"
|
20
|
+
right_to_left ||= false
|
21
|
+
right_to_left_help = right_to_left_help.nil? ? right_to_left : right_to_left_help
|
20
22
|
|
21
23
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
22
24
|
|
@@ -39,13 +41,17 @@
|
|
39
41
|
|
40
42
|
<%= content_tag :div, class: form_group_css_classes do %>
|
41
43
|
<% if label %>
|
42
|
-
<%= render "govuk_publishing_components/components/label", {
|
44
|
+
<%= render "govuk_publishing_components/components/label", {
|
45
|
+
html_for: id,
|
46
|
+
right_to_left: right_to_left_help
|
47
|
+
}.merge(label.symbolize_keys) %>
|
43
48
|
<% end %>
|
44
49
|
|
45
50
|
<% if hint %>
|
46
51
|
<%= render "govuk_publishing_components/components/hint", {
|
47
52
|
id: hint_id,
|
48
|
-
text: hint
|
53
|
+
text: hint,
|
54
|
+
right_to_left: right_to_left_help
|
49
55
|
} %>
|
50
56
|
<% end %>
|
51
57
|
|
@@ -54,11 +60,13 @@
|
|
54
60
|
id: error_id,
|
55
61
|
text: error_message,
|
56
62
|
items: error_items,
|
63
|
+
right_to_left: right_to_left_help
|
57
64
|
} %>
|
58
65
|
<% end %>
|
59
66
|
|
60
67
|
<%= tag.textarea name: name,
|
61
68
|
class: css_classes,
|
69
|
+
dir: right_to_left ? "rtl" : nil,
|
62
70
|
id: id,
|
63
71
|
rows: rows,
|
64
72
|
maxlength: maxlength,
|
@@ -21,3 +21,16 @@ examples:
|
|
21
21
|
items:
|
22
22
|
- text: Error 1
|
23
23
|
- text: Error 2
|
24
|
+
with_dir_attribute:
|
25
|
+
description: Allows the correct display of right to left languages
|
26
|
+
data:
|
27
|
+
text: "An error message displayed right to left"
|
28
|
+
id: "error_id_2"
|
29
|
+
right_to_left: true
|
30
|
+
with_items_and_dir_attribute:
|
31
|
+
description: To allow the correct display of right to left languages on error items
|
32
|
+
data:
|
33
|
+
right_to_left: true
|
34
|
+
items:
|
35
|
+
- text: Error 1 displayed right to left
|
36
|
+
- text: Error 2 displayed right to left
|
@@ -183,3 +183,35 @@ examples:
|
|
183
183
|
text: "Given name"
|
184
184
|
name: given-name
|
185
185
|
enterkeyhint: "next"
|
186
|
+
with_dir_attribute:
|
187
|
+
description: |
|
188
|
+
Allows the correct display of right to left languages.
|
189
|
+
|
190
|
+
By default the input element and the label both display text in a left to right direction.
|
191
|
+
|
192
|
+
When the `right_to_left` parameter of the input component is set to `true` both the input and the label, hint and error message display their content in a right to left direction.
|
193
|
+
data:
|
194
|
+
label:
|
195
|
+
text: "Some input text to be displayed right to left with a label that displays in the same direction"
|
196
|
+
hint: "Some hint text that displays in the same text direction as the label"
|
197
|
+
error_message: "An error message that displays in the same text direction as the label"
|
198
|
+
name: rtl-input-text
|
199
|
+
value: "العربيَّة"
|
200
|
+
right_to_left: true
|
201
|
+
|
202
|
+
with_separate_dir_attributes_for_field_and_help_text:
|
203
|
+
description: |
|
204
|
+
Allows the correct display of right to left languages.
|
205
|
+
|
206
|
+
By default the input element and the label both display text in a left to right direction.
|
207
|
+
|
208
|
+
If the input field and the help text (label, hint and error messages) are required to display in different directions the `right_to_left_help` attribute can be set as false to override the `right_to_left` attribute.
|
209
|
+
data:
|
210
|
+
label:
|
211
|
+
text: "Some input text that displays right to left with a label that displays left to right"
|
212
|
+
hint: "Some hint text that displays in the same text direction as the label"
|
213
|
+
name: rtl-input-text
|
214
|
+
value: "العربيَّة"
|
215
|
+
right_to_left: true
|
216
|
+
right_to_left_help: false
|
217
|
+
error_message: "An error message that displays in the same text direction as the label"
|
@@ -65,3 +65,14 @@ examples:
|
|
65
65
|
text: "Label with an ID"
|
66
66
|
id: "id-for-the-label"
|
67
67
|
html_for: "id-that-matches-input-6"
|
68
|
+
with_dir_attribute:
|
69
|
+
description: |
|
70
|
+
To allow the correct display of right to left languages.
|
71
|
+
|
72
|
+
When the `right_to_left` parameter is set to `true` any hint text displays in the same text direction as the label.
|
73
|
+
data:
|
74
|
+
text: "العربيَّة"
|
75
|
+
html_for: "id-that-matches-input-7"
|
76
|
+
hint_id: "should-match-aria-describedby-input"
|
77
|
+
hint_text: "Hint text displayed right to left"
|
78
|
+
right_to_left: true
|
@@ -110,3 +110,34 @@ examples:
|
|
110
110
|
name: "with_data_attrbutes"
|
111
111
|
data:
|
112
112
|
module: "some-awesome-module-here"
|
113
|
+
with_dir_attribute:
|
114
|
+
description: |
|
115
|
+
Allows the correct display of right to left languages.
|
116
|
+
|
117
|
+
By default the textarea element and the label both display text in a left to right direction.
|
118
|
+
|
119
|
+
When the `right_to_left` parameter of the textarea component is set to `true` all text desplays in a right to left direction.
|
120
|
+
data:
|
121
|
+
label:
|
122
|
+
text: "Some textarea text that displays right to left with a label that displays in the same direction"
|
123
|
+
hint: "Some hint text that displays in the same text direction as the label"
|
124
|
+
error_message: "An error message that displays in the same text direction as the label"
|
125
|
+
name: "rtl-textarea-text"
|
126
|
+
value: "العربيَّة"
|
127
|
+
right_to_left: true
|
128
|
+
with_separate_dir_attributes_for_field_and_help_text:
|
129
|
+
description: |
|
130
|
+
Allows the correct display of right to left languages.
|
131
|
+
|
132
|
+
By default the textarea element and the label both display text in a left to right direction.
|
133
|
+
|
134
|
+
If the textarea field and the help text (label, hint and error messages) are required to display in different directions the right_to_left_help attribute can be set as false to override the right_to_left attribute.
|
135
|
+
data:
|
136
|
+
label:
|
137
|
+
text: "Some textarea text that displays right to left with a label that displays left to right"
|
138
|
+
hint: "Some hint text that displays in the same text direction as the label"
|
139
|
+
error_message: "An error message that displays in the same text direction as the label"
|
140
|
+
name: rtl-textarea-text
|
141
|
+
value: "العربيَّة"
|
142
|
+
right_to_left: true
|
143
|
+
right_to_left_help: false
|
@@ -68,7 +68,7 @@
|
|
68
68
|
# This seems to be a more reliable way to make sure the script is executed.
|
69
69
|
%>
|
70
70
|
|
71
|
-
|
71
|
+
<%= javascript_tag nonce: true do -%>
|
72
72
|
document.addEventListener("DOMContentLoaded", function () {
|
73
73
|
var input = document.querySelector("#giraffe"),
|
74
74
|
form = document.querySelector("#something-is-wrong")
|
@@ -80,4 +80,4 @@
|
|
80
80
|
e.preventDefault();
|
81
81
|
}
|
82
82
|
});
|
83
|
-
|
83
|
+
<% end -%>
|
@@ -13,8 +13,10 @@
|
|
13
13
|
class="gem-c-metadata__definition-link govuk-!-display-none-print"
|
14
14
|
data-controls="toggle-<%= toggle_id %>"
|
15
15
|
data-expanded="false"
|
16
|
-
data-toggled-text="<%= t("
|
17
|
-
<%= t("
|
16
|
+
data-toggled-text="<%= t("common.toggle_less") %>">
|
17
|
+
<%= t("common.toggle_more",
|
18
|
+
show: t('common.show'),
|
19
|
+
number: remaining.length) %>
|
18
20
|
</a>
|
19
21
|
</div>
|
20
22
|
<span id="toggle-<%= toggle_id %>" class="gem-c-metadata__toggle-items js-hidden"><%= remaining.to_sentence.html_safe %></span>
|
@@ -54,10 +54,10 @@
|
|
54
54
|
class="gem-c-related-navigation__toggle"
|
55
55
|
data-controls="toggle_<%= section_title %>"
|
56
56
|
data-expanded="false"
|
57
|
-
data-toggled-text="<%= t("
|
58
|
-
<%= t("
|
59
|
-
|
60
|
-
|
57
|
+
data-toggled-text="<%= t("common.toggle_less") %>">
|
58
|
+
<%= t("common.toggle_more",
|
59
|
+
show: t('common.show'),
|
60
|
+
number: related_nav_helper.remaining_link_count(links)) %>
|
61
61
|
</a>
|
62
62
|
</li>
|
63
63
|
|
@@ -23,9 +23,9 @@
|
|
23
23
|
<%= yield :extra_headers %>
|
24
24
|
</head>
|
25
25
|
<body class="gem-c-layout-for-admin govuk-template__body <%= 'hide-header-and-footer' if @preview %>">
|
26
|
-
|
26
|
+
<%= javascript_tag nonce: true do -%>
|
27
27
|
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
|
28
|
-
|
28
|
+
<% end -%>
|
29
29
|
<% if @preview %>
|
30
30
|
<main id="wrapper" class="govuk-width-container">
|
31
31
|
<%= yield %>
|
data/config/locales/ar.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
---
|
2
2
|
ar:
|
3
3
|
common:
|
4
|
+
hide: إخفاء
|
5
|
+
show: إظهار
|
6
|
+
toggle_less: عرض أقل
|
7
|
+
toggle_more: زيادة بمقدار %{show} %{number}
|
4
8
|
translations: الترجمات
|
5
9
|
components:
|
6
10
|
accordion:
|
7
|
-
hide: إخفاء
|
8
11
|
hide_all: إخفاء كل الأقسام
|
9
|
-
show: إظهار
|
10
12
|
show_all: إظهار كل الأقسام
|
11
13
|
this_section_visually_hidden: " هذا القسم"
|
12
14
|
article_schema:
|
@@ -129,8 +131,6 @@ ar:
|
|
129
131
|
part_of: جزء من
|
130
132
|
published: منشورة
|
131
133
|
see_all_updates: اطلع على كل التحديثات
|
132
|
-
toggle_less: عرض أقل
|
133
|
-
toggle_more: زيادة بمقدار + %{number}
|
134
134
|
modal_dialogue:
|
135
135
|
close_modal: إغلاق مربع الحوار المشروط
|
136
136
|
notice:
|
data/config/locales/az.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
---
|
2
2
|
az:
|
3
3
|
common:
|
4
|
+
hide: Gizlət
|
5
|
+
show: Göstər
|
6
|
+
toggle_less: Daha azını göstər
|
7
|
+
toggle_more: "%{show} %{number} daha çox"
|
4
8
|
translations: Tərcümələr
|
5
9
|
components:
|
6
10
|
accordion:
|
7
|
-
hide: Gizlət
|
8
11
|
hide_all: Bütün bölmələri gizlət
|
9
|
-
show: Göstər
|
10
12
|
show_all: Bütün bölmələri göstər
|
11
13
|
this_section_visually_hidden: " bu bölmə"
|
12
14
|
article_schema:
|
@@ -126,8 +128,6 @@ az:
|
|
126
128
|
part_of: Hissə
|
127
129
|
published: Dərc edilib
|
128
130
|
see_all_updates: Bütün yeniləmələrə baxın
|
129
|
-
toggle_less: Daha azını göstər
|
130
|
-
toggle_more: "+ %{number} daha çox"
|
131
131
|
modal_dialogue:
|
132
132
|
close_modal: Modal dialoqu bağla
|
133
133
|
notice:
|
data/config/locales/be.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
---
|
2
2
|
be:
|
3
3
|
common:
|
4
|
+
hide: Схаваць
|
5
|
+
show: Паказаць
|
6
|
+
toggle_less: Паказаць меньш
|
7
|
+
toggle_more: "%{show} %{number} болей"
|
4
8
|
translations: Пераклады
|
5
9
|
components:
|
6
10
|
accordion:
|
7
|
-
hide: Схаваць
|
8
11
|
hide_all: Схаваць усе секцыi
|
9
|
-
show: Паказаць
|
10
12
|
show_all: Паказаць усе секцыi
|
11
13
|
this_section_visually_hidden: " гэта секцыя"
|
12
14
|
article_schema:
|
@@ -132,8 +134,6 @@ be:
|
|
132
134
|
part_of: Частка
|
133
135
|
published: Апублікаваны
|
134
136
|
see_all_updates: Паглядзець усе абнаўленні
|
135
|
-
toggle_less: Паказаць меньш
|
136
|
-
toggle_more: "+ %{number} болей"
|
137
137
|
modal_dialogue:
|
138
138
|
close_modal: Зачыніць мадальны дыялог
|
139
139
|
notice:
|
data/config/locales/bg.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
---
|
2
2
|
bg:
|
3
3
|
common:
|
4
|
+
hide: Скриване
|
5
|
+
show: Показване
|
6
|
+
toggle_less: Показване на по-малко
|
7
|
+
toggle_more: "%{show} %{number} повече"
|
4
8
|
translations: Translations
|
5
9
|
components:
|
6
10
|
accordion:
|
7
|
-
hide: Скриване
|
8
11
|
hide_all: Скриване на всички раздели
|
9
|
-
show: Показване
|
10
12
|
show_all: Показване на всички раздели
|
11
13
|
this_section_visually_hidden: " този раздел"
|
12
14
|
article_schema:
|
@@ -130,8 +132,6 @@ bg:
|
|
130
132
|
part_of: Част от
|
131
133
|
published: Публикуван
|
132
134
|
see_all_updates: Вижте всички актуализации
|
133
|
-
toggle_less: Показване на по-малко
|
134
|
-
toggle_more: "+ %{number} повече"
|
135
135
|
modal_dialogue:
|
136
136
|
close_modal: Затваряне на модалния диалог
|
137
137
|
notice:
|