index.html 7.83 KB
Newer Older
stef's avatar
stef committed
1
2
3
{% extends "base.html" %}
{% load bt %}
{% load i18n %}
4
{% load babel %}
stef's avatar
stef committed
5
6
7
{% block styles %}
  <link rel="stylesheet" type="text/css" media="all" href="{% media_url %}/css/jquery.autocomplete.css" />
{% endblock %}
stef's avatar
stef committed
8

stef's avatar
stef committed
9
10
11
12
13
14
15
16
17
18
19
20
{% block scripts %}
<script type="text/javascript" src="{%media_url%}/js/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="{%media_url%}/js/jquery.1.4.2.min.js"></script>
<script type="text/javascript" src="{%media_url%}/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="{%media_url%}/js/jquery.tablesorter.min.js"> </script>
<script type="text/javascript" src="{%media_url%}/js/form.js"></script>
<script type="text/javascript">
function focushandlers(ed) {
    var s = ed.settings;
    var realID = $('#'+ed.id+'_tbl');
    tinymce.dom.Event.add(ed.getWin(), 'focus', function(e) {
        if($(realID)) {
stef's avatar
stef committed
21
            //console.log(realID);
stef's avatar
stef committed
22
            realID.parents('.fieldWrapper').find('.help_text').show();
23
        }
stef's avatar
stef committed
24
25
26
    });
    tinymce.dom.Event.add(ed.getWin(), 'blur', function(e) {
        if($(realID)) {
stef's avatar
stef committed
27
            //console.log(realID);
stef's avatar
stef committed
28
29
30
31
32
33
34
35
            realID.parents('.fieldWrapper').find('.help_text').hide();
        }
    });
}
$(document).ready(function(){
  init_form();
  {% if not form.is_bound %}
  $(".fieldWrapper").hide();
stef's avatar
stef committed
36
  $("#id_resource_name").parent().parent().show();
37
  $("#id_country").parent().parent().show();
38
39
40
  $("#id_operator").parent().parent().show();
  $("#id_contract").parent().parent().show();
  $("#id_media").parent().parent().show();
stef's avatar
stef committed
41
42
43
  $("#save_button").hide();
  {% else %}
  if($("#id_contractual").attr('checked')==false) {
44
    $("#id_contract_excerpt").parent().parent().hide();
stef's avatar
stef committed
45
  }
46
47
  $("#show_optionals").show();
  $("#optional .fieldWrapper").hide();
stef's avatar
stef committed
48
49
50
51
52
  if ($('#id_email').val().length>0) {
                               $('#id_captcha_0').parent().parent().show();
                               $('#save_button').removeAttr('disabled');
                               $("#show_optionals").show();
                             }
stef's avatar
stef committed
53
54
55
56
57
58
59
60
61
62
63
64
65
  {% endif %}
  $('.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;
     });
   tinyMCE.init({
               mode : "textareas",
               width : "284",
               height : "140",
               theme : "advanced",
               theme_advanced_toolbar_align : "left",
               theme_advanced_toolbar_location : "top",
stef's avatar
stef committed
66
67
               //theme_advanced_buttons1 : "bold,italic,underline,bullist,numlist,outdent,indent,blockquote,undo,",
               theme_advanced_buttons1 : "",
stef's avatar
stef committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
               theme_advanced_buttons2 : "",
               theme_advanced_buttons3 : "",
               plugins : "paste",
               paste_auto_cleanup_on_paste : true,
               paste_strip_class_attributes: 'all',
               paste_remove_styles: true,
               init_instance_callback: focushandlers,
               valid_elements : "@[id|title|dir<ltr?rtl|lang|xml::lang],a[rel|rev|"
                                + "charset|hreflang|name|href|title],strong/b,em/i,"
                                + "strike,u,p,-ol,-ul,-li,br,-sub,-sup,-blockquote,"
                                + ",-code,-pre,address,-h1,-h2,-h3,-h4,-h5,"
                                + "-h6,hr[size|noshade],dd,dl,dt,cite,abbr,acronym,"
                                + "del[datetime|cite],ins[datetime|cite]",
             });
82
83
   $(".confirm").click(function(){
            $(this).parent().parent().find('.info-validate').toggle();
stef's avatar
stef committed
84
85
         });
   $(".cancel-button").click(function(){
stef's avatar
stef committed
86
            $(this).parent().parent().hide();
stef's avatar
stef committed
87
         });
stef's avatar
stef committed
88
89
90
91
92
});
</script>
{% endblock %}

{%block content%}
stef's avatar
stef committed
93
<div id='global'>
stef's avatar
stef committed
94
95
96
  {% if messages %}
  <ul class="messages">
    {% for message in messages %}
stef's avatar
stef committed
97
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|safe }}</li>
stef's avatar
stef committed
98
99
100
    {% endfor %}
  </ul>
  {% endif %}
101
  <div id='addForm' class='index'>
102
    <h2>{% trans "Add New Case" %}</h2>
