pugin 1.3.1 → 1.4.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
  SHA1:
3
- metadata.gz: 21155ec1b0d35348a4a36c06779930e029640a84
4
- data.tar.gz: be85a1ffa2cc92346541f53a0916245c73212823
3
+ metadata.gz: 8a5b6e369134c7091a88ca167a361d95facaddbc
4
+ data.tar.gz: 5c74be1364544a07ce711166f134d6c0cfd30c34
5
5
  SHA512:
6
- metadata.gz: 2be2a35269c81cb83f2fd9ae3c4506ebd9b60f09d86a238e787245a32ff81ebac0f96295a2b91fb0b4a90e372cab9f6c1898d26e3da0e53a607a0f74fc85a1fa
7
- data.tar.gz: d1c8ad210131eed9374bed5736498fee411c0d1d5d4a8b40d3dd6d9eaf1e1faa38f7ca9093580ba82cd434a85d8c58f449b1e6a07feed05f010ea023d810776d
6
+ metadata.gz: 4a6eb720e7916fde7a28becdcb9f59d3dfb6c5b1b51ad7891b3ecc03c6f244f5f7275c9c85565f89f0cf6941f43b01845dcb5d1ab087858d516da2bda399d233
7
+ data.tar.gz: a52bdbb2717ad7871e49f0622348654c6bed6a83a8f12035429f1a8078990345c038d8050c32d89fed9c3f35104bb0949ceb8fccf0376221ad7315431f01ecd4
@@ -2,7 +2,5 @@
2
2
  .container
3
3
  %h2.logo= I18n.t('pugin.components.footer.uk_parliament')
4
4
  %ul.list
5
- %li
6
- %a{:href => 'https://www.parliament.uk/'}= I18n.t('pugin.components.footer.current_website')
7
- %li
8
- %a{:href => 'http://beta.parliament.uk/meta/cookie-policy'}= I18n.t('pugin.components.footer.cookie_policy')
5
+ %li= link_to( I18n.t('pugin.components.footer.current_website'), root_path() )
6
+ %li= link_to( I18n.t('pugin.components.footer.cookie_policy'), meta_cookie_policy_path() )
@@ -17,10 +17,10 @@
17
17
  %link{rel: 'alternate', type: alternate[:type], href: alternate[:href]}
18
18
  %body
19
19
  = render partial: 'pugin/javascript/has_js'
20
- = render partial: 'pugin/components/status-cookie'
21
20
  - if ENV['GTM_KEY']
22
21
  = render partial: 'pugin/javascript/google_tag_manager_noscript'
23
22
  = render partial: 'pugin/elements/skip-content'
23
+ = render partial: 'pugin/components/status-cookie'
24
24
  = render partial: 'pugin/components/status', locals: { status: nil } if Pugin::Feature::StatusBanner.enabled?
25
25
  = render 'pugin/components/header'
26
26
  = render partial: 'pugin/components/navigation-main' if Pugin::Feature::TopNavigation.enabled?
@@ -32,6 +32,12 @@ module Pugin
32
32
 
33
33
  @features.fetch('show-committees', false)
34
34
  end
35
+ def show_government_roles?
36
+ get_features
37
+
38
+ @features.fetch('show-government-roles', false)
39
+ end
40
+
35
41
 
36
42
 
37
43
  # Reset cached features
@@ -47,5 +53,5 @@ module Pugin
47
53
  end
48
54
  end
49
55
  end
50
- end
56
+ end
51
57
  end
data/lib/pugin/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pugin
2
- VERSION = '1.3.1'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
@@ -9,7 +9,8 @@ describe 'The bandiera client feature set' do
9
9
  'show-election': :election?,
10
10
  'show-post-election': :post_election?,
11
11
  'show-list-images': :show_list_images?,
12
- 'show-committees': :show_committees?
12
+ 'show-committees': :show_committees?,
13
+ 'show-government-roles': :show_government_roles?
13
14
  }
14
15
 
15
16
  method_hash.each do |flag_name, method_name|
@@ -3,20 +3,21 @@ require 'haml'
3
3
 
4
4
  describe 'pugin/components/_footer.html.haml', type: :view do
5
5
 
6
- it 'renders as expected' do
6
+ before do
7
+ allow(view).to receive(:root_path).and_return("/")
8
+ allow(view).to receive(:meta_cookie_policy_path).and_return("/meta/cookie-policy")
9
+
7
10
  render
11
+ end
8
12
 
13
+ it 'renders as expected' do
9
14
  expect(response).to eq(<<DATA
10
15
  <footer>
11
16
  <div class='container'>
12
17
  <h2 class='logo'>UK Parliament</h2>
13
18
  <ul class='list'>
14
- <li>
15
- <a href='https://www.parliament.uk/'>Current Parliament.uk website</a>
16
- </li>
17
- <li>
18
- <a href='http://beta.parliament.uk/meta/cookie-policy'>Cookie Policy</a>
19
- </li>
19
+ <li><a href="/">Current Parliament.uk website</a></li>
20
+ <li><a href="/meta/cookie-policy">Cookie Policy</a></li>
20
21
  </ul>
21
22
  </div>
22
23
  </footer>
@@ -20,6 +20,7 @@ describe 'pugin/layouts/_layout.html.haml', type: :view do
20
20
  allow(view).to receive(:house_parties_current_path).and_return("houses/#{Parliament::Utils::Helpers::HousesHelper.commons_id}/parties/current/")
21
21
  allow(view).to receive(:find_your_constituency_path).and_return("/find-your-constituency")
22
22
  allow(view).to receive(:opensearch_description_url).and_return("http://localhost:3000/search/opensearch")
23
+ allow(view).to receive(:root_path).and_return("/")
23
24
  allow(view).to receive(:meta_cookie_policy_path).and_return("/meta/cookie-policy")
24
25
  end
25
26
 
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: 1.3.1
4
+ version: 1.4.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-10-02 00:00:00.000000000 Z
11
+ date: 2017-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails