- extends 'base.html'

- load i18n
- load representatives_tags
- load representatives_recommendations_tags

- block content

  - block search

    %form{action:'', method:'get'}
      %label{for:'search'}
        - trans 'Search'
      %input{id:"search", type:"text", name:"search"}
      %input{type:"submit", value:"Go"}

    %a{href:"?{% if request.GET.search %}search={{ request.GET.search }}&{% endif %}csv"}
      - trans 'Download data as CSV'

  - include 'core/blocks/pagination.html'

  - block list

    %table.table
      %tr
        %th
          - trans 'Photo'
        %th
          - trans 'Name'
        %th
          - trans 'Chamber'
        %th
          - trans 'Country'
        %th
          - trans 'Group'
        %th
          - trans 'Score'

      - for representative in object_list
        %tr
          %td
            %a{'href': "{{ representative.get_absolute_url }}"}
              %img{'src': '={representative.photo}', 'width': '80'}/

          %td
            %a{'href': "{{ representative.get_absolute_url }}"}
              = representative.full_name

          %td
            %a{'href': "{% url 'representatives:representative-list' group_kind='chamber' group=representative.chamber.name %}"}
              = representative.chamber

          %td
            %a{'href': "{{ representative.country.get_absolute_url }}"}
              = representative.country

          %td
            %a{'href': "{{ representative.main_mandate.group.get_absolute_url }}"}
              = representative.main_mandate.group|group_icon
          %td
            = representative.score.score|score_label

  - include 'core/blocks/pagination.html'