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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51a503d459b86356f15aef4ed339eb0467c97e46
4
- data.tar.gz: 04a32c19bb7e23a37bffaa9ca4f67e305e93e6ad
3
+ metadata.gz: 78d4be137c2b99ece40c087b06cbae3746902c0a
4
+ data.tar.gz: db6c8d049ec4d22175a5fca5c751965a1e584c08
5
5
  SHA512:
6
- metadata.gz: 8b217d286422c4d979d05116fff4010b149fc1d4cc35effa67930abf7a9bfdc18dfc84f3a0aada7f8ec3138e20fb1549162af1e5333ad3af8a28f7711b268b1a
7
- data.tar.gz: 9d678e0dac1c7195080ae352532849d6d57d65946477f43fd9f8c91673a7d44fa3986c3929f28a1c3def2d53d503bdafca611455bf552b6fcca9377277a15e73
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
- .list--details
5
- %p
6
- = "#{I18n.t('no_content.empty_list.members.description')}"
7
- = params[:letter].nil? ? "" : "#{I18n.t('no_content.empty_list.members.for')} '#{params[:letter].upcase}'"
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
- .list--details
14
- %h2
15
- %a{:href => "/people/#{person.graph_id}"}= person.display_name
16
- - if !person.statuses[:house_membership_status].empty? && !person.statuses[:house_membership_status].include?('Current MP')
17
- %p= person.statuses[:house_membership_status].join(' and ')
18
- - if person.constituencies.any?
19
- - seat_incumbency = person.seat_incumbencies.select(&:current?).first
20
- - if seat_incumbency && seat_incumbency.constituency
21
- %p= "#{I18n.t('pugin.cards.person-list.current_mp_for')} #{seat_incumbency.constituency.name}"
22
- - if !person.parties.empty?
23
- - party_membership = person.party_memberships.select(&:current?).first
24
- - unless party_membership.nil?
25
- %p= party_membership.party.name
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
- .list--details
3
- - if committees.respond_to?(:name)
4
- %h2= committees.name
5
- - else
6
- %h2= committees.formal_body.name
7
- %p= "" ? committees.date_range : committees.formal_body.date_range
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--flex
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
- .list--details
3
- - if !instance_variable_get("@parliament").nil? # parliament member
4
- %h2
5
- %a{:href => "/constituencies/#{constituencies.graph_id}"}= constituencies.name
6
- -# Constituency has a member? TRUE = Member's Name : FALSE = "Vacant" text
7
- - unless constituencies.members.empty?
8
- - constituencies.seat_incumbencies.each do |incumbency|
9
- %p= "#{incumbency.member.display_name} #{t('pugin.constituencies.list.from')} #{l(incumbency.start_date, format: :default)} - #{l(incumbency.end_date, format: :default)}"
10
- - incumbency.member.party_memberships.each do |member_party|
11
- %p= member_party.party.name
12
- - elsif constituencies.current?
13
- %h2
14
- %a{:href => "/constituencies/#{constituencies.graph_id}"}= constituencies.name
15
- -# Constituency has a member? TRUE = Member's Name : FALSE = "Vacant" text
16
- - if !constituencies.members.empty?
17
- %p= constituencies.current_member_display_name
18
- %p= constituencies.current_member_party_name
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
- %p= I18n.t('pugin.constituencies.list.current_constituency.vacant').capitalize
21
- - else
22
- %h2
23
- - 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)
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
- - if Pugin::Feature::Bandiera.show_list_images?
2
- %figure
3
- %a{ href: "/people/#{lord.graph_id}", aria: { hidden: "true" }, tabindex: "-1" }
4
- %picture
5
- - if lord.image_id != "placeholder"
6
- %img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{lord.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{lord.display_name}" }
7
- - else
8
- %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "" }
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
- .list--details
11
- %h2
12
- %a{href: "/people/#{lord.graph_id}"}= lord.display_name
11
+ .card__details
12
+ %h2
13
+ %a{href: "/people/#{lord.graph_id}"}= lord.display_name
13
14
 
14
- -# Currently only takes the most recent incumbency as part of that parliamentary period
15
- - most_recent_incumbency = lord.most_recent_seat_incumbency
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
- - if @parliament # parliament lord
18
- %p= "Member of the #{t('house_of_lords')}"
19
- %p= lord&.parties&.first&.name
18
+ - if @parliament # parliament lord
19
+ %p= "Member of the #{t('house_of_lords')}"
20
+ %p= lord&.parties&.first&.name
20
21
 
21
- - elsif most_recent_incumbency&.current? # current lord
22
- %p= lord.statuses[:house_membership_status].join(' and ')
23
- %p= lord.try(:current_party).try(:name)
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
- - else # former lord
26
- %p= lord.statuses[:house_membership_status].join(' and ')
26
+ - else # former lord
27
+ %p= lord.statuses[:house_membership_status].join(' and ')
@@ -1,30 +1,31 @@
1
- - if Pugin::Feature::Bandiera.show_list_images?
2
- %figure
3
- %a{ href: "/people/#{member.graph_id}", aria: { hidden: "true" }, tabindex: "-1" }
4
- %picture
5
- - if member.image_id != "placeholder"
6
- %img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{member.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{member.display_name}" }
7
- - else
8
- %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "" }
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
- .list--details
11
- %h2
12
- %a{href: "/people/#{member.graph_id}"}= member.display_name
11
+ .card__details
12
+ %h2
13
+ %a{href: "/people/#{member.graph_id}"}= member.display_name
13
14
 
14
- -# Currently only takes the most recent incumbency as part of that parliamentary period
15
- - parliament_incumbency = member.most_recent_seat_incumbency
16
- - current_incumbency = member.current_seat_incumbency
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
- - if @parliament # parliament member
19
- - if parliament_incumbency&.constituency && parliament_incumbency&.start_date
20
- %p
21
- = "#{parliament_incumbency.constituency.name} from #{l(parliament_incumbency.start_date, format: :default)}"
22
- = parliament_incumbency&.end_date.nil? ? "#{I18n.t('shared.to_present')}" : "- #{l(parliament_incumbency.end_date, format: :default)}"
23
- %p= member&.parties&.first&.name
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
- - elsif current_incumbency&.constituency # current member
26
- %p= "#{I18n.t('pugin.people.list.member.mp_for')} #{current_incumbency&.constituency&.name}"
27
- %p= member.try(:current_party).try(:name)
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
- - else # former member
30
- %p= member.statuses[:house_membership_status].join(' and ')
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.8.1'.freeze
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
@@ -1,3 +1,3 @@
1
1
  module Pugin
2
- VERSION = '1.6.23'.freeze
2
+ VERSION = '1.7.0'.freeze
3
3
  end
@@ -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='list--details'>
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='list--details'>
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='list--details'>
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='list--details'>
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='list--details'>
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.6.23
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-25 00:00:00.000000000 Z
11
+ date: 2018-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails