representative_detail_votes.html 2.74 KB
Newer Older
1
2
3
{% extends 'representatives/representative_detail.html' %}

{% load i18n %}
4
{% load fontawesome %}
5
{% load memopol_tags %}
6
7
8

{% block representative_content %}

Nicolas Joyard's avatar
Nicolas Joyard committed
9
10
11
12
13
14
15
  {% if not dossiers %}
    <p class="no-votes empty text-center">
      {% trans "No vote has been recorded for this representative yet." %}
    </p>
  {% else %}

    <div class="panel-group" id="accordion-dossier" role="tablist" aria-multiselectable="true">
16

Nicolas Joyard's avatar
Nicolas Joyard committed
17
18
      {% for pk, d in dossiers.items %}
        {% with dossier=d.dossier %}
19

Nicolas Joyard's avatar
Nicolas Joyard committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
          <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="dossier-heading-{{ pk }}">
              <h4 class="panel-title">
                <a role="button" data-toggle="collapse" data-parent="#accordion-dossier" href="#dossier-{{ pk }}" aria-expanded="false" aria-controls="dossier-{{ pk }}">
                  {{ dossier.title }}
                  <span class="pull-right">
                    {% trans "Score for the representative on this specific dossier" as tooltip %}
                    {{ d.score|score_badge:tooltip }}
                  </span>
                </a>
              </h4>
            </div>
            <div id="dossier-{{ pk }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="dossier-heading-{{ pk }}">
              <div class="panel-body">
34

Nicolas Joyard's avatar
Nicolas Joyard committed
35
                <table class="table table-striped table-responsive text-center">
36

Nicolas Joyard's avatar
Nicolas Joyard committed
37
                  <thead>
38
                    <tr>
Nicolas Joyard's avatar
Nicolas Joyard committed
39
40
41
42
43
                      <th class="text-center">{% trans "Proposal" %}</th>
                      <th class="text-center">{% trans "Recommendation" %}</th>
                      <th class="text-center">{% trans "Vote" %}</th>
                      <th class="text-center nowrap">Points&nbsp;<a data-toggle="tooltip" data-placement="top" title="{% trans "Score is negative or positive depending on whether the representative voted as recommended" %}">{% fontawesome_icon "info-circle" %}</a>
                      </th>
44
                    </tr>
Nicolas Joyard's avatar
Nicolas Joyard committed
45
                  </thead>
46

Nicolas Joyard's avatar
Nicolas Joyard committed
47
                  <tbody>
48

Nicolas Joyard's avatar
Nicolas Joyard committed
49
50
51
52
53
54
55
56
57
58
                    {% for vote in d.votes %}
                      <tr>
                        <th>{{ vote.proposal.title }}</th>
                        <td>{{ vote.proposal.recommendation.recommendation|position_icon }}</td>
                        <td>{{ vote.position|position_icon:vote.proposal.recommendation.recommendation }}</td>
                        <td>
                          {{ vote.score|score_badge:vote.proposal.recommendation.title }}
                        </td>
                      </tr>
                    {% endfor %}
59

Nicolas Joyard's avatar
Nicolas Joyard committed
60
61
62
63
64
                  </tbody>

                </table>

              </div>
65
            </div>
66
67
          </div>

Nicolas Joyard's avatar
Nicolas Joyard committed
68
69
70
71
        {% endwith %}
      {% endfor %}

    </div>
72

Nicolas Joyard's avatar
Nicolas Joyard committed
73
  {% endif %}
74
75

{% endblock %}