_position_list.html 3.56 KB
Newer Older
1
{% load i18n %}
2
{% load fontawesome %}
3
4
5
6
7
8
{% load humanize %}
{% load representatives_positions_tags %}

{% comment %}
  Expected variables
  - 'positions': positions list
9
  - 'show_representatives': show representatives
10
11
12
{% endcomment %}

{% if not positions %}
13
  <p class="no-positions empty text-center">
14
15
16
    {% trans "No public position has been recorded yet." %}
    <br><br>
    <a class="btn btn-primary hidden-print" data-toggle="modal" data-target="#add-position-form" aria-expanded="false" aria-controls="add-position-form">
17
      {% fontawesome_icon "bullhorn" %}
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
      {% trans "Add a public position" %}
    </a>
  </p>
{% else %}

  <table class="table table-responsive custom-timeline text-center">
    <thead>
      <tr>
        <th class="text-center">{% trans "Before" %}</th>
        <th class="text-center">{% trans "Last year" %}</th>
        <th class="text-center">{% trans "Last 6 months" %}</th>
        <th class="text-center">{% trans "This month" %}</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        {% for timeframe in positions|regroup_by_age %}
          <td>
            {% for position in timeframe %}
              <button class="btn btn-default position-button" id="position-button-{{ position.pk }}" type="button" data-toggle="modal" data-target="#position-modal-{{ position.pk }}" aria-expanded="false" aria-controls="position-modal-{{ position.pk }}">
39
40
41
42
43
44
                {% if show_representatives %}
                  <h5>{{ position.representative }}</h5>
                {% endif %}

                <div class="text-center">{{ position.datetime|naturalday }}</div>
                {% include "blocks/_themetags.html" with themes=position.themes.all exclude=theme.pk %}
45
46
47
48
49
50
51
              </button>

              <div class="modal fade" id="position-modal-{{ position.pk }}" tabindex="-1" role="dialog" aria-labelledby="position-button-{{ position.pk }}">
                <div class="modal-dialog modal-lg position-details" role="document">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-label="{% trans 'Close' %}"><span aria-hidden="true">&times;</span></button>
52
53
54
55
56
57
58
59
60
                      <h4 class="modal-title">
                        {% if show_representative %}
                          {% trans "Public position" %}
                        {% else %}
                          {% blocktrans with rep=position.representative %}
                            Public position by {{ rep }}
                          {% endblocktrans %}
                        {% endif %}
                      </h4>
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
                    </div>

                    <div class="modal-body">
                      <div class="row">
                        <div class="col-sm-12 text-justify">
                          <blockquote>
                            <p>{{ position.text }}</p>
                          </blockquote>
                        </div>
                      </div>
                    </div>
                    <div class="modal-footer">
                      {% if position.link %}
                        <a class="btn btn-primary" href="{{ position.link }}" target="_blank">Check the source &raquo;</a>
                      {% endif %}

                      <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
                    </div>
                  </div>
                </div>
              </div>
            {% endfor %}
          </td>
        {% endfor %}
      </tr>
    </tbody>
  </table>

{% endif %}