pugin 0.2.0 → 0.5.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
  SHA1:
3
- metadata.gz: da4ecbf5783f861b294e469debff81bc7f186f9c
4
- data.tar.gz: fd1f958c74c9142d7abd8aa9936b6abea71df9b1
3
+ metadata.gz: accdab1a76837806ad84af124418b085e9deecec
4
+ data.tar.gz: ed05baacf0eb014615b4f5480ff6d54823b54071
5
5
  SHA512:
6
- metadata.gz: 87373363a1e0d76113a5a6e8639169ff7b8bcf405e555305f2d89496df6822eae5526fbea41968edef370cf283a76ab90ad4292a407d860af95981eacaec1a08
7
- data.tar.gz: 42c5a1b19b90655563e70533760ae5a48f04519c64f9410a0ea9a3043601378875dad106c3ec8f1eb20f4b2d688f9b62f8efa4f432fdb25ed06884422ea8aa6b
6
+ metadata.gz: f083a6c86ea482d46f00b3b945c1408bb4b5bdb97f3613c16803af9be3db1d1b140e6a1ee79a6c9e5e563f21dbd5adb6c70e20ace8feecb3b6eed5c8f7333732
7
+ data.tar.gz: baced442f23ca4f7ead2f36873a20aea7a6145063b2a7a862568fce0ac47dbcb3a2423a0fd956ec81e88680cf51f62958b799c6e8d1190bff75f2a6cbb17bd3a
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # Pugin
2
- [pugin][pugin] is a component-based pattern design library created by the [Parliamentary Digital Service][pds] that holds all of the reusable partials, styles and scripts for elements of the UK Parliament's microservices. It is named after the designer [Augustus Welby Northmore Pugin][augustus-pugin], who provided designs for the interior of the Palace of Westminster.
1
+ # Pugin Components Rails
2
+ [pugin-components-rails][pugin-components-rails] is a component-based pattern design library created by the [Parliamentary Digital Service][pds] that holds all of the reusable partials for elements of the UK Parliament's microservices.
3
3
 
4
4
  [![Build Status][shield-travis]][info-travis] [![Test Coverage][shield-coveralls]][info-coveralls] [![License][shield-license]][info-license]
5
5
 
@@ -23,7 +23,7 @@
23
23
 
24
24
 
25
25
  ## Requirements
26
- [pugin][pugin] requires the following:
26
+ [pugin-components-rails][pugin-components-rails] requires the following:
27
27
  * [Ruby][ruby] - [click here][ruby-version] for the exact version
28
28
  * [Bundler][bundler]
29
29
  * [Rails][rails]
@@ -33,7 +33,7 @@
33
33
  ## Installation
34
34
  Within your rails application, add the below to your `Gemfile`.
35
35
  ```bash
36
- gem 'pugin', '~> 0.2'
36
+ gem 'pugin'
37
37
  ```
38
38
 
39
39
 
@@ -56,8 +56,8 @@ Now all of the view components should be available within your host application.
56
56
  ## Getting Started with Development
57
57
  To clone the repository and set up the dependencies, run the following:
58
58
  ```bash
59
- git clone https://github.com/ukparliament/pugin.git
60
- cd pugin
59
+ git clone https://github.com/ukparliament/pugin-components-rails.git
60
+ cd pugin-components-rails
61
61
  bundle install
62
62
  ```
63
63
 
@@ -80,23 +80,22 @@ If you wish to submit a bug fix or feature, you can create a pull request and it
80
80
 
81
81
 
82
82
  ## License
