govuk_publishing_components 21.65.1 → 21.66.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +25 -7
  3. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +3 -3
  4. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +8 -1
  5. data/app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js +25 -20
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +33 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +8 -1
  8. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
  9. data/app/views/govuk_publishing_components/components/_document_list.html.erb +2 -2
  10. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +1 -1
  11. data/app/views/govuk_publishing_components/components/_image_card.html.erb +20 -20
  12. data/app/views/govuk_publishing_components/components/_notice.html.erb +2 -1
  13. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +3 -5
  14. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +6 -0
  15. data/app/views/govuk_publishing_components/components/docs/notice.yml +8 -0
  16. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +9 -0
  17. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +0 -1
  18. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +1 -1
  19. data/lib/govuk_publishing_components/presenters/organisation_logo_helper.rb +2 -1
  20. data/lib/govuk_publishing_components/version.rb +1 -1
  21. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00cb9ed2b1890ec679368a5b6565f425ab630a8c7576e36ec05572f7b82def5e
4
- data.tar.gz: c252f946b8c435ff7dcfc4a4f68453cbf653b1e3cc71d1fe85c1060c2e6a0df9
3
+ metadata.gz: 4f1d9c7682de95500ed81dea0c882a0ee4d06712de97959ba929a0a4df3be026
4
+ data.tar.gz: a218c351949f15ade0339e0c75e44d92d4e36c1eda24d6814bddeda038ce94e7
5
5
  SHA512:
6
- metadata.gz: 88c4f14857cdab94770e04b4ca84f9733f10855b43bc6706f87960d6ff552c8de581071c1aa80da8460e34de43ded3534cbed2c76a371f4c50d62edff361f994
7
- data.tar.gz: ffad88268390f0a57eeb6eb31b77c8f88b53d21eb0cff4fa6ed399899ff32ca8519f4c1f7bccc2e2fc5e161ee95d91ff749e7356c9bc9ff25288aef71b66a85f
6
+ metadata.gz: c2619f5980dd8a3f2001a1ba6090df652c66e0b20db6b5c12d80bde86f07b096bc577c82e2a084a8f2db21cf1523632d3cd6083c4c0a1b468383a6b0cc86433d
7
+ data.tar.gz: bf214537cd46646d40a28e3d9e7beabb6a26185584fb83f213c465eb9eeb13262d990cea26a213c1d7f5256bf285be0aa2e61a96d1718bfe042cb0f09859b592
@@ -8,19 +8,23 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
8
8
 
