Sha256: 918c1159ee10a928bdd806e848f4533d9bc952866ffd4a49752e080595204332

Contents?: true

Size: 1.54 KB

Versions: 28

Compression:

Stored size: 1.54 KB

Contents

.card
  - if Pugin::Feature::Bandiera.show_list_images?
    %figure.avatar--round
      %a{ href: "/people/#{member.graph_id}", aria: { hidden: "true" }, tabindex: "-1" }
        %picture
          - if member.image_id != "placeholder"
            %img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{member.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{member.display_name}" }
          - else
            %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "" }

  .card__details
    %h2
      %a{href: "/people/#{member.graph_id}"}= member.display_name

    -# Currently only takes the most recent incumbency as part of that parliamentary period
    - parliament_incumbency = member.most_recent_seat_incumbency
    - current_incumbency = member.current_seat_incumbency

    - if @parliament # parliament member
      - if parliament_incumbency&.constituency && parliament_incumbency&.start_date
        %p
          = "#{parliament_incumbency.constituency.name} from #{l(parliament_incumbency.start_date, format: :default)}"
          = parliament_incumbency&.end_date.nil? ? "#{I18n.t('shared.to_present')}" : "- #{l(parliament_incumbency.end_date, format: :default)}"
        %p= member&.parties&.first&.name

    - elsif current_incumbency&.constituency # current member
      %p= "#{I18n.t('pugin.people.list.member.mp_for')} #{current_incumbency&.constituency&.name}"
      %p= member.try(:current_party).try(:name)

    - else # former member
      %p= member.statuses[:house_membership_status].join(' and ')

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pugin-1.10.10 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.9 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.8 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.7 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.6 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.5 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.4 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.3 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.2 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.1 app/views/pugin/people/list/member/_member.html.haml
pugin-1.10.0 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.7 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.6 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.5 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.4 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.3 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.2 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.1 app/views/pugin/people/list/member/_member.html.haml
pugin-1.9.0 app/views/pugin/people/list/member/_member.html.haml
pugin-1.8.9 app/views/pugin/people/list/member/_member.html.haml