pugin 0.8.0 → 0.8.1

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: efb25051d41bd408702eb1e6383c25677e00322c
4
- data.tar.gz: b686e4994dfdd6d2f62224bdc760670717531eb0
3
+ metadata.gz: 19739eb1cccd5bcfb1078247dfd557a66b51f6c0
4
+ data.tar.gz: 065ad1a97accf7f9d79e1e60e62b84e2af08ec80
5
5
  SHA512:
6
- metadata.gz: 240848d958afa081600f591a89118226e7b0ce6909ef4b8cf467b356de0b6221f2d769d672d646981b377c8ef52155778b8412913995a6724b1af5eb637faf5c
7
- data.tar.gz: 487aea54fd10eb611512d91fb37a72dd00078a3a78917d0857bcd1cf0d5013ca50c8ba4af1a1bf94c89b09403015f058ee1b069cda42845fe0546753f83c09cb
6
+ metadata.gz: 923abf02801b999c245d94c70ff2d9a906805b87d1a35a48c3b56706eac4305969f8029c0fbd8b2093eff0259ad45ff3fe6f5820bad30e86f8cd4150ec971bee
7
+ data.tar.gz: fb41b986516c73543e143f9eaebedf1e1e4e49c3d327fdeec6b856499df4e634a56820ee45d851908f4fd637bfab98e53891f33acf08e3fec88b18b802eae97d
@@ -1,3 +1,4 @@
1
1
  %header
2
2
  .container
3
- %a.logo{:href => "/"}= I18n.t('pugin.components.header.parliament_header')
3
+ %a{:href => "/" }
4
+ %img{:src => "https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.4.6/images/uk_parliament_logo.png", :alt => "#{I18n.t('pugin.components.header.parliament_header')}", :class => "logo", :srcset => "https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.4.6/images/uk_parliament_logo.svg"}
@@ -1,5 +1,15 @@
1
1
  %li
2
- - if constituencies.current?
2
+ - if !instance_variable_get("@parliament").nil? # parliament member
3
+ %h2
4
+ %a{:href => "/constituencies/#{constituencies.graph_id}"}= constituencies.name
5
+ -# Constituency has a member? TRUE = Member's Name : FALSE = "Vacant" text
6
+ - unless constituencies.members.empty?
7
+ - constituencies.seat_incumbencies.each do |incumbency|
8
+ %p= "#{incumbency.member.display_name} #{t('pugin.constituencies.list.from')} #{l(incumbency.start_date, format: :default)} - #{l(incumbency.end_date, format: :default)}"
9
+ - incumbency.member.party_memberships.each do |member_party|
10
+ %p= member_party.party.name
11
+
12
+ - elsif constituencies.current?
3
13
  %h2
4
14
  %a{:href => "/constituencies/#{constituencies.graph_id}"}= constituencies.name
5
15
  -# Constituency has a member? TRUE = Member's Name : FALSE = "Vacant" text
@@ -1,3 +1,3 @@
1
- - person_type = data.house_incumbencies.empty? ? "member" : "lord"
1
+ - person_type = people.house_incumbencies.empty? ? "member" : "lord"
2
2
  %li.list__item
3
- = render partial: "pugin/people/list/#{person_type}/#{person_type}", locals: { data: local_assigns.fetch(:data, []) }
3
+ = render partial: "pugin/people/list/#{person_type}/#{person_type}", locals: { "#{person_type}": local_assigns.fetch(:people, []), as: person_type }
@@ -1,4 +1,34 @@
1
- - current_incumbency = data.seat_incumbencies.sort{ |inc_a, inc_b| inc_b.start_date <=> inc_a.start_date }.first
2
- - current_incumbency = current_incumbency.current? ? "current" : "former"
1
+ - current_incumbency = member.seat_incumbencies.sort{ |inc_a, inc_b| inc_b.start_date <=> inc_a.start_date }.first
3
2
 
