list.html 3.01 KB
Newer Older
stef's avatar
stef committed
1
2
3
4
5
6
7
{% extends "base.html" %}
{% load bt %}
{% load i18n %}
{% block styles %}
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="{%media_url%}/js/jquery.1.4.2.min.js"></script>
8
9
10
11
    <script type="text/javascript" src="{%media_url%}/js/jquery.tablesorter.min.js"> </script>
    <script type="text/javascript">
     $(document).ready(function() {
           $("#sortedlist").tablesorter();
stef's avatar
stef committed
12
13
14
15
16
17
           $('.confirm_form').submit(function() {
              var self=this;
              $.ajax({url: '/confirm/'+$(this).attr('id')+'/'+$(this).children('input:first').attr('value'), success: function(data) { $(self).html(data); }});
              return false;
              });
           });
18
    </script>
stef's avatar
stef committed
19
20
21
{% endblock %}

{%block content%}
22
23
24
25
26
27
28
29
{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}
<table class="listing tablesorter" id='sortedlist'>
stef's avatar
stef committed
30
31
  <thead>
<tr>
stef's avatar
stef committed
32
33
34
35
36
37
38
39
40
41
42
   <th>{% trans "id" %}</th>
   <th>{% trans "country" %}</th>
   <th>{% trans "operator" %}</th>
   <th>{% trans "contract" %}</th>
   <th>{% trans "resource" %}</th>
   <th>{% trans "type" %}</th>
   <th>{% trans "media" %}</th>
   <th>{% trans "temporary" %}</th>
   <th>{% trans "contractual" %}</th>
   <th>{% trans "contractual_excerpt" %}</th>
   <th>{% trans "loophole" %}</th>
stef's avatar
stef committed
43
   <th>{% trans "confirmations" %}</th>
stef's avatar
stef committed
44
45
46
47
48
</tr>
  </thead>
  <tbody>
{% for violation in violations.object_list %}
<tr>
49
    <td><a href="/view/{{violation.pk}}">#{{ violation.pk }}</a></td>
stef's avatar
stef committed
50
51
52
53
54
55
56
57
58
59
    <td>{{ violation.country }}</td>
    <td>{{ violation.operator }}</td>
    <td>{{ violation.contract }}</td>
    <td>{{ violation.resource }}</td>
    <td>{{ violation.type }}</td>
    <td>{{ violation.media }}</td>
    <td>{{ violation.temporary }}</td>
    <td>{{ violation.contractual }}</td>
    <td>{{ violation.contractual_excerpt }}</td>
    <td>{{ violation.loophole }}</td>
stef's avatar
stef committed
60
    <td>{{ violation.confirmations }} <div class="confirm"><a>+1</a>
stef's avatar
stef committed
61
62
63
64
65
66
67
68
69
70
71
72
73
          <div class="hidden confirm_popup">
             <h3>Confirmation</h3>
             <p>
             <form method="get" class="confirm_form" id="{{ violation.pk }}">
                E-mail: <input type="text" name="email" /><br />
                //required<br />
                <input type="hidden" value="{{ violation.pk }}" />
                <input type="submit" value="confirm" />
             </form>
             </p>
          </div>
       </div>
    </td>
stef's avatar
stef committed
74
75
76
77
78
79
80
81
82
83
84
85
</tr>
{% endfor %}
  </tbody>
</table>

<div class="pagination">
    <span class="step-links">
        {% if violations.has_previous %}
            <a href="?page={{ violations.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
stef's avatar
stef committed
86
           {% trans "Page" %} {{ violations.number }} {% trans "of" %} {{ violations.paginator.num_pages }}.
stef's avatar
stef committed
87
88
89
        </span>

        {% if violations.has_next %}
stef's avatar
stef committed
90
        <a href="?page={{ violations.next_page_number }}">{% trans "next" %}</a>
stef's avatar
stef committed
91
92
93
94
        {% endif %}
    </span>
</div>
{%endblock%}