Sha256: 0eb057225ca33c0729d4e433fac45f9989fcc2c6d69f38958c23c5d6248f5c50

Contents?: true

Size: 1.39 KB

Versions: 6

Compression:

Stored size: 1.39 KB

Contents

- current_incumbency = lord.house_incumbencies.sort{ |inc_a, inc_b| inc_b.start_date <=> inc_a.start_date }.first
- if Pugin::Feature::Bandiera.show_list_images?
  %figure
    %a{href: "/people/#{lord.graph_id}"}
      %picture
        - if lord.image_id != "placeholder"
          %img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{lord.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{lord.display_name}" }
        - else
          %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "placeholder" }

.list--details
  - if !instance_variable_get("@parliament").nil? # parliament lord

  - elsif current_incumbency.current? # current lord
    %h2
      %a{href: "/people/#{lord.graph_id}"}= lord.display_name
    - unless lord.statuses[:house_membership_status].empty? && !lord.statuses[:house_membership_status].include?('Current MP')
      %p= lord.statuses[:house_membership_status].join(' and ')
    - unless lord.parties.empty?
      - party_membership = lord.party_memberships.select(&:current?).first
      - unless party_membership.nil?
        %p= party_membership.party.name

  - else # former lord
    %h2
      %a{href: "/people/#{lord.graph_id}"}= lord.display_name
    - unless lord.statuses[:house_membership_status].empty? && !lord.statuses[:house_membership_status].include?('Current MP')
      %p= lord.statuses[:house_membership_status].join(' and ')

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pugin-1.2.2 app/views/pugin/people/list/lord/_lord.html.haml
pugin-1.2.1 app/views/pugin/people/list/lord/_lord.html.haml
pugin-1.2.0 app/views/pugin/people/list/lord/_lord.html.haml
pugin-1.1.2 app/views/pugin/people/list/lord/_lord.html.haml
pugin-1.0.1.pre app/views/pugin/people/list/lord/_lord.html.haml
pugin-1.0.1 app/views/pugin/people/list/lord/_lord.html.haml