representative_detail.haml 2.12 KB
Newer Older
Arnaud Fabre's avatar
Arnaud Fabre committed
1
- extends 'base.html'
Arnaud Fabre's avatar
Arnaud Fabre committed
2
3

- load humanize
Jamesie Pic's avatar
Jamesie Pic committed
4
5
6
- load representatives_tags
- load representatives_votes_tags
- load representatives_recommendations_tags
Arnaud Fabre's avatar
Arnaud Fabre committed
7
8
9

- block head
  {{ position_form.media }}
Arnaud Fabre's avatar
Arnaud Fabre committed
10
11

- block content
Arnaud Fabre's avatar
Arnaud Fabre committed
12
13
  .row
    .col-md-6
Jamesie Pic's avatar
Jamesie Pic committed
14
      - include 'representatives/_representative_block.html' with representative=representative
15
      - include 'representatives/_representative_contact.html' with representative=representative
16

Arnaud Fabre's avatar
Arnaud Fabre committed
17
18
19
20
21
22
23
24
25
26
27
28
29
    .col-md-6
      %h2#votes Votes

      %table.table.table-condensed.votes
        %tr
          %th Title
          %th.icon-cell
            Memopol recommendation
          %th.icon-cell
            Representative vote
          %th.icon-cell
            Score

Jamesie Pic's avatar
Jamesie Pic committed
30
        - for vote in votes
Arnaud Fabre's avatar
Arnaud Fabre committed
31
32
33
34
35
36
37
          %tr
            %td= vote.proposal.recommendation.title
            %td.icon-cell
              = vote.proposal.recommendation.recommendation|position_icon
            %td.icon-cell
              = vote.position|position_icon
            %td.icon-cell
38
              = vote.score|score_label
Arnaud Fabre's avatar
Arnaud Fabre committed
39
40
41
42
43


  %h2 Mandates

  %table.table.table-condensed.mandates
Jamesie Pic's avatar
Jamesie Pic committed
44
    - for mandate in mandates
Arnaud Fabre's avatar
Arnaud Fabre committed
45
46
47
      %tr.mandate
        %td= mandate.role
        %td
Jamesie Pic's avatar
Jamesie Pic committed
48
49
50
51
          %a{:href => "{{ mandate.group.get_absolute_url }}"}
            {{ mandate.group.name }}
            - if mandate.group.abbreviation
              {{ mandate.group.abbreviation }}
52
53
54
55
56
57
        %td
          - if mandate.begin_date
            = mandate.begin_date|mandate_date:'d/m/Y'
        %td
          - if mandate.end_date
            = mandate.end_date|mandate_date:'d/m/Y'
Arnaud Fabre's avatar
Arnaud Fabre committed
58
59
60
61
62
63
        %td= mandate.constituency.name

  .positions
    %h2 Public positions

    %table.table.table-condensed
Jamesie Pic's avatar
Jamesie Pic committed
64
      - for position in positions
Arnaud Fabre's avatar
Arnaud Fabre committed
65
        %tr.position
66
          %td= position.datetime|naturalday:'d/m/Y'
Arnaud Fabre's avatar
Arnaud Fabre committed
67
          %td
Jamesie Pic's avatar
Jamesie Pic committed
68
            %a{:href => '{{ position.get_absolute_url }}'}
Arnaud Fabre's avatar
Arnaud Fabre committed
69
70
              =position.text|truncatewords:8
          %td
71
72
73
            - for tag in position.tags.all
              %span.label.label-default
                = tag
Arnaud Fabre's avatar
Arnaud Fabre committed
74
          %td
Arnaud Fabre's avatar
Arnaud Fabre committed
75
76
77
            %a{:href => '{{position.link}}'}
              = position.link

78
    - include 'representatives_positions/_form.html' with form=position_form