83
- [pugin][pugin] is licensed under the [Open Parliament Licence][info-license].
84
-
85
- [ruby]: https://www.ruby-lang.org/en/
86
- [bundler]: http://bundler.io
87
- [rspec]: http://rspec.info
88
- [pugin]: https://github.com/ukparliament/pugin
89
- [pds]: https://www.parliament.uk/mps-lords-and-offices/offices/bicameral/parliamentary-digital-service/
90
- [ruby-version]: https://github.com/ukparliament/pugin/blob/master/.ruby-version
91
- [rails]: http://rubyonrails.org
92
- [haml]: http://haml.info
93
- [augustus-pugin]: https://en.wikipedia.org/wiki/Augustus_Pugin
94
-
95
- [info-travis]: https://travis-ci.org/ukparliament/pugin
96
- [shield-travis]: https://img.shields.io/travis/ukparliament/pugin.svg
97
-
98
- [info-coveralls]: https://coveralls.io/github/ukparliament/pugin
99
- [shield-coveralls]: https://img.shields.io/coveralls/ukparliament/pugin.svg
100
-
101
- [info-license]: http://www.parliament.uk/site-information/copyright/open-parliament-licence/
102
- [shield-license]: https://img.shields.io/badge/license-Open%20Parliament%20Licence-blue.svg
83
+ [pugin-components-rails][pugin-components-rails] is licensed under the [Open Parliament Licence][info-license].
84
+
85
+ [ruby]: https://www.ruby-lang.org/en/
86
+ [bundler]: http://bundler.io
87
+ [rspec]: http://rspec.info
88
+ [pugin-components-rails]: https://github.com/ukparliament/parliament.uk-pugin-components-rails
89
+ [pds]: https://www.parliament.uk/mps-lords-and-offices/offices/bicameral/parliamentary-digital-service/
90
+ [ruby-version]: https://github.com/ukparliament/pugin/blob/master/.ruby-version
91
+ [rails]: http://rubyonrails.org
92
+ [haml]: http://haml.info
93
+
94
+ [info-travis]: https://travis-ci.org/ukparliament/pugin
95
+ [shield-travis]: https://img.shields.io/travis/ukparliament/pugin.svg
96
+
97
+ [info-coveralls]: https://coveralls.io/github/ukparliament/pugin
98
+ [shield-coveralls]: https://img.shields.io/coveralls/ukparliament/pugin.svg
99
+
100
+ [info-license]: http://www.parliament.uk/site-information/copyright/open-parliament-licence/
101
+ [shield-license]: https://img.shields.io/badge/license-Open%20Parliament%20Licence-blue.svg
@@ -1,16 +1,22 @@
1
- %ol.list
2
- - people.each do |person|
3
- %li.list--item
4
- %ul.list
5
- - if person.respond_to?(:full_name) && person.respond_to?(:graph_id)
6
- %li
7
- %a{:href => "/people/#{person.graph_id}"}= person.full_name
8
- - if !person.constituencies.empty?
9
- - seat_incumbency = person.seat_incumbencies.select(&:current?).first
10
- %li
11
- MP for
12
- %a{:href => "/constituencies/#{seat_incumbency.constituency.graph_id}"}= seat_incumbency.constituency.name
13
- - if !person.parties.empty?
14
- - party_membership = person.party_memberships.select(&:current?).first
15
- %li
16
- %a{:href => "/parties/#{party_membership.party.graph_id}"}= party_membership.party.name
1
+ -if people.empty?
2
+ %ol.list
3
+ %li.list__item
4
+ %p= t('no_content.empty_list.members.description', letter: letter.upcase)
5
+ -else
6
+ %ol.list
7
+ - people.each do |person|
8
+ - if person.respond_to?(:graph_id)
9
+ %li.list__item
10
+ %h2
11
+ %a{:href => "/people/#{person.graph_id}"}= person.display_name
12
+ - if !person.statuses[:house_membership_status].empty? && !person.statuses[:house_membership_status].include?('Current MP')
13
+ %p= person.statuses[:house_membership_status].join(' and ')
14
+
15
+ - if !person.constituencies.empty?
16
+ - seat_incumbency = person.seat_incumbencies.select(&:current?).first
17
+ - unless seat_incumbency.nil?
18
+ %p= "#{t('current_mp_for')} #{seat_incumbency.constituency.name}"
19
+ - if !person.parties.empty?
20
+ - party_membership = person.party_memberships.select(&:current?).first
21
+ - unless party_membership.nil?
22
+ %p= party_membership.party.name
@@ -1,16 +1,11 @@
1
1
  %footer
