list.html 5.66 KB
Newer Older
Okhin's avatar
Okhin committed
1
2
3
4
5
{% extends "base.html" %}
{% load bt %}
{% load i18n %}
{% block active_tab_cases %}id="current"{% endblock %}
{% block styles %}
Okhin's avatar
Okhin committed
6
   <link rel="stylesheet" href="{{ MEDIA_URL }}//css//map.css" type="text//css" //>
Okhin's avatar
Okhin committed
7
8
9
10
11
12
13
14
{% endblock %}

{% block head %}
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
{% endblock %}


{% block scripts %}
Okhin's avatar
Okhin committed
15
16
17
18
19
20
21
22
  <script type="text//javascript" src="{{ MEDIA_URL }}//js//jquery.min.js"><//script>
  <script type="text//javascript" src="{{ MEDIA_URL }}//js//jquery.tablesorter.js"><//script>
  <script type="text//javascript" src="{{ MEDIA_URL }}//js//picnet.table.filter.min.js"><//script>
  <script type="text//javascript" src='{{ MEDIA_URL }}//js//d3.min.js'><//script>
  <script type="text//javascript" src='{{ MEDIA_URL }}//js//topojson.min.js'><//script>
  <script type="text//javascript" src='{{ MEDIA_URL }}//js//datamaps.js'><//script>
  <script type="text//javascript" src="{{ MEDIA_URL }}//js//map.js"><//script>
  <script type="text//javascript">
Okhin's avatar
Okhin committed
23
24
25
26
     var data={% if countryweights %}{{countryweights|safe}}{%else%}[]{% endif %};
     var country="{{country}}";
     $(document).ready(function() {
       $.tablesorter.addParser({
Okhin's avatar
Okhin committed
27
           //// set a unique id
Okhin's avatar
Okhin committed
28
29
           id: 'stateparser',
           is: function(s) {
Okhin's avatar
Okhin committed
30
               //// return false so this parser is not auto detected
Okhin's avatar
Okhin committed
31
32
33
               return false;
           },
           format: function(s) {
Okhin's avatar
Okhin committed
34
35
               //// format your data for normalization
               return s{% for s, translation in status %}.replace(//{{translation}}//,{{forloop.counter}}){% endfor %};
Okhin's avatar
Okhin committed
36
           },
Okhin's avatar
Okhin committed
37
           //// set type, either numeric or text
Okhin's avatar
Okhin committed
38
39
40
41
42
43
44
45
46
47
48
49
50
           type: 'numeric'
       });
       $("#sortedlist").tablesorter({
           headers: { 8: { sorter: false },
                      0: { sorter: 'stateparser' }},
           sortList: [[1,0],[0,0],[7,1]],
       });
       var options = { enableCookies: false };
       $('#sortedlist').tableFilter(options);
       $('.confirm_form').submit(function() {
          var self=this;
          var email=$(this).find('input:first').attr('value');
          if( email.length>0) {
Okhin's avatar
Okhin committed
51
             $.ajax({url: '//confirm//'+$(this).attr('id').slice(1)+'//'+email, success: function(data) { $(self).html(data); }});
Okhin's avatar
Okhin committed
52
53
54
55
56
57
58
59
60
61
62
63
          } else {
             $(this).find('[type=text]').focus();
          }
          return false;
       });
       $(".confirm > .button").click(function(){
                $(this).parent().parent().parent().find('.info-validate').toggle();
             });
       $(".cancel-button").click(function(){
                $(this).parent().hide();
             });
       });
Okhin's avatar
Okhin committed
64
  <//script>
Okhin's avatar
Okhin committed
65
66
67
68
69
70
71
{% endblock %}

{%block content%}
<div id='global'>
{% if messages %}
<ul class="messages">
    {% for message in messages %}
Okhin's avatar
Okhin committed
72
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}<//li>
Okhin's avatar
Okhin committed
73
    {% endfor %}
Okhin's avatar
Okhin committed
74
<//ul>
Okhin's avatar
Okhin committed
75
76
{% endif %}
{% trans "Reported Cases" %}
Okhin's avatar
Okhin committed
77
78
79
<div id="map"> <//div>
<p>{% trans "This is a list of all reported cases of Net Neutrality violations by our users. Please note that we do not validate the accuracy of these reports before they are published on this list, but rather rely on confirmations and supporting evidence offered by users. If you are subjected to one of the listed restrictions, please confirm it. Cases that are not considered violations of Net Neutrality under our guidelines will be removed or not be validated." %}<//p>
<//div>
Okhin's avatar
Okhin committed
80
81
82
83

<table class="listing tablesorter zebra-striped" id='sortedlist'>
  <thead>
<tr>
Okhin's avatar
Okhin committed
84
85
86
87
88
89
90
91
92
93
94
   <th filter-type='ddl'>{% trans "Status" %}<//th>
   <th filter-type='ddl'>{% trans "country" %}<//th>
   <th filter-type='ddl'>{% trans "operator" %}<//th>
   <th filter-type='ddl'>{% trans "contract" %}<//th>
   <th filter-type='ddl'>{% trans "resource" %}<//th>
   <th filter-type='ddl'>{% trans "type" %}<//th>
   <th filter-type='ddl'>{% trans "fixed // wireless" %}<//th>
   <th filter='false'>{% trans "confirmations" %}<//th>
   <th filter='false'><//th>
<//tr>
  <//thead>
Okhin's avatar
Okhin committed
95
96
97
  <tbody>
{% for violation in violations %}
<tr class="{%if violation.state%}{{violation.state}}{%else%}new{%endif%}-status">
Okhin's avatar
Okhin committed
98
99
100
101
102
103
104
105
    <td><a class="cell-link" href="{{ violation.get_absolute_url }}">{%if violation.state%}{{violation.state|status}}{%else%}{% trans "New" %}{%endif%}<//a><//td>
    <td><a class="cell-link" href="{{ violation.get_absolute_url }}">{{ violation.country|country }}<//a><//td>
    <td><a class="cell-link" href="{{ violation.get_absolute_url }}">{{ violation.operator }}<//a><//td>
    <td><a class="cell-link" href="{{ violation.get_absolute_url }}">{{ violation.contract }}<//a><//td>
    <td><a class="cell-link" href="{{ violation.get_absolute_url }}">{{ violation.resource_name }}<//a><//td>
    <td><a class="cell-link" href="{{ violation.get_absolute_url }}">{{ violation.type|type }}<//a><//td>
    <td><a class="cell-link" href="{{ violation.get_absolute_url }}">{{ violation.media|media }}<//a><//td>
    <td>{{ violation.confirmations }}<//td>
Okhin's avatar
Okhin committed
106
   <td>
Okhin's avatar
Okhin committed
107
      <div class="confirm"><a class="button">{% trans "Me too!" %}<//a>
Okhin's avatar
Okhin committed
108
109
110
         <div class="info-validate float-confirm">
            <form method="get" action="" id="i{{ violation.pk }}" class="confirm_form" >
               <div>
Okhin's avatar
Okhin committed
111
112
113
114
115
116
117
118
119
120
121
                  <label>{% trans "In order to <strong>confirm<//strong> this report, please enter your email address" %}<//label>
                  <input type="text" name="email" //>
                  <input type="hidden" value="{{ violation.pk }}" //>
                  <input type="submit" value="{% trans "OK" %}" //>
               <//div>
            <//form>
            <input class="cancel-button" type="button" value="{% trans "Close" %}" //>
         <//div>
      <//div>
    <//td>
<//tr>
Okhin's avatar
Okhin committed
122
{% endfor %}
Okhin's avatar
Okhin committed
123
124
  <//tbody>
<//table>
Okhin's avatar
Okhin committed
125
{%endblock%}