pugin 0.5.0 → 0.5.1
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 +4 -4
- data/app/views/pugin/cards/_person-list.html.haml +1 -2
- data/app/views/pugin/components/_footer.html.haml +3 -3
- data/app/views/pugin/components/_header.html.haml +1 -1
- data/app/views/pugin/components/_letter-navigation.html.haml +12 -0
- data/app/views/pugin/components/_status.html.haml +1 -1
- data/app/views/pugin/layouts/pugin.html.haml +1 -1
- data/config/locales/en.yml +20 -8
- data/lib/pugin.rb +1 -0
- data/lib/pugin/railtie.rb +8 -0
- data/lib/pugin/version.rb +1 -1
- data/lib/pugin/view_helpers.rb +11 -0
- data/spec/views/pugin/layouts/pugin.html.haml_spec.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62bf27bdd194a29bd4ef82af08511111f2a83dde
|
|
4
|
+
data.tar.gz: 6a4d1408767111ab9aed5132cebbc996ffd6e2f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e794680324924450484be4508cc7627c23286e8ba3b866e5801bbc64d8745816ab1db05993f8b7f0b9f29546155d3437e067b8154d021c2c2deb7f90b9decdb5
|
|
7
|
+
data.tar.gz: 84b54d81a475f5fe9409c624212d3b11b78b0f90ee7e7dd178a3b23cc7a83b8f5187a9f4a1f32a156043e7f4ef1b4422a7bd05ccd5dc6d8b885647477fa71b52
|
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
%a{:href => "/people/#{person.graph_id}"}= person.display_name
|
|
12
12
|
- if !person.statuses[:house_membership_status].empty? && !person.statuses[:house_membership_status].include?('Current MP')
|
|
13
13
|
%p= person.statuses[:house_membership_status].join(' and ')
|
|
14
|
-
|
|
15
14
|
- if !person.constituencies.empty?
|
|
16
15
|
- seat_incumbency = person.seat_incumbencies.select(&:current?).first
|
|
17
16
|
- unless seat_incumbency.nil?
|
|
18
|
-
%p= "#{t('current_mp_for')} #{seat_incumbency.constituency.name}"
|
|
17
|
+
%p= "#{t('.current_mp_for')} #{seat_incumbency.constituency.name}"
|
|
19
18
|
- if !person.parties.empty?
|
|
20
19
|
- party_membership = person.party_memberships.select(&:current?).first
|
|
21
20
|
- unless party_membership.nil?
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
.container--full-grid
|
|
4
4
|
.row--indent-horizontal
|
|
5
5
|
.footer__logo
|
|
6
|
-
%p= t('parliament_uk')
|
|
6
|
+
%p= t('.parliament_uk')
|
|
7
7
|
%ul.footer__list
|
|
8
8
|
%li
|
|
9
|
-
%a{:href => "https://www.parliament.uk/"}= t('current_website')
|
|
9
|
+
%a{:href => "https://www.parliament.uk/"}= t('.current_website')
|
|
10
10
|
%li
|
|
11
|
-
%a{:href => "/meta/cookie-policy"}= t('cookie_policy')
|
|
11
|
+
%a{:href => "/meta/cookie-policy"}= t('.cookie_policy')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.block
|
|
2
|
+
%p.lead
|
|
3
|
+
A to Z -
|
|
4
|
+
= params[:letter].present? ? "Showing results for #{params[:letter].capitalize}" : 'select a letter'
|
|
5
|
+
%nav{ aria:{ label: t('a_to_z.aria_label') } }
|
|
6
|
+
%ul.navigation__letter
|
|
7
|
+
- ('a'..'z').each do |letter|
|
|
8
|
+
%li{ data: { letter: letter }, class: ('active' if (params[:letter] == letter)) }
|
|
9
|
+
- if @letters.include?(letter.upcase)
|
|
10
|
+
= navigation_link(route_symbol: route_symbol, letter: letter, primary_id: local_assigns.fetch(:primary_id, nil), secondary_id: local_assigns.fetch(:secondary_id, nil))
|
|
11
|
+
- else
|
|
12
|
+
= letter
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
%div{class: "container--full-screen status#{ status.nil? ? '' : "__#{status}" }"}
|
|
3
3
|
.container--full-grid
|
|
4
4
|
.row--indent-horizontal
|
|
5
|
-
%p
|
|
5
|
+
%p #{t('.status_text_1')} - #{link_to t('.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: t('open_new_window')} #{t('.status_text_2')} #{link_to t('.current_website'), 'https://www.parliament.uk'}.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
!!! 5
|
|
2
2
|
%html{lang:'en'}
|
|
3
3
|
%head
|
|
4
|
-
%title= content_for?(:title) ? content_for(:title) + ' - ' + t('website_brand') : t('website_brand')
|
|
4
|
+
%title= content_for?(:title) ? content_for(:title) + ' - ' + t('.website_brand') : t('.website_brand')
|
|
5
5
|
%link{rel: 'stylesheet', href: "#{ENV['ASSET_LOCATION_URL']}/#{Pugin::ASSET_VERSION}/stylesheets/main.css" }
|
|
6
6
|
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0'}
|
|
7
7
|
%meta{'http-equiv': 'X-UA-Compatible', content: 'IE=edge'}
|
data/config/locales/en.yml
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
en:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
pugin:
|
|
3
|
+
cards:
|
|
4
|
+
person-list:
|
|
5
|
+
current_mp_for: "Current MP for"
|
|
6
|
+
components:
|
|
7
|
+
header:
|
|
8
|
+
parliament_header: "UK Parliament"
|
|
9
|
+
status:
|
|
10
|
+
current_website: 'current website'
|
|
11
|
+
status_text_1: 'This is a test website, so may be inaccurate or misleading'
|
|
12
|
+
status_text_2: 'to help improve it. Return to'
|
|
13
|
+
give_feedback: 'give feedback'
|
|
14
|
+
footer:
|
|
15
|
+
parliament_uk: "Parliament.uk"
|
|
16
|
+
current_website: "Current Parliament.uk website"
|
|
17
|
+
cookie_policy: "Cookie Policy"
|
|
18
|
+
layouts:
|
|
19
|
+
pugin:
|
|
20
|
+
website_brand: "UK Parliament"
|
|
21
|
+
open_new_window: "website opens in a new window"
|
|
10
22
|
no_content:
|
|
11
23
|
empty_list:
|
|
12
24
|
members:
|
data/lib/pugin.rb
CHANGED
data/lib/pugin/version.rb
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module Pugin
|
|
2
|
+
module ViewHelpers
|
|
3
|
+
def navigation_link(route_symbol:, letter:, primary_id: nil, secondary_id: nil)
|
|
4
|
+
url = send(route_symbol, primary_id, secondary_id, letter) if primary_id && secondary_id
|
|
5
|
+
url = send(route_symbol, primary_id, letter) if primary_id && secondary_id.nil?
|
|
6
|
+
url = send(route_symbol, letter) unless url
|
|
7
|
+
|
|
8
|
+
return link_to(letter, url, data: { 'atoz-see': 'true' })
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -13,7 +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
|
-
expect(rendered).to have_title(I18n.t('website_brand'))
|
|
16
|
+
expect(rendered).to have_title(I18n.t('.pugin.layouts.pugin.website_brand'))
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
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.5.
|
|
4
|
+
version: 0.5.1
|
|
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-03-
|
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -181,6 +181,7 @@ files:
|
|
|
181
181
|
- app/views/pugin/cards/_person-list.html.haml
|
|
182
182
|
- app/views/pugin/components/_footer.html.haml
|
|
183
183
|
- app/views/pugin/components/_header.html.haml
|
|
184
|
+
- app/views/pugin/components/_letter-navigation.html.haml
|
|
184
185
|
- app/views/pugin/components/_status.html.haml
|
|
185
186
|
- app/views/pugin/elements/_skip-content.html.haml
|
|
186
187
|
- app/views/pugin/javascript/_google_tag_manager.html.haml
|
|
@@ -191,7 +192,9 @@ files:
|
|
|
191
192
|
- config/routes.rb
|
|
192
193
|
- lib/pugin.rb
|
|
193
194
|
- lib/pugin/engine.rb
|
|
195
|
+
- lib/pugin/railtie.rb
|
|
194
196
|
- lib/pugin/version.rb
|
|
197
|
+
- lib/pugin/view_helpers.rb
|
|
195
198
|
- lib/tasks/pugin_tasks.rake
|
|
196
199
|
- spec/dummy/Rakefile
|
|
197
200
|
- spec/dummy/app/assets/config/manifest.js
|