govuk_publishing_components 16.20.1 → 16.21.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b578c023ba499b8cd0c8021144fabaf4514f6ffa9ffcb49682b984dadc471a1c
4
- data.tar.gz: c1d8829238aa38adb6f4b434158867b978f10040b4a856f67f270114adbfead2
3
+ metadata.gz: b0e66c510f47947195c29e3e559334f23976da49f7b0d88aa4decb9312448089
4
+ data.tar.gz: 6f45aed161c2c129fc255648cb5718484a1043f0dd9234fd5bfa221b43606385
5
5
  SHA512:
6
- metadata.gz: 20518ee81485fe5df7f6fd510f8d28f742a5ea3f706cece20a0a709771b6e3f332680969f6acbd5c9950a3f359896df25f02c3db4bb3527c43a2f3cab7847c1c
7
- data.tar.gz: 3aca611de7fc01c47452c8c61d3439819f589fd3e0b21c3ed191e3d15ed4e938eae61571d901f51835f56981a77551e1a768ade7aa502b9eae31a2c9ef92dd19
6
+ metadata.gz: 5bae4ba11805b6e66728e492e42bcab8b02192cd24680bebcc9793901a266d8ed211159791a164cedacc3f11ce2f5455c143eedd4b3b69e0a5452ea0fd1984c8
7
+ data.tar.gz: 3cda7c4c005d472a7966c3842f93f4fb70cd1e0f262cf04390331b7c03b594839d0f41660219e2b3dd2b48added11bac93df4c84fa2c5a9903851a9dbb50ac9b
@@ -10,17 +10,24 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
10
10
  this.$module.showConfirmationMessage = this.showConfirmationMessage.bind(this)
11
11
  this.$module.setCookieConsent = this.setCookieConsent.bind(this)
12
12
 
13
- this.$hideLink = this.$module.querySelector('a[data-hide-cookie-banner], button[data-hide-cookie-banner]')
14
- if (this.$hideLink) {
15
- this.$hideLink.addEventListener('click', this.$module.hideCookieMessage)
16
- }
13
+ var newCookieBanner = document.querySelector('.gem-c-cookie-banner--new')
17
14
 
18
- this.$acceptCookiesLink = this.$module.querySelector('button[data-accept-cookies]')
19
- if (this.$acceptCookiesLink) {
20
- this.$acceptCookiesLink.addEventListener('click', this.$module.setCookieConsent)
21
- }
15
+ // Hide the cookie banner on the cookie settings page, to avoid circular journeys
16
+ if (newCookieBanner && window.location.pathname === '/help/cookies') {
17
+ this.$module.style.display = 'none'
18
+ } else {
19
+ this.$hideLink = this.$module.querySelector('a[data-hide-cookie-banner], button[data-hide-cookie-banner]')
20
+ if (this.$hideLink) {
21
+ this.$hideLink.addEventListener('click', this.$module.hideCookieMessage)
22
+ }
23
+
24
+ this.$acceptCookiesLink = this.$module.querySelector('button[data-accept-cookies]')
25
+ if (this.$acceptCookiesLink) {
26
+ this.$acceptCookiesLink.addEventListener('click', this.$module.setCookieConsent)
27
+ }
22
28
 
23
- this.showCookieMessage()
29
+ this.showCookieMessage()
30
+ }
24
31
  }
25
32
 
26
33
  CookieBanner.prototype.showCookieMessage = function () {
@@ -5,9 +5,9 @@
5
5
  var root = this
6
6
  var defaultCookieConsent = {
7
7
  'essential': true,
8
- 'settings': false,
9
- 'usage': false,
10
- 'campaigns': false
8
+ 'settings': true,
9
+ 'usage': true,
10
+ 'campaigns': true
11
11
  }
12
12
 
13
13
  if (typeof root.GOVUK === 'undefined') { root.GOVUK = {} }
@@ -10,6 +10,11 @@ $thumbnail-icon-border-colour: govuk-colour("grey-3");
10
10
  .gem-c-attachment {
11
11
  @include govuk-font(19);
12
12
  @include govuk-clearfix;
13
+ position: relative;
14
+
15
+ .govuk-details__summary {
16
+ @include govuk-font($size: 14);
17
+ }
13
18
  }
14
19
 
15
20
  .gem-c-attachment__thumbnail {
@@ -34,6 +39,10 @@ $thumbnail-icon-border-colour: govuk-colour("grey-3");
34
39
  stroke: $thumbnail-icon-border-colour;
35
40
  }
36
41
 
42
+ .gem-c-attachment__details {
43
+ padding-left: $thumbnail-width + $thumbnail-border-width * 2 + govuk-spacing(5);
44
+ }
45
+
37
46
  .gem-c-attachment__title {
38
47
  @include govuk-font($size: 27);
39
48
  margin: 0 0 govuk-spacing(3);
@@ -42,6 +51,10 @@ $thumbnail-icon-border-colour: govuk-colour("grey-3");
42
51
  .gem-c-attachment__metadata {
43
52
  @include govuk-font($size: 14);
44
53
  margin: 0 0 govuk-spacing(3);
54
+
55
+ &:last-of-type {
56
+ margin-bottom: 0;
57
+ }
45
58
  }
46
59
 
47
60
  .gem-c-attachment__abbr {
@@ -65,7 +65,7 @@ $govuk-cookie-banner-background-new: govuk-colour("white");
65
65
  }
66
66
 
67
67
  .gem-c-cookie-banner__hide-button {
68
- @include govuk-font($size: 16);
68
+ @include govuk-font($size: 19);
69
69
  outline: 0;
70
70
  border: 0;
71
71
  background: none;
@@ -99,7 +99,7 @@ $govuk-cookie-banner-background-new: govuk-colour("white");
99
99
  .gem-c-cookie-banner__buttons,
100
100
  .gem-c-cookie-banner__confirmation,
101
101
  .gem-c-cookie-banner__confirmation-message {
102
- @include core-19;
102
+ @include govuk-font($size: 19);
103
103
  }
104
104
 
105
105
  p {
@@ -1,7 +1,7 @@
1
1
  <%
2
2
  attachment = GovukPublishingComponents::Presenters::Attachment.new(attachment)
3
3
  target ||= "_self"
4
- hide_help_text ||= false
4
+ hide_opendocument_metadata ||= false
5
5
  attributes = []
6
6
 
7
7
  if attachment.content_type_name
@@ -46,20 +46,31 @@
46
46
  <% end %>
47
47
  <% end %>
48
48
 
49
- <%= tag.h2 class: "gem-c-attachment__title" do %>
50
- <%= link_to attachment.title, attachment.url,
51
- class: "govuk-link",
52
- target: target %>
53
- <% end %>
49
+ <%= tag.div class: "gem-c-attachment__details" do %>
50
+ <%= tag.h2 class: "gem-c-attachment__title" do %>
51
+ <%= link_to attachment.title, attachment.url,
52
+ class: "govuk-link",
53
+ target: target %>
54
+ <% end %>
54
55
 
55
- <% if attributes.any? %>
56
- <%= tag.p raw(attributes.join(', ')), class: "gem-c-attachment__metadata" %>
57
- <% end %>
56
+ <% if attributes.any? %>
57
+ <%= tag.p raw(attributes.join(', ')), class: "gem-c-attachment__metadata" %>
58
+ <% end %>
59
+
60
+ <% unless hide_opendocument_metadata %>
61
+ <% if attachment.opendocument? %>
62
+ <%= tag.p class: "gem-c-attachment__metadata" do %>
63
+ <%= t("components.attachment.opendocument_html", target: target) %>
64
+ <% end %>
65
+ <% end %>
66
+ <% end %>
58
67
 
59
- <% unless hide_help_text %>
60
- <% if attachment.opendocument? %>
61
- <%= tag.p class: "gem-c-attachment__metadata" do %>
62
- <%= t("components.attachment.opendocument_html", target: target) %>
68
+ <% if attachment.alternative_format_contact_email %>
69
+ <%= tag.p t("components.attachment.request_format_text"), class: "gem-c-attachment__metadata" %>
70
+ <%= render "govuk_publishing_components/components/details", {
71
+ title: t("components.attachment.request_format_cta")
72
+ } do %>
73
+ <%= t("components.attachment.request_format_details_html", alternative_format_contact_email: attachment.alternative_format_contact_email) %>
63
74
  <% end %>
64
75
  <% end %>
65
76
  <% end %>
@@ -8,7 +8,7 @@
8
8
  title: attachment.content_type_name,
9
9
  class: "gem-c-attachment-link__abbr")
10
10
  else
11
- attachment.readable_content_type
11
+ attachment.content_type_name
12
12
  end
13
13
 
14
14
  attributes << tag.span(content, class: "gem-c-attachment-link__attribute")
@@ -53,7 +53,7 @@ examples:
53
53
  filename: 20130110_Iraq_wave01.txt
54
54
  content_type: text/plain
55
55
  file_size: 108515
56
- hide_help_text: true
56
+ hide_opendocument_metadata: true
57
57
  embedded_in_govspeak:
58
58
  description: |
59
59
  This component can be embedded in Govspeak with the `[Attachment:]` code.
@@ -69,3 +69,12 @@ examples:
69
69
  filename: BEIS_Information_Asset_Register_.ods
70
70
  content_type: application/vnd.oasis.opendocument.spreadsheet
71
71
  file_size: 20000
72
+ with_contact_email:
73
+ data:
74
+ attachment:
75
+ title: "Department for Transport information asset register"
76
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/747661/department-for-transport-information-asset-register.csv
77
+ filename: department-for-transport-information-asset-register.csv
78
+ content_type: application/pdf
79
+ file_size: 20000
80
+ alternative_format_contact_email: defra.helpline@defra.gsi.gov.uk
@@ -25,6 +25,9 @@ en:
25
25
  components:
26
26
  attachment:
27
27
  opendocument_html: "This file is in an <a href='https://www.gov.uk/guidance/open-document-format-odf-guidance-for-uk-government/overview-of-productivity-software' target=%{target} class='govuk-link'>OpenDocument</a> format"
28
+ request_format_text: "This file may not be suitable for users of assistive technology."
29
+ request_format_cta: "Request a different format"
30
+ request_format_details_html: "If you use assistive technology and need a version of this document in a more accessible format, please email <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Please tell us what format you need. It will help us if you say what assistive technology you use."
28
31
  autocomplete:
29
32
  multiselect: "To select multiple items in a list, hold down Ctrl (PC) or Cmd (Mac) key."
30
33
  back_link:
@@ -7,7 +7,7 @@ module GovukPublishingComponents
7
7
 
8
8
  # Expects a hash of attachment data
9
9
  # * title and url are required
10
- # * content_type, filename, file_size, number of pages can be provided
10
+ # * content_type, filename, file_size, number of pages, alternative_format_contact_email can be provided
11
11
  def initialize(attachment_data)
12
12
  @attachment_data = attachment_data.with_indifferent_access
13
13
  end
@@ -43,6 +43,10 @@ module GovukPublishingComponents
43
43
  attachment_data[:number_of_pages]
44
44
  end
45
45
 
46
+ def alternative_format_contact_email
47
+ attachment_data[:alternative_format_contact_email]
48
+ end
49
+
46
50
  class SupportedContentType
47
51
  attr_reader :content_type_data
48
52
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '16.20.1'.freeze
2
+ VERSION = '16.21.0'.freeze
3
3
  end
@@ -49,7 +49,7 @@
49
49
  "/"
50
50
  ],
51
51
  "_resolved": "git://github.com/alphagov/accessible-autocomplete.git#0c518b4fa79b9a95b544410858486ed9e6403c84",
52
- "_shasum": "758be0437fab0bfff95fe7f440dee86ecb743279",
52
+ "_shasum": "8ca719f4ef20cf30d77527b29470f727a8fbbeb9",
53
53
  "_shrinkwrap": null,
54
54
  "_spec": "accessible-autocomplete@git://github.com/alphagov/accessible-autocomplete.git#add-multiselect-support",
55
55
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
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: 16.20.1
4
+ version: 16.21.0
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: 2019-05-17 00:00:00.000000000 Z
11
+ date: 2019-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters