_position_list.html 2.9 KB
Newer Older
1
{% load i18n %}
2
{% load fontawesome %}
3
4
5
6
7
8
9
10
11
12
13
14
15
{% load humanize %}
{% load representatives_positions_tags %}

{% comment %}
  Expected variables
  - 'positions': positions list
{% endcomment %}

{% if not positions %}
  <p class="no-positions text-center">
    {% 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">
16
      {% fontawesome_icon "bullhorn" %}
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
      {% 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 }}">
                {{ position.datetime|naturalday }}
              </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>
                      <h4 class="modal-title">{% trans "Public position" %}</h4>
                    </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 %}