Sha256: 49728b6bbeab5259fcc37e56e17403deffab3e56852c0ca68bdce416f77fd0cd

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 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}", tabindex: "-1"}
      %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: "" }

.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

3 entries across 3 versions & 1 rubygems

Version Path
pugin-1.6.5 app/views/pugin/people/list/lord/_lord.html.haml
pugin-1.6.4 app/views/pugin/people/list/lord/_lord.html.haml
pugin-1.6.3 app/views/pugin/people/list/lord/_lord.html.haml