representative_detail.haml 2.33 KB
Newer Older
Arnaud Fabre's avatar
Arnaud Fabre committed
1
-# List representatives
Arnaud Fabre's avatar
Arnaud Fabre committed
2

Arnaud Fabre's avatar
Arnaud Fabre committed
3
- extends 'base.html'
Arnaud Fabre's avatar
Arnaud Fabre committed
4
5

- load humanize
Jamesie Pic's avatar
Jamesie Pic committed
6
7
8
- load representatives_tags
- load representatives_votes_tags
- load representatives_recommendations_tags
Arnaud Fabre's avatar
Arnaud Fabre committed
9
10
11
12
- load bootstrap3

- block head
  {{ position_form.media }}
Arnaud Fabre's avatar
Arnaud Fabre committed
13
14

- block content
Arnaud Fabre's avatar
Arnaud Fabre committed
15
16
  .row
    .col-md-6
Jamesie Pic's avatar
Jamesie Pic committed
17
      - include 'representatives/_representative_block.html' with representative=representative
Arnaud Fabre's avatar
Arnaud Fabre committed
18
19
20
21
22
23
24
25
26
27
28
29
30
    .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
31
        - for vote in votes
Arnaud Fabre's avatar
Arnaud Fabre committed
32
33
34
35
36
37
38
39
          %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
              = vote.absolute_score|score_label
Arnaud Fabre's avatar
Arnaud Fabre committed
40
41
42
43
44


  %h2 Mandates

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

  .positions
    %h2 Public positions

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

Jamesie Pic's avatar
Jamesie Pic committed
75
    %form{:action => '{% url "representatives_positions:position-create" %}',
Arnaud Fabre's avatar
Arnaud Fabre committed
76
77
78
79
          :method => 'post'}
      - csrf_token
      %input{:type => 'hidden',
             :name => 'representative',
Jamesie Pic's avatar
Jamesie Pic committed
80
             :value => '{{ representative.pk }}'}
Arnaud Fabre's avatar
Arnaud Fabre committed
81
82
83
84
85
86
87

      - bootstrap_form position_form

      - buttons
        %button{'type': 'submit', 'class': 'btn btn-primary'}
          {% bootstrap_icon "star" %} Submit
      - endbuttons