2
- .c-fs.footer
3
- .c-fg
2
+ .container--full-screen.footer
3
+ .container--full-grid
4
4
  .row--indent-horizontal
5
5
  .footer__logo
6
- %img{:alt => "parliament.uk", :src => "#{Rails.application.secrets.asset_location_url}/images/parliament-uk--darkgrey.png", :srcset => "#{Rails.application.secrets.asset_location_url}/images/parliament-uk--darkgrey.svg"}/
6
+ %p= t('parliament_uk')
7
7
  %ul.footer__list
8
8
  %li
9
- Parliament.uk
10
- %a{:href => "https://pds.blog.parliament.uk/", :target => "_blank"} digital blog
9
+ %a{:href => "https://www.parliament.uk/"}= t('current_website')
11
10
  %li
12
- Visit the
13
- %a{:href => "https://www.parliament.uk/", :target => "_blank"} current parliament.uk
14
- website
15
- %li
16
- %a{:href => "/meta/cookie-policy"} Cookie Policy
11
+ %a{:href => "/meta/cookie-policy"}= t('cookie_policy')
@@ -1,7 +1,6 @@
1
1
  %header
2
- .c-fs.header
3
- .c-fg
2
+ .container--full-screen.header
3
+ .container--full-grid
4
4
  .row--indent-horizontal
5
5
  .header__logo
6
- %a{:href => "/"}
7
- %img{:alt => "parliament.uk", :src => "#{Rails.application.secrets.asset_location_url}/images/parliament-uk--white.png", :srcset => "#{Rails.application.secrets.asset_location_url}/images/parliament-uk--white.svg"}/
6
+ %a{:href => "/"}= t('parliament_header')
@@ -1,6 +1,5 @@
1
1
  .highlight__status
2
- %div{class: "c-fs status#{ status.nil? ? '' : "__#{status}" }"}
3
- .c-fg
2
+ %div{class: "container--full-screen status#{ status.nil? ? '' : "__#{status}" }"}
3
+ .container--full-grid
4
4
  .row--indent-horizontal
5
- %p This is a #{link_to '<strong>BETA</strong>'.html_safe, '/' }. Give #{link_to 'feedback', 'https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&redirectlink=%2F&cancelRedirectLink=%2F&category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf'.html_safe} to improve it.
6
-
5
+ %p This is a test website, so may be inaccurate or misleading - #{link_to 'give feedback', 'https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&redirectlink=%2F&cancelRedirectLink=%2F&category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf', target: '_blank', title: 'website opens in a new window'.html_safe} to help improve it. Return to #{link_to 'current website', 'https://www.parliament.uk'}.
@@ -0,0 +1 @@
1
+ %a.sr-only.sr-only--focusable{:href => "#content", :id => "skiplink"} Skip to main content
@@ -2,4 +2,4 @@
2
2
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
3
3
  j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
4
4
  'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
5
- })(window,document,'script','dataLayer','#{Rails.application.secrets.gtm_key}');</script>
5
+ })(window,document,'script','dataLayer','#{ENV['GTM_KEY']}');</script>
@@ -1,2 +1,2 @@
1
- <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=#{Rails.application.secrets.gtm_key}"
1
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=#{ENV['GTM_KEY']}"
2
2
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
@@ -1,23 +1,22 @@
1
1
  !!! 5
2
2
  %html{lang:'en'}
3
3
  %head
