pugin 0.8.0 → 0.8.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/components/_header.haml +2 -1
- data/app/views/pugin/constituencies/list/_list.html.haml +11 -1
- data/app/views/pugin/people/list/_list.html.haml +2 -2
- data/app/views/pugin/people/list/member/_member.html.haml +33 -3
- data/config/locales/en.yml +1 -0
- data/lib/pugin.rb +1 -1
- data/lib/pugin/version.rb +1 -1
- data/spec/views/pugin/components/_header.html.haml_spec.rb +3 -1
- metadata +2 -4
- data/app/views/pugin/people/list/member/current/_current_member.html.haml +0 -10
- data/app/views/pugin/people/list/member/former/_former_member.html.haml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19739eb1cccd5bcfb1078247dfd557a66b51f6c0
|
4
|
+
data.tar.gz: 065ad1a97accf7f9d79e1e60e62b84e2af08ec80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 923abf02801b999c245d94c70ff2d9a906805b87d1a35a48c3b56706eac4305969f8029c0fbd8b2093eff0259ad45ff3fe6f5820bad30e86f8cd4150ec971bee
|
7
|
+
data.tar.gz: fb41b986516c73543e143f9eaebedf1e1e4e49c3d327fdeec6b856499df4e634a56820ee45d851908f4fd637bfab98e53891f33acf08e3fec88b18b802eae97d
|
@@ -1,3 +1,4 @@
|
|
1
1
|
%header
|
2
2
|
.container
|
3
|
-
%a
|
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
|
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 =
|
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: {
|
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 =
|
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
|
-
|
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 ')
|
data/config/locales/en.yml
CHANGED
data/lib/pugin.rb
CHANGED
data/lib/pugin/version.rb
CHANGED
@@ -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
|
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.
|
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-
|
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
|