4
- = render partial: "pugin/people/list/member/#{current_incumbency}/#{current_incumbency}_member", locals: { data: local_assigns.fetch(:data, []) }
3
+ - if !instance_variable_get("@parliament").nil? # parliament member
4
+
5
+ %h2
6
+ %a{:href => "/people/#{member.graph_id}"}= member.display_name
7
+ - unless member.constituencies.empty?
8
+ - unless member.seat_incumbencies.nil?
9
+ - member.seat_incumbencies.each do |seat_incumbency|
10
+ %p= "#{seat_incumbency.constituency.name} from #{l(seat_incumbency.start_date, format: :default)} - #{l(seat_incumbency.end_date, format: :default)}"
11
+
12
+ - unless member.parties.empty?
13
+ - member.party_memberships.each do |party_membership|
14
+ %p= party_membership.party.name
15
+
16
+ - elsif current_incumbency.current? # current member
17
+
18
+ %h2
19
+ %a{:href => "/people/#{member.graph_id}"}= member.display_name
20
+ - if !member.constituencies.empty?
21
+ - seat_incumbency = member.seat_incumbencies.select(&:current?).first
22
+ - unless seat_incumbency.nil?
23
+ %p= "#{t('.current_mp_for')} #{seat_incumbency.constituency.name}"
24
+ - if !member.parties.empty?
25
+ - party_membership = member.party_memberships.select(&:current?).first
26
+ - unless party_membership.nil?
27
+ %p= party_membership.party.name
28
+
29
+ - else # former member
30
+
31
+ %h2
32
+ %a{:href => "/people/#{member.graph_id}"}= member.display_name
33
+ - if !member.statuses[:house_membership_status].empty? && !member.statuses[:house_membership_status].include?('Current MP')
34
+ %p= member.statuses[:house_membership_status].join(' and ')
@@ -38,6 +38,7 @@ en:
38
38
  current_mp_for: "Current MP for"
39
39
  constituencies:
40
40
  list:
41
+ from: 'from'
41
42
  current_constituency:
42
43
  vacant: 'vacant'
43
44
  former_constituency:
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.5'.freeze
4
+ ASSET_VERSION = '1.4.6'.freeze
5
5
  ASSET_LOCATION_URL = ENV.fetch('ASSET_LOCATION_URL', 'https://s3-eu-west-1.amazonaws.com/web1devci.pugin-website')
6
6
 
7
7
  class << self
data/lib/pugin/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pugin
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.8.1'.freeze
3
3
  end
@@ -9,7 +9,9 @@ describe 'pugin/components/_header.html.haml', type: :view do
9
9
  expect(response).to eq(<<DATA
10
10
  <header>
11
11
  <div class='container'>
12
- <a class='logo' href='/'>UK Parliament</a>
12
+ <a href='/'>
13
+ <img alt='UK Parliament' class='logo' src='https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.4.6/images/uk_parliament_logo.png' srcset='https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.4.6/images/uk_parliament_logo.svg'>
14
+ </a>
13
15
  </div>
14
16
  </header>
15
17
  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: 0.8.0
4
+ version: 0.8.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-06-05 00:00:00.000000000 Z
11
+ date: 2017-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -213,8 +213,6 @@ files:
213
213
  - app/views/pugin/people/list/lord/current/_current_lord.html.haml
214
214
  - app/views/pugin/people/list/lord/former/_former_lord.html.haml
215
215
  - app/views/pugin/people/list/member/_member.html.haml
216
- - app/views/pugin/people/list/member/current/_current_member.html.haml
217
- - app/views/pugin/people/list/member/former/_former_member.html.haml
218
216
  - config/application.rb
219
217
  - config/locales/en.yml
220
218
  - config/routes.rb
@@ -1,10 +0,0 @@
1
- %h2
2
- %a{:href => "/people/#{data.graph_id}"}= data.display_name
3
- - if !data.constituencies.empty?
4
- - seat_incumbency = data.seat_incumbencies.select(&:current?).first
5
- - unless seat_incumbency.nil?
6
- %p= "#{t('.current_mp_for')} #{seat_incumbency.constituency.name}"
7
- - if !data.parties.empty?
8
- - party_membership = data.party_memberships.select(&:current?).first
9
- - unless party_membership.nil?
10
- %p= party_membership.party.name
@@ -1,4 +0,0 @@
1
- %h2
2
- %a{:href => "/people/#{data.graph_id}"}= data.display_name
3
- - if !data.statuses[:house_membership_status].empty? && !data.statuses[:house_membership_status].include?('Current MP')
4
- %p= data.statuses[:house_membership_status].join(' and ')