4
- %title Parliamentary Digital Service
5
- %link{rel: 'stylesheet', href: "#{Rails.application.secrets.asset_location_url}/stylesheets/main.css" }
6
- %meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0' }
4
+ %title= content_for?(:title) ? content_for(:title) + ' - ' + t('website_brand') : t('website_brand')
5
+ %link{rel: 'stylesheet', href: "#{ENV['ASSET_LOCATION_URL']}/#{Pugin::ASSET_VERSION}/stylesheets/main.css" }
6
+ %meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0'}
7
+ %meta{'http-equiv': 'X-UA-Compatible', content: 'IE=edge'}
7
8
  = favicon_link_tag 'pugin/favicon.ico'
8
9
  - if Rails.application.secrets.gtm_key
9
10
  = render partial: 'pugin/javascript/google_tag_manager'
10
- %body
11
+ %body.no-js
11
12
  - if Rails.application.secrets.gtm_key
12
13
  = render partial: 'pugin/javascript/google_tag_manager_noscript'
14
+ = render partial: 'pugin/elements/skip-content'
15
+ = render 'pugin/components/header'
16
+ = render partial: 'pugin/components/status', locals: { status: nil }
13
17
  %main#content
14
- %a#top
15
- = render 'pugin/components/header'
16
- = render partial: 'pugin/components/status', locals: { status: nil }
17
- .c-fg
18
+ .container--full-grid
18
19
  .row--indent-full
19
20
  = yield
20
- .footer-push
21
21
  = render 'pugin/components/footer'
22
- = javascript_include_tag 'pugin/pugin', 'data-turbolinks-track' => true
23
- -#%script{src: 'http://CDN.com/app.js'}
22
+ %script{src: "#{ENV['ASSET_LOCATION_URL']}/#{Pugin::ASSET_VERSION}/javascripts/main.js"}
@@ -0,0 +1,13 @@
1
+ en:
2
+ website_brand: "UK Parliament"
3
+ current_mp_for: "Current MP for"
4
+ parliament_uk: "Parliament.uk"
5
+ open_new_window: "web site opens in a new window"
6
+ pds_blog: "Parliamentary Digital Service blog"
7
+ current_website: "Current Parliament.uk website"
8
+ cookie_policy: "Cookie Policy"
9
+ parliament_header: "UK Parliament"
10
+ no_content:
11
+ empty_list:
12
+ members:
13
+ description: "Sorry there are no results for '%{letter}'"
data/lib/pugin.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'pugin/engine'
2
+ require 'pugin/version'
2
3
 
3
4
  module Pugin
4
5
  # Your code goes here...
data/lib/pugin/version.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  module Pugin
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
+ ASSET_VERSION = '1.2.6'.freeze
3
4
  end
data/spec/pugin_spec.rb CHANGED
@@ -4,4 +4,12 @@ describe Pugin do
4
4
  it 'is a module' do
5
5
  expect(Pugin).to be_a(Module)
6
6
  end
7
+
8
+ it 'has a version' do
9
+ expect(Pugin::VERSION).not_to be_nil
10
+ end
11
+
12
+ it 'has an asset version' do
13
+ expect(Pugin::ASSET_VERSION).not_to be_nil
14
+ end
7
15
  end
@@ -17,7 +17,7 @@ describe 'pugin/cards/_person-list.html.haml', type: :view do
17
17
 
18
18
  before :each do
19
19
  @people = [person]
20
- allow(person).to receive(:full_name).and_return('Jane Smith')
20
+ allow(person).to receive(:display_name).and_return('Jane Smith')
21
21
  allow(person).to receive(:graph_id).and_return('123')
22
22
 
23
23
  allow(constituency1).to receive(:name).and_return('Hackney')
@@ -44,6 +44,7 @@ describe 'pugin/cards/_person-list.html.haml', type: :view do
44
44
 
45
45
  allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
46
46
  allow(person).to receive(:constituencies).and_return([constituency1,constituency2])
47
+ allow(person).to receive(:statuses).and_return({house_membership_status: ['Current MP']})
47
48
  allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
48
49
  allow(person).to receive(:parties).and_return([party1,party2])
49
50
  end
