pugin 1.6.23 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/pugin/cards/_person-list.haml +19 -17
- data/app/views/pugin/committees/list/_list.html.haml +7 -6
- data/app/views/pugin/components/_status.haml +1 -2
- data/app/views/pugin/constituencies/list/_list.html.haml +24 -23
- data/app/views/pugin/people/list/lord/_lord.html.haml +22 -21
- data/app/views/pugin/people/list/member/_member.html.haml +26 -25
- data/lib/pugin.rb +1 -1
- data/lib/pugin/version.rb +1 -1
- data/spec/views/pugin/cards/_person-list.html.haml_spec.rb +15 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78d4be137c2b99ece40c087b06cbae3746902c0a
|
4
|
+
data.tar.gz: db6c8d049ec4d22175a5fca5c751965a1e584c08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c46fa0ecb211eefe905ce031476ab1cd1167db2644d33e76ba324beb54156a55dc30bea6cc90f293fe8e3d1d746fa2edecdec73ede0a5898457532d73a3628
|
7
|
+
data.tar.gz: 2c880c8c64bc83a1a4fa636d4400a173d32f998807e96c0659e8371842365bb176e575f06e32ff0a791615d7de884c14630e4b898e6d9c0cc93d0c5169970196
|
@@ -1,25 +1,27 @@
|
|
1
1
|
-if people.empty?
|
2
2
|
%ol.list--block
|
3
3
|
%li
|
4
|
-
.
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
.card
|
5
|
+
.card__details
|
6
|
+
%p
|
7
|
+
= "#{I18n.t('no_content.empty_list.members.description')}"
|
8
|
+
= params[:letter].nil? ? "" : "#{I18n.t('no_content.empty_list.members.for')} '#{params[:letter].upcase}'"
|
8
9
|
-else
|
9
10
|
%ol.list--block
|
10
11
|
- people.each do |person|
|
11
12
|
- if person.respond_to?(:graph_id)
|
12
13
|
%li
|
13
|
-
.
|
14
|
-
|
15
|
-
%
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
-
|
24
|
-
|
25
|
-
|
14
|
+
.card
|
15
|
+
.card__details
|
16
|
+
%h2
|
17
|
+
%a{:href => "/people/#{person.graph_id}"}= person.display_name
|
18
|
+
- if !person.statuses[:house_membership_status].empty? && !person.statuses[:house_membership_status].include?('Current MP')
|
19
|
+
%p= person.statuses[:house_membership_status].join(' and ')
|
20
|
+
- if person.constituencies.any?
|
21
|
+
- seat_incumbency = person.seat_incumbencies.select(&:current?).first
|
22
|
+
- if seat_incumbency && seat_incumbency.constituency
|
23
|
+
%p= "#{I18n.t('pugin.cards.person-list.current_mp_for')} #{seat_incumbency.constituency.name}"
|
24
|
+
- if !person.parties.empty?
|
25
|
+
- party_membership = person.party_memberships.select(&:current?).first
|
26
|
+
- unless party_membership.nil?
|
27
|
+
%p= party_membership.party.name
|
@@ -1,7 +1,8 @@
|
|
1
1
|
%li
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
.card
|
3
|
+
.card__details
|
4
|
+
- if committees.respond_to?(:name)
|
5
|
+
%h2= committees.name
|
6
|
+
- else
|
7
|
+
%h2= committees.formal_body.name
|
8
|
+
%p= "" ? committees.date_range : committees.formal_body.date_range
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.status--banner__beta
|
2
2
|
.container
|
3
3
|
%span.hint= I18n.t('pugin.hints.beta')
|
4
|
-
%ul.list--
|
4
|
+
%ul.list--inline
|
5
5
|
%li
|
6
6
|
= I18n.t('pugin.components.status.beta.pages_being_tested',
|
7
7
|
link: link_to(t('pugin.components.status.beta.give_feedback'),
|
@@ -23,4 +23,3 @@
|
|
23
23
|
= I18n.t('pugin.components.status.election_day_text')
|
24
24
|
= succeed "." do
|
25
25
|
%a{ href: 'http://www.parliament.uk/get-involved/elections/voting/' }= I18n.t('pugin.components.status.how_to_vote')
|
26
|
-
|
@@ -1,25 +1,26 @@
|
|
1
1
|
%li
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
%
|
6
|
-
|
7
|
-
|
8
|
-
- constituencies.
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
%
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
2
|
+
.card
|
3
|
+
.card__details
|
4
|
+
- if !instance_variable_get("@parliament").nil? # parliament member
|
5
|
+
%h2
|
6
|
+
%a{:href => "/constituencies/#{constituencies.graph_id}"}= constituencies.name
|
7
|
+
-# Constituency has a member? TRUE = Member's Name : FALSE = "Vacant" text
|
8
|
+
- unless constituencies.members.empty?
|
9
|
+
- constituencies.seat_incumbencies.each do |incumbency|
|
10
|
+
%p= "#{incumbency.member.display_name} #{t('pugin.constituencies.list.from')} #{l(incumbency.start_date, format: :default)} - #{l(incumbency.end_date, format: :default)}"
|
11
|
+
- incumbency.member.party_memberships.each do |member_party|
|
12
|
+
%p= member_party.party.name
|
13
|
+
- elsif constituencies.current?
|
14
|
+
%h2
|
15
|
+
%a{:href => "/constituencies/#{constituencies.graph_id}"}= constituencies.name
|
16
|
+
-# Constituency has a member? TRUE = Member's Name : FALSE = "Vacant" text
|
17
|
+
- if !constituencies.members.empty?
|
18
|
+
%p= constituencies.current_member_display_name
|
19
|
+
%p= constituencies.current_member_party_name
|
20
|
+
- else
|
21
|
+
%p= I18n.t('pugin.constituencies.list.current_constituency.vacant').capitalize
|
19
22
|
- else
|
20
|
-
%
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
%a{:href => "/constituencies/#{constituencies.graph_id}"}= "#{constituencies.name}#{date_string}"
|
25
|
-
%p= "#{t('pugin.constituencies.list.former_constituency.former').capitalize} #{t('pugin.constituencies.list.former_constituency.constituency')}"
|
23
|
+
%h2
|
24
|
+
- date_string = " (#{l(constituencies.start_date, format: :year_only)} - #{l(constituencies.end_date, format: :year_only)})" if constituencies.respond_to?(:start_date) && constituencies.respond_to?(:end_date)
|
25
|
+
%a{:href => "/constituencies/#{constituencies.graph_id}"}= "#{constituencies.name}#{date_string}"
|
26
|
+
%p= "#{t('pugin.constituencies.list.former_constituency.former').capitalize} #{t('pugin.constituencies.list.former_constituency.constituency')}"
|
@@ -1,26 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
%
|
4
|
-
%
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
.card
|
2
|
+
- if Pugin::Feature::Bandiera.show_list_images?
|
3
|
+
%figure
|
4
|
+
%a{ href: "/people/#{lord.graph_id}", aria: { hidden: "true" }, tabindex: "-1" }
|
5
|
+
%picture
|
6
|
+
- if lord.image_id != "placeholder"
|
7
|
+
%img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{lord.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{lord.display_name}" }
|
8
|
+
- else
|
9
|
+
%img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "" }
|
9
10
|
|
10
|
-
.
|
11
|
-
|
12
|
-
|
11
|
+
.card__details
|
12
|
+
%h2
|
13
|
+
%a{href: "/people/#{lord.graph_id}"}= lord.display_name
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
-# Currently only takes the most recent incumbency as part of that parliamentary period
|
16
|
+
- most_recent_incumbency = lord.most_recent_seat_incumbency
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
- if @parliament # parliament lord
|
19
|
+
%p= "Member of the #{t('house_of_lords')}"
|
20
|
+
%p= lord&.parties&.first&.name
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
- elsif most_recent_incumbency&.current? # current lord
|
23
|
+
%p= lord.statuses[:house_membership_status].join(' and ')
|
24
|
+
%p= lord.try(:current_party).try(:name)
|
24
25
|
|
25
|
-
|
26
|
-
|
26
|
+
- else # former lord
|
27
|
+
%p= lord.statuses[:house_membership_status].join(' and ')
|
@@ -1,30 +1,31 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
%
|
4
|
-
%
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
.card
|
2
|
+
- if Pugin::Feature::Bandiera.show_list_images?
|
3
|
+
%figure
|
4
|
+
%a{ href: "/people/#{member.graph_id}", aria: { hidden: "true" }, tabindex: "-1" }
|
5
|
+
%picture
|
6
|
+
- if member.image_id != "placeholder"
|
7
|
+
%img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{member.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{member.display_name}" }
|
8
|
+
- else
|
9
|
+
%img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "" }
|
9
10
|
|
10
|
-
.
|
11
|
-
|
12
|
-
|
11
|
+
.card__details
|
12
|
+
%h2
|
13
|
+
%a{href: "/people/#{member.graph_id}"}= member.display_name
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
-# Currently only takes the most recent incumbency as part of that parliamentary period
|
16
|
+
- parliament_incumbency = member.most_recent_seat_incumbency
|
17
|
+
- current_incumbency = member.current_seat_incumbency
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
- if @parliament # parliament member
|
20
|
+
- if parliament_incumbency&.constituency && parliament_incumbency&.start_date
|
21
|
+
%p
|
22
|
+
= "#{parliament_incumbency.constituency.name} from #{l(parliament_incumbency.start_date, format: :default)}"
|
23
|
+
= parliament_incumbency&.end_date.nil? ? "#{I18n.t('shared.to_present')}" : "- #{l(parliament_incumbency.end_date, format: :default)}"
|
24
|
+
%p= member&.parties&.first&.name
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
- elsif current_incumbency&.constituency # current member
|
27
|
+
%p= "#{I18n.t('pugin.people.list.member.mp_for')} #{current_incumbency&.constituency&.name}"
|
28
|
+
%p= member.try(:current_party).try(:name)
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
- else # former member
|
31
|
+
%p= member.statuses[:house_membership_status].join(' and ')
|
data/lib/pugin.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'pugin/version'
|
2
2
|
|
3
3
|
module Pugin
|
4
|
-
ASSET_VERSION = '1.
|
4
|
+
ASSET_VERSION = '1.9.0'.freeze
|
5
5
|
ASSET_LOCATION_URL = ENV.fetch('ASSET_LOCATION_URL', 'https://s3-eu-west-1.amazonaws.com/web1live.pugin-website')
|
6
6
|
STATIC_ASSET_LOCATION_URL = ENV.fetch('STATIC_ASSET_LOCATION_URL', 'https://s3-eu-west-1.amazonaws.com/web1live.static-assets')
|
7
7
|
STATIC_ASSET_PUBLIC_LOCATION_URL = ENV.fetch('STATIC_ASSET_PUBLIC_LOCATION_URL', 'https://s3-eu-west-1.amazonaws.com/web1live.static-assets-public')
|
data/lib/pugin/version.rb
CHANGED
@@ -56,13 +56,15 @@ describe 'pugin/cards/_person-list.html.haml', type: :view do
|
|
56
56
|
<<DATA
|
57
57
|
<ol class='list--block'>
|
58
58
|
<li>
|
59
|
-
<div class='
|
59
|
+
<div class='card'>
|
60
|
+
<div class='card__details'>
|
60
61
|
<h2>
|
61
62
|
<a href='/people/123'>Jane Smith</a>
|
62
63
|
</h2>
|
63
64
|
<p>Current MP for Hackney</p>
|
64
65
|
<p>Labour</p>
|
65
66
|
</div>
|
67
|
+
</div>
|
66
68
|
</li>
|
67
69
|
</ol>
|
68
70
|
DATA
|
@@ -81,12 +83,14 @@ DATA
|
|
81
83
|
expect(response).to eq(<<DATA
|
82
84
|
<ol class='list--block'>
|
83
85
|
<li>
|
84
|
-
<div class='
|
86
|
+
<div class='card'>
|
87
|
+
<div class='card__details'>
|
85
88
|
<p>
|
86
89
|
There are no results
|
87
90
|
|
88
91
|
</p>
|
89
92
|
</div>
|
93
|
+
</div>
|
90
94
|
</li>
|
91
95
|
</ol>
|
92
96
|
DATA
|
@@ -162,13 +166,15 @@ DATA
|
|
162
166
|
<<DATA
|
163
167
|
<ol class='list--block'>
|
164
168
|
<li>
|
165
|
-
<div class='
|
169
|
+
<div class='card'>
|
170
|
+
<div class='card__details'>
|
166
171
|
<h2>
|
167
172
|
<a href='/people/123'></a>
|
168
173
|
</h2>
|
169
174
|
<p>Current MP for Hackney</p>
|
170
175
|
<p>Labour</p>
|
171
176
|
</div>
|
177
|
+
</div>
|
172
178
|
</li>
|
173
179
|
</ol>
|
174
180
|
DATA
|
@@ -210,12 +216,14 @@ DATA
|
|
210
216
|
<<DATA
|
211
217
|
<ol class='list--block'>
|
212
218
|
<li>
|
213
|
-
<div class='
|
219
|
+
<div class='card'>
|
220
|
+
<div class='card__details'>
|
214
221
|
<h2>
|
215
222
|
<a href='/people/123'>Jane Smith</a>
|
216
223
|
</h2>
|
217
224
|
<p>Labour</p>
|
218
225
|
</div>
|
226
|
+
</div>
|
219
227
|
</li>
|
220
228
|
</ol>
|
221
229
|
DATA
|
@@ -256,12 +264,14 @@ DATA
|
|
256
264
|
<<DATA
|
257
265
|
<ol class='list--block'>
|
258
266
|
<li>
|
259
|
-
<div class='
|
267
|
+
<div class='card'>
|
268
|
+
<div class='card__details'>
|
260
269
|
<h2>
|
261
270
|
<a href='/people/123'>Jane Smith</a>
|
262
271
|
</h2>
|
263
272
|
<p>Current MP for Hackney</p>
|
264
273
|
</div>
|
274
|
+
</div>
|
265
275
|
</li>
|
266
276
|
</ol>
|
267
277
|
DATA
|
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.
|
4
|
+
version: 1.7.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: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|