pugin 1.8.3 → 1.8.4
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/layouts/_layout.html.haml +4 -2
 - data/app/views/pugin/meta/_application_insights.html.haml +1 -0
 - data/config/locales/en.yml +8 -0
 - data/lib/pugin/version.rb +1 -1
 - data/spec/views/pugin/layouts/_layout.html.haml_spec.rb +23 -0
 - data/spec/views/pugin/people/list/member/_member.html.haml_spec.rb +21 -4
 - metadata +2 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8db055b1fdf469b649e82b43f8985774e760f3d8
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d45a64511b0895f37eaf94beddc9dd202c8d6ac6
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: dadf8ab9964343cb8df84595ae0636c016470f71e1bc44bdfedcc3a451fc1fc9f70de6aa583757d9813b392b574fccd941cecdad53a1f49d5dc4ad81ea2e4e93
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 29708f768ebfdf28ec42a8941438a40813490c49d5d716ab9eb90f0aa13e2bbf19ff8314b31958bd2c62a4bce4342f694b74855c454f2cb9e81b418d5f2b9511
         
     | 
| 
         @@ -6,9 +6,11 @@ 
     | 
|
| 
       6 
6 
     | 
    
         
             
                %title= page_title
         
     | 
| 
       7 
7 
     | 
    
         
             
                %link{rel: 'stylesheet', href: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/stylesheets/main.css" }
         
     | 
| 
       8 
8 
     | 
    
         
             
                %meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0'}
         
     | 
| 
       9 
     | 
    
         
            -
                %meta{'http-equiv' 
     | 
| 
       10 
     | 
    
         
            -
                %link{rel: 'shortcut icon', type: 'image/x-icon', href: "#{Pugin:: 
     | 
| 
      
 9 
     | 
    
         
            +
                %meta{'http-equiv' => 'X-UA-Compatible', content: 'IE=edge'}
         
     | 
| 
      
 10 
     | 
    
         
            +
                %link{rel: 'shortcut icon', type: 'image/x-icon', href: "#{Pugin::STATIC_ASSET_PUBLIC_LOCATION_URL}/favicon.ico"}
         
     | 
| 
       11 
11 
     | 
    
         
             
                %link{rel: 'search', type: 'application/opensearchdescription+xml', href: opensearch_description_url, title: I18n.t('pugin.layouts.pugin.website_brand')}
         
     | 
| 
      
 12 
     | 
    
         
            +
                - if @app_insights_request_id
         
     | 
| 
      
 13 
     | 
    
         
            +
                  = render partial: 'pugin/meta/application_insights', locals: { app_insights_request_id: @app_insights_request_id }
         
     | 
| 
       12 
14 
     | 
    
         
             
                - if ENV['GTM_KEY']
         
     | 
| 
       13 
15 
     | 
    
         
             
                  = render partial: 'pugin/javascript/google_tag_manager'
         
     | 
| 
       14 
16 
     | 
    
         
             
                - unless Pugin.alternates.empty?
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            %meta{ name: 'applicationinsights-request-id', content: app_insights_request_id }
         
     | 
    
        data/config/locales/en.yml
    CHANGED
    
    | 
         @@ -1,9 +1,17 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            en:
         
     | 
| 
       2 
2 
     | 
    
         
             
              #global people translations
         
     | 
| 
       3 
3 
     | 
    
         
             
              house_of_lords: 'House of Lords'
         
     | 
| 
      
 4 
     | 
    
         
            +
              date:
         
     | 
| 
      
 5 
     | 
    
         
            +
                day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
         
     | 
| 
      
 6 
     | 
    
         
            +
                abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                # Don't forget the nil at the beginning; there's no such thing as a 0th month
         
     | 
| 
      
 9 
     | 
    
         
            +
                month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
         
     | 
| 
      
 10 
     | 
    
         
            +
                abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
         
     | 
| 
       4 
11 
     | 
    
         
             
              time:
         
     | 
| 
       5 
12 
     | 
    
         
             
                formats:
         
     | 
| 
       6 
13 
     | 
    
         
             
                  year_only: "%Y"
         
     | 
| 
      
 14 
     | 
    
         
            +
                  default: '%-d %b %Y'
         
     | 
| 
       7 
15 
     | 
    
         
             
              pugin:
         
     | 
| 
       8 
16 
     | 
    
         
             
                hints:
         
     | 
| 
       9 
17 
     | 
    
         
             
                  beta: 'beta'
         
     | 
    
        data/lib/pugin/version.rb
    CHANGED
    
    
| 
         @@ -128,4 +128,27 @@ describe 'pugin/layouts/_layout.html.haml', type: :view do 
     | 
|
| 
       128 
128 
     | 
    
         
             
                  end
         
     | 
| 
       129 
129 
     | 
    
         
             
                end
         
     | 
| 
       130 
130 
     | 
    
         
             
              end
         
     | 
| 
      
 131 
     | 
    
         
            +
             
     | 
| 
      
 132 
     | 
    
         
            +
              describe 'ApplictaionInsights' do
         
     | 
| 
      
 133 
     | 
    
         
            +
                context 'with request ID set' do
         
     | 
| 
      
 134 
     | 
    
         
            +
                  before :each do
         
     | 
| 
      
 135 
     | 
    
         
            +
                    assign(:app_insights_request_id, '|12345678abcdefgh.')
         
     | 
| 
      
 136 
     | 
    
         
            +
                    render
         
     | 
| 
      
 137 
     | 
    
         
            +
                  end
         
     | 
| 
      
 138 
     | 
    
         
            +
             
     | 
| 
      
 139 
     | 
    
         
            +
                  it 'render the expected meta tag' do
         
     | 
| 
      
 140 
     | 
    
         
            +
                    expect(rendered).to include("<meta content='|12345678abcdefgh.' name='applicationinsights-request-id'>")
         
     | 
| 
      
 141 
     | 
    
         
            +
                  end
         
     | 
| 
      
 142 
     | 
    
         
            +
                end
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
                context 'without request ID set' do
         
     | 
| 
      
 145 
     | 
    
         
            +
                  before :each do
         
     | 
| 
      
 146 
     | 
    
         
            +
                    render
         
     | 
| 
      
 147 
     | 
    
         
            +
                  end
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
                  it 'does not render the meta tag' do
         
     | 
| 
      
 150 
     | 
    
         
            +
                    expect(rendered).not_to include('name="applicationinsights-request-id"')
         
     | 
| 
      
 151 
     | 
    
         
            +
                  end
         
     | 
| 
      
 152 
     | 
    
         
            +
                end
         
     | 
| 
      
 153 
     | 
    
         
            +
              end
         
     | 
| 
       131 
154 
     | 
    
         
             
            end
         
     | 
| 
         @@ -82,8 +82,8 @@ describe 'pugin/people/list/member/_member.html.haml', type: :view do 
     | 
|
| 
       82 
82 
     | 
    
         
             
                  allow(parliament_mp_constituency).to receive(:name).and_return('constituency1')
         
     | 
| 
       83 
83 
     | 
    
         | 
| 
       84 
84 
     | 
    
         
             
                  allow(parliament_mp_seat_incumbency).to receive(:current?).and_return(false)
         
     | 
| 
       85 
     | 
    
         
            -
                  allow(parliament_mp_seat_incumbency).to receive(:start_date).and_return(DateTime.new(2017,2,3,4, 
     | 
| 
       86 
     | 
    
         
            -
                  allow(parliament_mp_seat_incumbency).to receive(:end_date).and_return(DateTime.new( 
     | 
| 
      
 85 
     | 
    
         
            +
                  allow(parliament_mp_seat_incumbency).to receive(:start_date).and_return(DateTime.new(2017,2,3,4,0,0))
         
     | 
| 
      
 86 
     | 
    
         
            +
                  allow(parliament_mp_seat_incumbency).to receive(:end_date).and_return(DateTime.new(2018,3,16,3,0,0))
         
     | 
| 
       87 
87 
     | 
    
         
             
                  allow(parliament_mp_seat_incumbency).to receive(:constituency).and_return(parliament_mp_constituency)
         
     | 
| 
       88 
88 
     | 
    
         | 
| 
       89 
89 
     | 
    
         
             
                  allow(parliament_mp_party).to receive(:name).and_return('Green Party')
         
     | 
| 
         @@ -103,10 +103,27 @@ describe 'pugin/people/list/member/_member.html.haml', type: :view do 
     | 
|
| 
       103 
103 
     | 
    
         
             
                  render partial: "pugin/people/list/list", collection: @people, as: "people".to_sym
         
     | 
| 
       104 
104 
     | 
    
         
             
                  expect(response).to include("<a href='/people/123'>parliamentmp1</a>")
         
     | 
| 
       105 
105 
     | 
    
         
             
                  expect(response).to include("<p>
         
     | 
| 
       106 
     | 
    
         
            -
            constituency1 from  
     | 
| 
       107 
     | 
    
         
            -
            -  
     | 
| 
      
 106 
     | 
    
         
            +
            constituency1 from 3 Feb 2017
         
     | 
| 
      
 107 
     | 
    
         
            +
            - 16 Mar 2018
         
     | 
| 
       108 
108 
     | 
    
         
             
            </p>")
         
     | 
| 
       109 
109 
     | 
    
         
             
                  expect(response).to include("<p>Green Party</p>")
         
     | 
| 
       110 
110 
     | 
    
         
             
                end
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                context 'current' do
         
     | 
| 
      
 113 
     | 
    
         
            +
                  before :each do
         
     | 
| 
      
 114 
     | 
    
         
            +
                    allow(@people.first.current_seat_incumbency).to receive(:end_date).and_return(nil)
         
     | 
| 
      
 115 
     | 
    
         
            +
                  end
         
     | 
| 
      
 116 
     | 
    
         
            +
             
     | 
| 
      
 117 
     | 
    
         
            +
                  it "renders the parliament MP data" do
         
     | 
| 
      
 118 
     | 
    
         
            +
                    render partial: "pugin/people/list/list", collection: @people, as: "people".to_sym
         
     | 
| 
      
 119 
     | 
    
         
            +
                    expect(response).to include("<a href='/people/123'>parliamentmp1</a>")
         
     | 
| 
      
 120 
     | 
    
         
            +
                    expect(response).to include("<p>
         
     | 
| 
      
 121 
     | 
    
         
            +
            constituency1 from 3 Feb 2017
         
     | 
| 
      
 122 
     | 
    
         
            +
            to present
         
     | 
| 
      
 123 
     | 
    
         
            +
            </p>")
         
     | 
| 
      
 124 
     | 
    
         
            +
                    expect(response).to include("<p>Green Party</p>")
         
     | 
| 
      
 125 
     | 
    
         
            +
                  end
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
      
 127 
     | 
    
         
            +
                end
         
     | 
| 
       111 
128 
     | 
    
         
             
              end
         
     | 
| 
       112 
129 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: pugin
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.8. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.8.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Matt Rayner
         
     | 
| 
         @@ -217,6 +217,7 @@ files: 
     | 
|
| 
       217 
217 
     | 
    
         
             
            - app/views/pugin/javascript/_pingdom.haml
         
     | 
| 
       218 
218 
     | 
    
         
             
            - app/views/pugin/layouts/_layout.html.haml
         
     | 
| 
       219 
219 
     | 
    
         
             
            - app/views/pugin/layouts/pugin.html.erb
         
     | 
| 
      
 220 
     | 
    
         
            +
            - app/views/pugin/meta/_application_insights.html.haml
         
     | 
| 
       220 
221 
     | 
    
         
             
            - app/views/pugin/meta/_opengraph.html.haml
         
     | 
| 
       221 
222 
     | 
    
         
             
            - app/views/pugin/parties/list/_list.html.haml
         
     | 
| 
       222 
223 
     | 
    
         
             
            - app/views/pugin/parties/list/current/current_party.html.haml
         
     |