9
9
  Modules.Feedback = function () {
10
10
  this.start = function ($element) {
11
+ this.element = $element[0]
12
+ this.somethingIsWrongForm = this.element.querySelector('#something-is-wrong')
13
+ this.surveyForm = this.element.querySelector('#page-is-not-useful')
11
14
  this.$prompt = $element.find('.js-prompt')
12
15
  this.$fields = $element.find('.gem-c-feedback__form-field')
13
16
  this.$forms = $element.find('.js-feedback-form')
14
17
  this.$toggleForms = $element.find('.js-toggle-form')
15
18
  this.$closeForms = $element.find('.js-close-form')
19
+ this.activeForm = false
16
20
  this.$activeForm = false
17
21
  this.$pageIsUsefulButton = $element.find('.js-page-is-useful')
18
22
  this.$pageIsNotUsefulButton = $element.find('.js-page-is-not-useful')
19
23
  this.$somethingIsWrongButton = $element.find('.js-something-is-wrong')
20
24
  this.$promptQuestions = $element.find('.js-prompt-questions')
21
25
  this.$promptSuccessMessage = $element.find('.js-prompt-success')
22
- this.$somethingIsWrongForm = $element.find('#something-is-wrong')
23
- this.$surveyForm = $element.find('#page-is-not-useful')
26
+ this.$somethingIsWrongForm = $(this.somethingIsWrongForm)
27
+ this.$surveyForm = $(this.surveyForm)
24
28
  this.$surveyWrapper = $element.find('#survey-wrapper')
25
29
 
26
30
  var that = this
@@ -103,12 +107,23 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
103
107
  function setHiddenValues () {
104
108
  that.$somethingIsWrongForm.append('<input type="hidden" name="javascript_enabled" value="true"/>')
105
109
  that.$somethingIsWrongForm.append($('<input type="hidden" name="referrer">').val(document.referrer || 'unknown'))
110
+ that.somethingIsWrongForm.invalidInfoError = [
111
+ '<h2>',
112
+ ' Sorry, we’re unable to send your message as you haven’t given us any information.',
113
+ '</h2>',
114
+ '<p>Please tell us what you were doing or what went wrong</p>'
115
+ ].join('')
106
116
  }
107
117
 
108
118
  function setHiddenValuesNotUsefulForm (gaClientId) {
109
119
  var currentPathName = window.location.pathname.replace(/[^\s=?&]+(?:@|%40)[^\s=?&]+/, '[email]')
110
120
  var finalPathName = encodeURI(currentPathName)
111
-
121
+ that.surveyForm.invalidInfoError = [
122
+ '<h2>',
123
+ ' Sorry, we’re unable to send your message as you haven’t given us a valid email address. ',
124
+ '</h2>',
125
+ '<p>Enter an email address in the correct format, like name@example.com</p>'
126
+ ].join('')
112
127
  if (document.querySelectorAll('[name="email_survey_signup[ga_client_id]"]').length === 0) {
113
128
  that.$surveyForm.append($('<input name="email_survey_signup[ga_client_id]" type="hidden">').val(gaClientId || '0'))
114
129
  }
@@ -124,7 +139,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
124
139
  }
125
140
 
126
141
  function toggleForm (formId) {
127
- that.$activeForm = $element.find('#' + formId)
142
+ that.activeForm = that.element.querySelector('#' + formId)
143
+ that.$activeForm = $(that.activeForm)
128
144
  that.$activeForm.toggleClass(jshiddenClass)
129
145
  that.$prompt.toggleClass(jshiddenClass)
130
146
 
@@ -158,18 +174,20 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
158
174
  '<p>If the problem persists, we have other ways for you to provide',
159
175
  ' feedback on the <a href="/contact/govuk">contact page</a>.</p>'
160
176
  ].join('')
161
-
162
177
  // if the response is not a 404 or 500, show the error message if it exists
163
178
  // otherwise show the generic message
164
- // this covers the 422 status the feedback application return for empty fields
165
- // for all other, show generic error
166
179
  if (typeof (error.responseJSON) !== 'undefined') {
167
180
  error = typeof (error.responseJSON.message) === 'undefined' ? genericError : error.responseJSON.message
168
181
 
169
182
  if (error === 'email survey sign up failure') {
170
183
  error = genericError
171
184
  }
185
+ } else if (error.status === 422) {
186
+ // there's clobbering by nginx on all 422 requests, which is why the response returns a rendered html page instead of the expected JSON
187
+ // this is a temporary workaround to ensure that are are displaying relevant error messages to the users
188
+ error = that.activeForm.invalidInfoError || genericError
172
189
  } else {
190
+ // for all other, show generic error
173
191
  error = genericError
174
192
  }
175
193
  var $errors = that.$activeForm.find('.js-errors')
@@ -396,14 +396,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
396
396
  var $cell = cells[i]
397
397
  var cellVal = parseFloat(this.utils.stripValue($cell.innerText), 10)
398
398
  var $cellSpan = $cell.querySelector('span')
399
- var spanWidth = parseFloat(window.getComputedStyle($cellSpan, null).width.replace('px', '')) + 10 // +10 just for extra padding
400
- var cellWidth = parseFloat(window.getComputedStyle($cell, null).width.replace('px', ''))
399
+ var spanWidth = $cell.querySelector('span').offsetWidth + 5 // +5 just for extra padding
400
+ var cellWidth = $cell.offsetWidth
401
401
 
402
402
  if (!this.options.stacked) {
403
403
  // if it's 0, it is effectively outdented
404
404
  if (cellVal === 0) { $cell.classList.add('mc-bar-outdented') }
405
405
 
406
- if ((this.options.autoOutdent && spanWidth > cellWidth) || this.options.outdentAll) {
406
+ if ((this.options.autoOutdent && spanWidth >= cellWidth) || this.options.outdentAll) {
407
407
  $cell.classList.add('mc-bar-outdented')
408
408
  $cellSpan.style.marginLeft = '100%'
409
409
  $cellSpan.style.display = 'inline-block'
@@ -10,9 +10,10 @@
10
10
  for (i = 0, _i = els.length; i < _i; i++) {
11
11
  els[i].addEventListener('click', function (e) {
12
12
  e.preventDefault()
13
- var target = document.getElementById(this.getAttribute('href').substr(1))
13
+ var target = this.getAttribute('href') ? document.getElementById(this.getAttribute('href').substr(1)) : document.getElementById(this.getAttribute('data-search-toggle-for'))
14
14
  var targetClass = target.getAttribute('class') || ''
15
15
  var sourceClass = this.getAttribute('class') || ''
16
+ var isSearchToggle = sourceClass.match('search-toggle')
16
17
 
17
18
  if (targetClass.indexOf('js-visible') !== -1) {
18
19
  target.setAttribute('class', targetClass.replace(/(^|\s)js-visible(\s|$)/, ''))
@@ -21,8 +22,14 @@
21
22
  }
22
23
  if (sourceClass.indexOf('js-visible') !== -1) {
23
24
  this.setAttribute('class', sourceClass.replace(/(^|\s)js-visible(\s|$)/, ''))
25
+ if (isSearchToggle) {
26
+ this.innerText = 'Show search'
27
+ }
24
28
  } else {
25
29
  this.setAttribute('class', sourceClass + ' js-visible')
30
+ if (isSearchToggle) {
31
+ this.innerText = 'Hide search'
32
+ }
26
33
  }
27
34
  this.setAttribute('aria-expanded', this.getAttribute('aria-expanded') !== 'true')
28
35
  target.setAttribute('aria-hidden', target.getAttribute('aria-hidden') === 'false')
@@ -1,36 +1,41 @@
1
+ //= require govuk/vendor/polyfills/Element/prototype/classList.js
1
2
  /*
2
3
  Toggle the class 'focus' on input boxes on element focus/blur
3
4
  Used by the search component but generic enough for reuse
4
5
  */
6
+ window.GOVUK = window.GOVUK || {}
5
7
  window.GOVUK.Modules = window.GOVUK.Modules || {};
6
8
 
7
9
  (function (Modules) {
8
- 'use strict'
10
+ function GemToggleInputClassOnFocus () { }
9
11
 
10
- Modules.GemToggleInputClassOnFocus = function () {
11
- this.start = function ($el) {
12
- var $toggleTarget = $el.find('.js-class-toggle')
12
+ GemToggleInputClassOnFocus.prototype.start = function ($module) {
13
+ this.$module = $module[0]
14
+ this.toggleTarget = this.$module.querySelector('.js-class-toggle')
15
+ this.$module.addFocusClass = this.addFocusClass.bind(this)
16
+ this.$module.removeFocusClassFromEmptyInput = this.removeFocusClassFromEmptyInput.bind(this)
13
17
 
14
- if (!inputIsEmpty()) {
15
- addFocusClass()
16
- }
18
+ if (!this.inputIsEmpty()) {
19
+ this.addFocusClass()
20
+ }
17
21
 
18
- $toggleTarget.on('focus', addFocusClass)
19
- $toggleTarget.on('blur', removeFocusClassFromEmptyInput)
22
+ this.toggleTarget.addEventListener('focus', this.$module.addFocusClass)
23
+ this.toggleTarget.addEventListener('blur', this.$module.removeFocusClassFromEmptyInput)
24
+ }
20
25
 
21
- function inputIsEmpty () {
22
- return $toggleTarget.val() === ''
23
- }
26
+ GemToggleInputClassOnFocus.prototype.inputIsEmpty = function () {
27
+ return this.toggleTarget.value === ''
28
+ }
24
29
 
25
- function addFocusClass () {
26
- $toggleTarget.addClass('focus')
27
- }
30
+ GemToggleInputClassOnFocus.prototype.addFocusClass = function () {
31
+ this.toggleTarget.classList.add('focus')
32
+ }
28
33
 
29
- function removeFocusClassFromEmptyInput () {
30
- if (inputIsEmpty()) {
31
- $toggleTarget.removeClass('focus')
32
- }
33
- }
34
+ GemToggleInputClassOnFocus.prototype.removeFocusClassFromEmptyInput = function () {
35
+ if (this.inputIsEmpty()) {
36
+ this.toggleTarget.classList.remove('focus')
34
37
  }
35
38
  }
39
+
40
+ Modules.GemToggleInputClassOnFocus = GemToggleInputClassOnFocus
36
41
  })(window.GOVUK.Modules)
@@ -3,6 +3,25 @@
3
3
  @include govuk-text-colour;
4
4
  position: relative;
5
5
  margin-bottom: govuk-spacing(6);
6
+ display: flex;
7
+ display: -ms-flexbox;
8
+ flex-direction: column-reverse;
9
+ -ms-flex-direction: column-reverse;
10
+
11
+ @include govuk-media-query($from: mobile, $until: tablet) {
12
+ display: block;
13
+
14
+ .gem-c-image-card__text-wrapper {
15
+ float: right;
16
+ padding-left: 0;
17
+ }
18
+ }
19
+ }
20
+
21
+ .gem-c-image-card__header-and-context-wrapper {
22
+ display: flex;
23
+ flex-direction: column-reverse;
24
+ -ms-flex-direction: column-reverse;
6
25
  }
7
26
 
8
27
  .gem-c-image-card__image-wrapper {
@@ -135,7 +154,11 @@
135
154
  }
136
155
 
137
156
  .gem-c-image-card--large.gem-c-image-card {
157
+ display: flex;
138
158
  margin: 0 0 govuk-spacing(6) 0;
159
+ @include govuk-media-query($from: tablet) {
160
+ display: block;
161
+ }
139
162
  }
140
163
 
141
164
  .gem-c-image-card--large {
@@ -161,6 +184,7 @@
161
184
  overflow: hidden;
162
185
 
163
186
  @include govuk-media-query($from: tablet) {
187
+ float: right;
164
188
  padding: 0 govuk-spacing(3);
165
189
  margin-bottom: 0;
166
190
  }
@@ -180,3 +204,12 @@
180
204
  @include govuk-font(19);
181
205
  }
182
206
  }
207
+
208
+ .gem-c-image-card--no-image {
209
+ .gem-c-image-card__text-wrapper {
210
+ @include govuk-media-query($from: mobile, $until: tablet) {
211
+ float: left;
212
+ padding: 0 govuk-spacing(3);
213
+ }
214
+ }
215
+ }
@@ -213,11 +213,11 @@ $large-input-size: 50px;
213
213
  }
214
214
 
215
215
  .search-toggle {
216
+ display: none;
216
217
  background-color: govuk-colour("blue");
217
218
  background-image: image-url("govuk_publishing_components/search-button.png");
218
219
  background-position: 0 50%;
219
220
  background-repeat: no-repeat;
220
- display: block;
221
221
  float: right;
222
222
  height: 30px;
223
223
  margin: -46px 0;
@@ -225,6 +225,7 @@ $large-input-size: 50px;
225
225
  padding: 0;
226
226
  text-indent: -5000px;
227
227
  width: 36px;
228
+ border: 0;
228
229
 
229
230
  &:focus {
230
231
  border-width: 0;
@@ -250,4 +251,10 @@ $large-input-size: 50px;
250
251
  @include govuk-media-query($from: tablet) {
251
252
  display: none;
252
253
  }
254
+
255
+ @include govuk-media-query($until: tablet) {
256
+ .js-enabled & {
257
+ display: block;
258
+ }
259
+ }
253
260
  }
@@ -1,6 +1,6 @@
1
1
  <%-
2
2
  cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
3
- aria_label ||= nil
3
+ aria_label ||= "Contents"
4
4
  format_numbers ||= false
5
5
  hide_title ||= false
6
6
 
@@ -15,7 +15,7 @@
15
15
  %>
16
16
  <% if items.any? %>
17
17
  <% unless within_multitype_list %>
18
- <ol class="<%= classes %>">
18
+ <ul class="<%= classes %>">
19
19
  <% end %>
20
20
  <% items.each do |item| %>
21
21
  <% highlight_class = " gem-c-document-list__item--highlight" if item[:highlight] %>
@@ -112,6 +112,6 @@
112
112
  </li>
113
113
  <% end %>
114
114
  <% unless within_multitype_list %>
115
- </ol>
115
+ </ul>
116
116
  <% end %>
117
117
  <% end %>
@@ -2,7 +2,7 @@
2
2
  active ||= nil
3
3
  %>
4
4
 
5
- <nav id="proposition-menu" class="no-proposition-name gem-c-government-navigation">
5
+ <nav id="proposition-menu" class="no-proposition-name gem-c-government-navigation" aria-label="Departments and policy navigation">
6
6
  <ul id="proposition-links">
7
7
  <li>
8
8
  <a class="<%= 'active' if active == 'departments' %>" href="/government/organisations">
@@ -3,32 +3,32 @@
3
3
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
4
4
  card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns)
5
5
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
6
+ classes = "gem-c-image-card"
7
+ classes << " gem-c-image-card--large" if card_helper.large
8
+ classes << " gem-c-image-card--no-image" unless defined?(image_src)
6
9
  %>
7
10
  <% if card_helper.href || card_helper.extra_links.any? %>
8
- <div class="gem-c-image-card <%= "gem-c-image-card--large" if card_helper.large %> <%= brand_helper.brand_class %>"
11
+ <div class="<%= classes %> <%= brand_helper.brand_class %>"
9
12
  <%= "data-module=track-click" if card_helper.is_tracking? %>
10
13
  <%= "lang=#{card_helper.lang}" if card_helper.lang %>>
11
- <%= card_helper.image %>
12
-
13
14
  <div class="gem-c-image-card__text-wrapper">
14
- <%= card_helper.context %>
15
-
16
- <% if card_helper.heading_text %>
17
- <%= content_tag(shared_helper.get_heading_level,
18
- class: "gem-c-image-card__title") do %>
19
- <% if card_helper.href %>
20
- <%= link_to card_helper.heading_text, card_helper.href,
21
- class: "gem-c-image-card__title-link #{brand_helper.color_class}",
22
- data: card_helper.href_data_attributes
23
- %>
24
- <% else %>
25
- <%= card_helper.heading_text %>
26
- <% end %>
15
+ <div class="gem-c-image-card__header-and-context-wrapper">
16
+ <% if card_helper.heading_text %>
17
+ <%= content_tag(shared_helper.get_heading_level,
18
+ class: "gem-c-image-card__title") do %>
19
+ <% if card_helper.href %>
20
+ <%= link_to card_helper.heading_text, card_helper.href,
21
+ class: "gem-c-image-card__title-link #{brand_helper.color_class}",
22
+ data: card_helper.href_data_attributes
23
+ %>
24
+ <% else %>
25
+ <%= card_helper.heading_text %>
26
+ <% end %>
27
+ <% end %>
27
28
  <% end %>
28
- <% end %>
29
-
29
+ <%= card_helper.context %>
30
+ </div>
30
31
  <%= card_helper.description %>
31
-
32
32
  <% if card_helper.extra_links.any? %>
33
33
  <ul class="gem-c-image-card__list <%= "gem-c-image-card__list--indented" if not card_helper.extra_links_no_indent %>">
34
34
  <% card_helper.extra_links.each do |link| %>
@@ -41,10 +41,10 @@
41
41
  <% end %>
42
42
  </ul>
43
43
  <% end %>
44
-
45
44
  <% if card_helper.metadata %>
46
45
  <p class="gem-c-image-card__metadata"><%= card_helper.metadata %></p>
47
46
  <% end %>
48
47
  </div>
48
+ <%= card_helper.image %>
49
49
  </div>
50
50
  <% end %>
@@ -4,6 +4,7 @@
4
4
  description_govspeak ||= false
5
5
  description ||= yield || false
6
6
  aria_live ||= false
7
+ lang = local_assigns[:lang].presence
7
8
  local_assigns[:margin_bottom] ||= 8
8
9
  local_assigns[:margin_bottom] = 8 if local_assigns[:margin_bottom] > 9
9
10
 
@@ -17,7 +18,7 @@
17
18
  description_present = description.present? || description_text.present? || description_govspeak.present?
18
19
  %>
19
20
  <% if title || description_present %>
20
- <%= tag.section class: css_classes, aria: aria_attributes, role: "region" do %>
21
+ <%= tag.section class: css_classes, aria: aria_attributes, lang: lang, role: "region" do %>
21
22
  <% if title %>
22
23
  <% if description_present %>
23
24
  <%= tag.h2 title, class: "gem-c-notice__title" %>
@@ -17,9 +17,7 @@ accessibility_criteria: |
17
17
  - inform the user how many items are in the list
18
18
  - convey the content structure
19
19
  - indicate the current page when contents span different pages, and not link to itself
20
-
21
- The contents list may:
22
- - include an aria-label to contextualise the list if helpful
20
+ - include an aria-label to contextualise the list
23
21
 
24
22
  Links with formatted numbers must separate the number and text with a space for correct screen reader pronunciation. This changes pronunciation from "1 dot Item" to "1 Item".
25
23
  shared_accessibility_criteria:
@@ -67,8 +65,8 @@ examples:
67
65
  active: true
68
66
  - href: "#third-thing"
69
67
  text: Third thing
70
- aria_label:
71
- description: 'An aria-label string can be used to contextualise the navigation for assistive technology.'
68
+ with_custom_aria_label:
69
+ description: 'An aria-label string should be used to contextualise the navigation for assistive technology. Defaults to "Contents" if aria-label is not passed.'
72
70
  data:
73
71
  aria_label: "Pages in this guide"
74
72
  contents:
@@ -188,6 +188,12 @@ examples:
188
188
  <tr>
189
189
  <td>row 2</td><td>15</td>
190
190
  </tr>
191
+ <tr>
192
+ <td>row 3</td><td>2</td>
193
+ </tr>
194
+ <tr>
195
+ <td>row 4</td><td>48</td>
196
+ </tr>
191
197
  </tbody>
192
198
  </table>
193
199
  chart_with_colours:
@@ -42,3 +42,11 @@ examples:
42
42
  title: 'Your settings have been saved'
43
43
  description_govspeak: <p>This is a confirmation message to tell you your settings have been saved</p>
44
44
  aria_live: true
45
+ with_locale:
46
+ description: |
47
+ Passing a lang value allows the content of the notice to be labelled as being a different language from surrounding content.
48
+ The lang attribute must be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is en or eng, Korean is ko or kor - but if in doubt please check.
49
+ data:
50
+ title: 'This publication was withdrawn on 30 September 2015'
51
+ description_govspeak: <p>This document is no longer current. We published a new version on 30 September 2015.</p>
52
+ lang: 'en'
@@ -191,3 +191,12 @@ examples:
191
191
  brand: cabinet-office
192
192
  crest: 'single-identity'
193
193
  inline: true
194
+ with-explicit-language:
195
+ description: The language attribute on the name of the organisation can be set if required. If this option is not passed, no lang attribute is set.
196
+ data:
197
+ organisation:
198
+ name: Tŷ'r Cwmnïau
199
+ url: '/government/organisations/companies-house.cy'
200
+ brand: department-for-business-innovation-skills
201
+ crest: 'single-identity'
202
+ lang: "cy"
@@ -26,7 +26,6 @@
26
26
  'track-category' => 'yesNoFeedbackForm',
27
27
  'track-action' => 'ffYesClick'
28
28
  },
29
- 'aria-expanded': false,
30
29
  role: 'button',
31
30
  } do %>
32
31
  <%= t("components.feedback.yes", default: "Yes") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_useful", default: "this page is useful") %></span>
@@ -1,4 +1,4 @@
1
- <a href="#search" class="search-toggle js-header-toggle">Search</a>
1
+ <button class="search-toggle js-header-toggle" data-search-toggle-for="search">Show search</button>
2
2
  <form id="search" class="gem-c-layout-header__search-form govuk-clearfix" action="/search" method="get" role="search">
3
3
  <%= render "govuk_publishing_components/components/search", {
4
4
  id: "site-search-text",
@@ -11,6 +11,7 @@ module GovukPublishingComponents
11
11
  @url = local_assigns[:organisation][:url]
12
12
  @crest = local_assigns[:organisation][:crest]
13
13
  @image = local_assigns[:organisation][:image] || false
14
+ @lang = local_assigns[:lang] || nil
14
15
  if @image
15
16
  @logo_image_src = local_assigns[:organisation][:image][:url] || false
16
17
  @logo_image_alt = local_assigns[:organisation][:image][:alt_text] || false
@@ -21,7 +22,7 @@ module GovukPublishingComponents
21
22
  if image
22
23
  image_tag(logo_image_src, alt: logo_image_alt, class: "gem-c-organisation-logo__image")
23
24
  else
24
- content_tag("span", name, class: "gem-c-organisation-logo__name")
25
+ content_tag("span", name, class: "gem-c-organisation-logo__name", lang: @lang)
25
26
  end
26
27
  end
27
28
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "21.65.1".freeze
2
+ VERSION = "21.66.4".freeze
3
3
  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: 21.65.1
4
+ version: 21.66.4
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: 2020-09-14 00:00:00.000000000 Z
11
+ date: 2020-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config