govuk_publishing_components 12.6.0 → 12.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24ceb44b4f462698eac37aae0a7b7f3f97eb581a8a079ab8cc95fdb2fffdc545
4
- data.tar.gz: 5e89d14681030ec55c196e689222439a792412d449df0c49a5a34ba07611a452
3
+ metadata.gz: e5322b04a11adca1383084447447814af7ccf3f0869940019d593ebcbefc51cc
4
+ data.tar.gz: 9b5e2ee7836471caa070ab1d691e2e5659d9c10e12ac4577aed1cc04a808ad3c
5
5
  SHA512:
6
- metadata.gz: cbac9fc0b488a44d378b1324b5dcb6441db28b257d4fbc6e80065c2c56bf372d878f9b9320fdda0f0b2fef461efc87ac34cc02e4d1f171529073f293a798e2ea
7
- data.tar.gz: 95ed81d296db98e98ac644d6c5f22eada8f756b93917219f14957eac96f42b982dd5cf6462abcb035dfead053faa5643a98d5b71e050c68d70eff0766e793fb0
6
+ metadata.gz: c39b6cea6c60ace9fe44ebfd88c242e2235a4188cc549eea9e3302ec445303cbff141c11e60c050918c546c1d734f5f3dfe7344aa9fd82e45249b2eb2ce6749a
7
+ data.tar.gz: 052a8ffe732773f0503b05b680e7eb249a8b759d9eed576fe6a28120fad9b45d20b48be0c13a973f333fd5aaa3e3e1b2592ac9537a9433d8af66ee95d3bbb86b
@@ -1,9 +1,9 @@
1
- @import "design-patterns/alpha-beta";
1
+ @import "helpers/govuk-frontend-settings";
2
+ @import "govuk-frontend/components/phase-banner/phase-banner";
2
3
 
3
4
  .gem-c-phase-banner {
4
- @include phase-banner;
5
-
6
- a {
7
- @extend %govuk-link;
5
+ .govuk-phase-banner__content__app-name {
6
+ display: inline-block;
7
+ margin-right: govuk-spacing(2);
8
8
  }
9
9
  }
@@ -1,22 +1,25 @@
1
1
  <%
2
+ app_name ||= nil
2
3
  phase ||= nil
4
+ message ||= nil
3
5
 
4
6
  unless phase.in?(%w[alpha beta])
5
7
  raise ArgumentError, "The phase banner component expects a `phase` (`beta` or `alpha`), #{phase.inspect} given"
6
8
  end
9
+
10
+ unless message.present?
11
+ if phase == "beta"
12
+ message = raw("This part of GOV.UK is being rebuilt &ndash; <a href=\"/help/beta\">find out what beta means</a>")
13
+ elsif phase == "alpha"
14
+ message = raw("This part of GOV.UK is being built &ndash; <a href=\"/service-manual/phases/ideal-alphas\">find out what alpha means</a>")
15
+ end
16
+ end
7
17
  %>
8
18
 
9
- <div class="gem-c-phase-banner">
10
- <p>
11
- <strong class="phase-tag"><%= phase %></strong>
12
- <span>
13
- <% if local_assigns[:message] %>
14
- <%= local_assigns[:message] %>
15
- <% elsif phase == "beta" %>
16
- This part of GOV.UK is being rebuilt &ndash; <a href="/help/beta">find out what beta means</a>
17
- <% elsif phase == "alpha" %>
18
- This part of GOV.UK is being built &ndash; <a href="/service-manual/phases/ideal-alphas">find out what alpha means</a>
19
- <% end %>
20
- </span>
21
- </p>
22
- </div>
19
+ <%= tag.div class: "gem-c-phase-banner govuk-phase-banner" do %>
20
+ <%= tag.p class: "govuk-phase-banner__content" do %>
21
+ <%= tag.strong app_name, class: "govuk-phase-banner__content__app-name" if app_name %>
22
+ <%= tag.strong phase, class: "govuk-tag govuk-phase-banner__content__tag" %>
23
+ <%= tag.span message, class: "govuk-phase-banner__text" if message %>
24
+ <% end %>
25
+ <% end %>
@@ -19,3 +19,7 @@ examples:
19
19
  phase: beta
20
20
  message: This is an optional different message to explain what the state means in this
21
21
  context which can take <a href='https://www.gov.uk'>HTML</a>
22
+ with_app_name:
23
+ data:
24
+ app_name: Skittles Maker
25
+ phase: beta
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '12.6.0'.freeze
2
+ VERSION = '12.7.0'.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: 12.6.0
4
+ version: 12.7.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: 2018-11-08 00:00:00.000000000 Z
11
+ date: 2018-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config