@@ -54,19 +55,12 @@ describe 'pugin/cards/_person-list.html.haml', type: :view do
54
55
  expect(rendered).to eq(
55
56
  <<DATA
56
57
  <ol class='list'>
57
- <li class='list--item'>
58
- <ul class='list'>
59
- <li>
58
+ <li class='list__item'>
59
+ <h2>
60
60
  <a href='/people/123'>Jane Smith</a>
61
- </li>
62
- <li>
63
- MP for
64
- <a href='/constituencies/123'>Hackney</a>
65
- </li>
66
- <li>
67
- <a href='/parties/123'>Labour</a>
68
- </li>
69
- </ul>
61
+ </h2>
62
+ <p>Current MP for Hackney</p>
63
+ <p>Labour</p>
70
64
  </li>
71
65
  </ol>
72
66
  DATA
@@ -74,6 +68,27 @@ DATA
74
68
  end
75
69
  end
76
70
 
71
+ context 'with no people' do
72
+ before :each do
73
+ @people = []
74
+ end
75
+
76
+ it 'renders as expected' do
77
+ render partial: 'pugin/cards/person-list', locals: { people: @people, letter: 'a' }
78
+
79
+ expect(response).to eq(<<DATA
80
+ <ol class='list'>
81
+ <li class='list__item'>
82
+ <p>Sorry there are no results for 'A'</p>
83
+ </li>
84
+ </ol>
85
+ DATA
86
+ )
87
+ end
88
+
89
+ end
90
+
91
+
77
92
  context 'with no data' do
78
93
  let(:person) { Class.new }
79
94
 
@@ -89,10 +104,6 @@ DATA
89
104
  expect(rendered).to eq(
90
105
  <<DATA
91
106
  <ol class='list'>
92
- <li class='list--item'>
93
- <ul class='list'>
94
- </ul>
95
- </li>
96
107
  </ol>
97
108
  DATA
98
109
  )
@@ -105,6 +116,9 @@ DATA
105
116
  before :each do
106
117
  @people = [person]
107
118
 
119
+ allow(person).to receive(:display_name).and_return('')
120
+ allow(person).to receive(:graph_id).and_return('123')
121
+
108
122
  allow(constituency1).to receive(:name).and_return('Hackney')
109
123
  allow(constituency1).to receive(:graph_id).and_return('123')
110
124
  allow(constituency2).to receive(:name).and_return('Stoke')
@@ -129,6 +143,7 @@ DATA
129
143
 
130
144
  allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
131
145
  allow(person).to receive(:constituencies).and_return([constituency1,constituency2])
146
+ allow(person).to receive(:statuses).and_return({house_membership_status: ['Current MP']})
132
147
  allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
133
148
  allow(person).to receive(:parties).and_return([party1,party2])
134
149
  end
@@ -139,16 +154,12 @@ DATA
139
154
  expect(rendered).to eq(
140
155
  <<DATA
141
156
  <ol class='list'>
142
- <li class='list--item'>
143
- <ul class='list'>
144
- <li>
145
- MP for
146
- <a href='/constituencies/123'>Hackney</a>
147
- </li>
148
- <li>
149
- <a href='/parties/123'>Labour</a>
150
- </li>
151
- </ul>
157
+ <li class='list__item'>
158
+ <h2>
159
+ <a href='/people/123'></a>
160
+ </h2>
161
+ <p>Current MP for Hackney</p>
162
+ <p>Labour</p>
152
163
  </li>
153
164
  </ol>
154
165
  DATA
@@ -162,7 +173,7 @@ DATA
162
173
  before :each do
163
174
  @people = [person]
164
175
 
165
- allow(person).to receive(:full_name).and_return('Jane Smith')
176
+ allow(person).to receive(:display_name).and_return('Jane Smith')
166
177
  allow(person).to receive(:graph_id).and_return('123')
167
178
 
168
179
  allow(party1).to receive(:name).and_return('Labour')
@@ -178,6 +189,7 @@ DATA
178
189
 
179
190
  allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
180
191
  allow(person).to receive(:constituencies).and_return([])
192
+ allow(person).to receive(:statuses).and_return({house_membership_status: ['Current MP']})
181
193
  allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
182
194
  allow(person).to receive(:parties).and_return([party1,party2])
183
195
  end
@@ -188,15 +200,11 @@ DATA
188
200
  expect(rendered).to eq(
189
201
  <<DATA
190
202
  <ol class='list'>
191
- <li class='list--item'>
192
- <ul class='list'>
193
- <li>
203
+ <li class='list__item'>
204
+ <h2>
194
205
  <a href='/people/123'>Jane Smith</a>
195
- </li>
196
- <li>
197
- <a href='/parties/123'>Labour</a>
198
- </li>
199
- </ul>
206
+ </h2>
207
+ <p>Labour</p>
200
208
  </li>
201
209
  </ol>
202
210
  DATA
@@ -209,7 +217,7 @@ DATA
209
217
 
210
218
  before :each do
211
219
  @people = [person]
212
- allow(person).to receive(:full_name).and_return('Jane Smith')
220
+ allow(person).to receive(:display_name).and_return('Jane Smith')
213
221
  allow(person).to receive(:graph_id).and_return('123')
214
222
 
215
223
  allow(constituency1).to receive(:name).and_return('Hackney')
@@ -225,6 +233,7 @@ DATA
225
233
 
226
234
  allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
227
235
  allow(person).to receive(:constituencies).and_return([constituency1,constituency2])
236
+ allow(person).to receive(:statuses).and_return({house_membership_status: ['Current MP']})
228
237
  allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
229
238
  allow(person).to receive(:parties).and_return([])
230
239
  end
@@ -235,16 +244,11 @@ DATA
235
244
  expect(rendered).to eq(
236
245
  <<DATA
237
246
  <ol class='list'>
238
- <li class='list--item'>
239
- <ul class='list'>
240
- <li>
247
+ <li class='list__item'>
248
+ <h2>
241
249
  <a href='/people/123'>Jane Smith</a>
242
- </li>
243
- <li>
244
- MP for
245
- <a href='/constituencies/123'>Hackney</a>
246
- </li>
247
- </ul>
250
+ </h2>
251
+ <p>Current MP for Hackney</p>
248
252
  </li>
249
253
  </ol>
250
254
  DATA
@@ -6,24 +6,17 @@ describe 'pugin/components/_footer.html.haml', type: :view do
6
6
  it 'renders as expected' do
7
7
  render
8
8
 
9
- expect(response).to eq(
10
- <<DATA
9
+ expect(response).to eq(<<DATA
11
10
  <footer>
12
- <div class='c-fs footer'>
13
- <div class='c-fg'>
11
+ <div class='container--full-screen footer'>
12
+ <div class='container--full-grid'>
14
13
  <div class='row--indent-horizontal'>
15
14
  <div class='footer__logo'>
16
- <img alt='parliament.uk' src='/images/parliament-uk--darkgrey.png' srcset='/images/parliament-uk--darkgrey.svg'>
15
+ <p>Parliament.uk</p>
17
16
  </div>
18
17
  <ul class='footer__list'>
19
18
  <li>
20
- Parliament.uk
21
- <a href='https://pds.blog.parliament.uk/' target='_blank'>digital blog</a>
22
- </li>
23
- <li>
24
- Visit the
25
- <a href='https://www.parliament.uk/' target='_blank'>current parliament.uk</a>
26
- website
19
+ <a href='https://www.parliament.uk/'>Current Parliament.uk website</a>
27
20
  </li>
28
21
  <li>
29
22
  <a href='/meta/cookie-policy'>Cookie Policy</a>
@@ -8,13 +8,11 @@ describe 'pugin/components/_header.html.haml', type: :view do
8
8
 
9
9
  expect(response).to eq(<<DATA
10
10
  <header>
11
- <div class='c-fs header'>
12
- <div class='c-fg'>
11
+ <div class='container--full-screen header'>
12
+ <div class='container--full-grid'>
13
13
  <div class='row--indent-horizontal'>
14
14
  <div class='header__logo'>
15
- <a href='/'>
16
- <img alt='parliament.uk' src='#{Rails.application.secrets.asset_location_url}/images/parliament-uk--white.png' srcset='#{Rails.application.secrets.asset_location_url}/images/parliament-uk--white.svg'>
17
- </a>
15
+ <a href='/'>UK Parliament</a>
18
16
  </div>
19
17
  </div>
20
18
  </div>
@@ -10,10 +10,10 @@ describe 'pugin/components/_status.html.haml', type: :view do
10
10
  expect(response).to eq(
11
11
  <<DATA
12
12
  <div class='highlight__status'>
13
- <div class='c-fs status'>
14
- <div class='c-fg'>
13
+ <div class='container--full-screen status'>
14
+ <div class='container--full-grid'>
15
15
  <div class='row--indent-horizontal'>
16
- <p>This is a <a href="/"><strong>BETA</strong></a>. Give <a href="https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&redirectlink=%2F&cancelRedirectLink=%2F&category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf">feedback</a> to improve it.</p>
16
+ <p>This is a test website, so may be inaccurate or misleading - <a target="_blank" title="website opens in a new window" href="https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&amp;redirectlink=%2F&amp;cancelRedirectLink=%2F&amp;category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf">give feedback</a> to help improve it. Return to <a href="https://www.parliament.uk">current website</a>.</p>
17
17
  </div>
18
18
  </div>
19
19
  </div>
@@ -30,10 +30,10 @@ DATA
30
30
  expect(rendered).to eq(
31
31
  <<DATA
32
32
  <div class='highlight__status'>
33
- <div class='c-fs status__test'>
34
- <div class='c-fg'>
33
+ <div class='container--full-screen status__test'>
34
+ <div class='container--full-grid'>
35
35
  <div class='row--indent-horizontal'>
36
- <p>This is a <a href="/"><strong>BETA</strong></a>. Give <a href="https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&redirectlink=%2F&cancelRedirectLink=%2F&category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf">feedback</a> to improve it.</p>
36
+ <p>This is a test website, so may be inaccurate or misleading - <a target="_blank" title="website opens in a new window" href="https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&amp;redirectlink=%2F&amp;cancelRedirectLink=%2F&amp;category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf">give feedback</a> to help improve it. Return to <a href="https://www.parliament.uk">current website</a>.</p>
37
37
  </div>
38
38
  </div>
39
39
  </div>
@@ -13,8 +13,7 @@ describe 'pugin/layouts/pugin.html.haml', type: :view do
13
13
 
14
14
  it 'renders HAML without errors' do
15
15
  render
16
-
17
- expect(rendered).to include('<title>Parliamentary Digital Service</title>')
16
+ expect(rendered).to have_title(I18n.t('website_brand'))
18
17
  end
19
18
  end
20
- end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Rayner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-20 00:00:00.000000000 Z
11
+ date: 2017-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -182,10 +182,12 @@ files:
182
182
  - app/views/pugin/components/_footer.html.haml
183
183
  - app/views/pugin/components/_header.html.haml
184
184
  - app/views/pugin/components/_status.html.haml
185
+ - app/views/pugin/elements/_skip-content.html.haml
185
186
  - app/views/pugin/javascript/_google_tag_manager.html.haml
186
187
  - app/views/pugin/javascript/_google_tag_manager_noscript.html.haml
187
188
  - app/views/pugin/layouts/pugin.html.haml
188
189
  - config/application.rb
190
+ - config/locales/en.yml
189
191
  - config/routes.rb
190
192
  - lib/pugin.rb
191
193
  - lib/pugin/engine.rb