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

stef's avatar
stef committed
8
9
10
11
12
13
14
15
16
17
18
19
{% 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
20
            //console.log(realID);
stef's avatar
stef committed
21
            realID.parents('.fieldWrapper').find('.help_text').show();
22
        }
stef's avatar
stef committed
23
24
25
    });
    tinymce.dom.Event.add(ed.getWin(), 'blur', function(e) {
        if($(realID)) {
stef's avatar
stef committed
26
            //console.log(realID);
stef's avatar
stef committed
27
28
29
30
31
32
33
34
            realID.parents('.fieldWrapper').find('.help_text').hide();
        }
    });
}
$(document).ready(function(){
  init_form();
  {% if not form.is_bound %}
  $(".fieldWrapper").hide();
35
  $("#id_country").parent().parent().show();
36
37
38
  $("#id_operator").parent().parent().show();
  $("#id_contract").parent().parent().show();
  $("#id_media").parent().parent().show();
stef's avatar
stef committed
39
40
41
  $("#save_button").hide();
  {% else %}
  if($("#id_contractual").attr('checked')==false) {
42
    $("#id_contract_excerpt").parent().parent().hide();
stef's avatar
stef committed
43
  }
44
45
  $("#show_optionals").show();
  $("#optional .fieldWrapper").hide();
stef's avatar
stef committed
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
  {% endif %}
  $("#sortedlist").tablesorter();
  $('.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",
               theme_advanced_buttons1 : "bold,italic,underline,bullist,numlist,outdent,indent,blockquote,undo,",
               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]",
             });
stef's avatar
stef committed
75
76
77
78
79
80
   $(".confirm > .button").click(function(){
            $(this).next().toggleClass('hidden');
         });
   $(".cancel-button").click(function(){
            $(this).parent().parent().parent().parent().addClass('hidden');
         });
stef's avatar
stef committed
81
82
83
84
85
});
</script>
{% endblock %}

{%block content%}
stef's avatar
stef committed
86
<div id='global'>
stef's avatar
stef committed
87
88
89
90
91
92
93
  {% if messages %}
  <ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
  </ul>
  {% endif %}
94
95
96
97
98
  <div id='addForm' class='index'>
    <h2>{% trans "Add New Infringement" %}</h2>
    <form name="addForm" enctype="multipart/form-data" action="{% root_url %}/add/" method="post">
      {% for field in form %}
      {% if field.html_name = 'resource' %}<div id="show_optionals">{% trans "Provide optional details" %}</div><div id="optional">{%endif%}
stef's avatar
stef committed
99
      <div class="fieldWrapper">
stef's avatar
stef committed
100
         {% if field.help_text %}<span class="help_text">{{ field.help_text }}</span>{% endif %}
stef's avatar
stef committed
101
        <span class="innerfield">
stef's avatar
stef committed
102
103
          {{ field.errors }}
          {{ field.label_tag }} {{ field }}
104
        </span>
stef's avatar
stef committed
105
      </div>
106
107
108
109
110
      {% endfor %}
    </div>
    {% csrf_token %}
    <input id="save_button" type="submit" value="{% trans "save" %}" />
    </form>
stef's avatar
stef committed
111
112
  </div>
  <div id='content'>
stef's avatar
stef committed
113
   <h2>{% trans "On Internet, you decide what you do, right? Not anymore!" %}</h2>
stef's avatar
stef committed
114
115
     <p>{% trans "We all rely more and more on our access to Internet to do serious things like find jobs and fun things like chat with friends. But telco's are increasingly trying to control your behavior online, by restricting the things you are doing on the internet. Now you have a chance to do something about that!" %}</p>
     <p>{% trans "Help us chart all the ways that internet providers are violating our online freedom: Is your operator blocking or throttling your Internet communications, for instance by making it impossible to use chat programs or charging extra for Internet telephony? Let us know by filling up this form (it takes less than two minutes!). We will make sure that the relevant authorities are informed, so that we can put an end to this." %}</p>
stef's avatar
stef committed
116
   <h2>{% trans "Latest Infringements" %}</h2>
stef's avatar
stef committed
117
118
119
120
121
122
123
124
  <table>
    <thead>
      <tr>
        <th>{% trans "Infringing offering" %}</th>
        <th>{% trans "Confirmed" %}</th>
        <th>{% trans "I Confirm" %}</th>
      </tr>
    </thead>
125
126
127
128
129
  {% for violation in violations %}
  <tbody>
    <tr>
      <td><a href="/view/{{violation.pk}}">{{ violation.operator }} ({{ violation.country }}) {{ violation.contract }}</a></td>
      <td class='align-right'>{{ violation.confirmations }}</td>
stef's avatar
stef committed
130
      <td class='align-right'><div class="confirm"><a class="button">+1</a>
stef's avatar
stef committed
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
      <div class="hidden confirm_popup alpha60">
         <div>
            <h3>{% trans "Confirmation" %}</h3>
            <div>
            <small>{% trans "I attest the existence of this infringement" %}<br />
            <a href="/view/{{violation.pk}}">{{ violation.operator }} ({{ violation.country }}) {{ violation.contract }}</a></small>
            <form method="get" class="confirm_form" id="{{ violation.pk }}">
               {% trans "E-mail" %}: <input type="text" name="email" /><br />
               //{% trans "required" %}<br />
               <input type="hidden" value="{{ violation.pk }}" />
               <input type="submit" value="confirm" />
               <input class="cancel-button" type="button" value="{% trans "cancel" %}" />
            </form>
            </div>
         </div>
146
147
148
149
150
151
152
153
      </div>
      </td>
    </tr>
    {% endfor %}
  </tbody>
</table>
</div>
</div>
stef's avatar
stef committed
154
{%endblock%}