stef's avatar
stef committed
103
    <p>{% trans "Please report cases of operators restricting or throttling access to content, services or applications. For a more precise description of what to report, check our <a href='/about/#guidelines'>guidelines</a>." %}
104
105
    <form name="addForm" enctype="multipart/form-data" action="{% root_url %}/add/" method="post">
      {% for field in form %}
stef's avatar
stef committed
106
      {% if field.html_name = 'comment' %}<div class="hidden errorlist">{% trans "There are already some reports for this Operator/Contract, please check if yours is already among them:" %}<ul id="similar_cases"></ul></div>{%endif%}
107
      {% if field.html_name = 'resource' %}<div id="show_optionals">{% trans "Provide optional details" %}</div><div id="optional">{%endif%}
stef's avatar
stef committed
108
      <div class="fieldWrapper">
stef's avatar
stef committed
109
         {% if field.help_text %}<span class="help_text">{{ field.help_text }}</span>{% endif %}
stef's avatar
stef committed
110
        <span class="innerfield">
stef's avatar
stef committed
111
112
          {{ field.errors }}
          {{ field.label_tag }} {{ field }}
113
        </span>
stef's avatar
stef committed
114
      </div>
115
116
117
118
119
      {% endfor %}
    </div>
    {% csrf_token %}
    <input id="save_button" type="submit" value="{% trans "save" %}" />
    </form>
stef's avatar
stef committed
120
121
  </div>
  <div id='content'>
Benjamin Sonntag's avatar
Benjamin Sonntag committed
122
123
124
125
126
127
   <h2>{% trans "On the Internet, <strong>you</strong> decide what you do, right? <i>Not anymore!</i>" %}</h2>
     <p>{% trans "Large telecommunication providers want to control what you do online. They want to block and throttle some of your communications, and charge you to use certain online services, content and applications." %}</p>
     <p>{% trans "Now is the time to fight back!" %}</p>
     <p>{% trans "Help us chart all the ways that internet providers are violating our online freedom. Tell us about how your landline or mobile operator Internet provider restricts your connection. You can do so in less than two minutes!" %}
     <p>{% trans "We will report these violations to the European Commission and national authorities and demand action to address them." %}</p>
     <p>{% trans "Don't hesitate to give us feedback on this application by reporting any idea or issue with RespectMyNet.eu here : <a href='https://nnmon.quadpad.lqdn.fr/feedback'>Feedback pad page</a>" %}</p>
128
   <h2>{% trans "Featured Cases" %}</h2>
stef's avatar
stef committed
129
130
131
  <table>
    <thead>
      <tr>
alct's avatar
alct committed
132
        <th style="width: 70%;">{% trans "Infringing offering" %}</th>
stef's avatar
stef committed
133
        <th>{% trans "Confirmed" %}</th>
alct's avatar
alct committed
134
        <th></th>
stef's avatar
stef committed
135
136
      </tr>
    </thead>
137
  <tbody>
stef's avatar
stef committed
138
  {% for violation in violations %}
139
    <tr>
stef's avatar
stef committed
140
       <td><a href="/view/{{violation.pk}}">{{ violation.operator }} ({{ violation.country|country }}) {{ violation.contract }}</a>
stef's avatar
stef committed
141
142
          <div class="info-validate">
            <form method="get" id="{{ violation.pk }}" class="confirm_form" >
143
                <label>{% trans "In order to <strong>validate your confirmation</strong> of this case, please enter your email address" %}</label>
alct's avatar
alct committed
144
                <br/><input type="text" name="email" />
stef's avatar
stef committed
145
                <input type="submit" value="{% trans "ok" %}" />
alct's avatar
alct committed
146
                <input type="button" value="{% trans "cancel" %}" class="cancel-button" />
alct's avatar
alct committed
147
                <input type="hidden" value="{{ violation.pk }}" />
stef's avatar
stef committed
148
              </form>
stef's avatar
stef committed
149
            </div>
stef's avatar
stef committed
150
151
       </td>
      <td class='align-right'>{{ violation.confirmations }}</td>
stef's avatar
stef committed
152
      <td class='align-right'><input type="button" class="confirm button" value="{% trans "Confirm" %}" />
153
154
      </td>
    </tr>
155
156
157
158
159
160
161
162
163
164
165
    <tr>
       <td colspan="3">
          <div id="description" class='round-box'>
            {%for c in violation.comment_set.all%}
            <div class="description">{{c.comment|safe}}</div>
            <span class="submitter">{%if c.submitter_name%}{{c.submitter_name}}{%else%}{{c.submitter_email}}{%endif%}</span> - <span class="comment_date">{{c.timestamp|datetimefmt:"short" }}</span>
            </div>
            {%endfor%}
          </div>
       </td>
    </tr>
166
167
168
169
170
    {% endfor %}
  </tbody>
</table>
</div>
</div>
stef's avatar
stef committed
171
{%endblock%}