index.html 9.1 KB
Newer Older
Okhin's avatar
Okhin committed
1
2
3
{% extends "base.html" %}
{% load bt %}
{% load i18n %}
Okhin's avatar
Okhin committed
4
{% load bootstrap3 %}
5
{% block active_tab_home %}class="active"{% endblock %}
Okhin's avatar
Okhin committed
6
{% block styles %}
7
<link rel="stylesheet" type="text/css" media="all" href="/static/css/jquery-ui.css" />
Okhin's avatar
Okhin committed
8
9
10
{% endblock %}

{% block scripts %}
Okhin's avatar
Okhin committed
11
12
13
14
15
16
17
<script type="text/javascript">
$('.metoo').submit(function(event) {
	event.preventDefault();
	var form = $(this);
	var pk = form.attr("id").split("-")[1];
	var email = form.find("#email-" + pk).val();
	console.log("pk: " + pk + "email: " + email);
18

Okhin's avatar
Okhin committed
19
20
21
22
23
	$.ajax({
		url: "/confirm/" + pk + "/" + email,
		success: function(data) {
			form.find("div").html(data);
		}
24
	});
Okhin's avatar
Okhin committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
}
$("#lookup_btn").click(function(event) {
	event.preventDefault();
	$.ajax({
		dataType: "json",
		url: "/lookup/",
		data: {
			country: $("#id_country").val(),
			operator: $("#id_operator").val(),
			contract: $("#id_contract").val(),
			media: $("#id_media").val(),
			type: $("#id_type").val(),
		},
		success: function(data) {
			var filtered = data.filter(function(data) {
				return data.fields.state in ["ooscope", "duplicate"]
			});
			if (filtered.length == 0) {
				$("#lookup_btn").parent().parent().hide();
				$("#collapseField").collapse('show');
				return;
			}
Okhin's avatar
Okhin committed
47

Okhin's avatar
Okhin committed
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
			filtered = filtered.slice(0, 10);
			$.each(filtered, function(key, obj) {
				if (obj.fields.state in ["ooscope", "duplicate"]) {
					return;
				};
				$("#modal-list").append(
						"<dt>" + obj.fields.resource + "</dt>" +
						"<dd><p>" + obj.fields.editorial + "</p>" +
						"<div class=\"confirm\"><a class=\"btn btn-default\">{% trans "Me too!" %}</a>" +
						"<div class=\"info-validate float-confirm\">" +
						"<form method=\"get\" action=\"\" id=\"i" + obj.pk + "\" class=\"confirm_form\">" +
						"<div>" +
						"<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=\"{{obj.pk}}\" />" +
						"<input type=\"submit\" value=\"{% trans "Ok" %}\" />" +
						"</div>" +
						"</form>" +
						"</div>" +
						"</dd>"
						);
			});
			$('#similar_modal').modal('show');
			console.log("Modal displayed");
		},
		error: function(xhr, status, err) {
			console.log(err, xhr);
		}
76
	});
Okhin's avatar
Okhin committed
77
78
79
80
81
82
83
84
85
});

$("#btn_dismiss").click(function(event) {
	event.preventDefault();
	$("#similar_modal").modal('hide');
	$("#lookup_btn").parent().parent().hide();
	$("#collapseField").collapse('show');
});
</script>
Okhin's avatar
Okhin committed
86
87
88
{% endblock %}

{%block content%}
Okhin's avatar
Okhin committed
89
<div class="row">
Okhin's avatar
Okhin committed
90
	<div class="col-xs-12 col-md-8" id="content">
piks3l's avatar
piks3l committed
91
		<h2>{% trans "On the Internet, <strong>you</strong> decide what you do, right? <i>Maybe not!</i>" %}</h2>
piks3l's avatar
piks3l committed
92
		<p>{% trans "Telecommunication providers and Internet companies are trying 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 or applications. The main aim of RespectMyNet is to bring attention to these Net Neutrality violations and demand that regulators take action to stop this. " %}</p>
93
94
		<p>{% trans "The EU law recently adopted on Net Neutrality is ambiguous and the telecom regulators have the job of deciding how it should be implemented." %}
		<p>{% trans "You can help. You can report Net Neutrality violations and help the regulators protect the open Internet in Europe!" %}</p>
piks3l's avatar
piks3l committed
95
		<p>{% trans "Help us keep track of all the ways that Internet providers are violating our online freedoms. Tell us about how your landline or mobile Internet operator restricts your Internet connection. It will take less than two minutes!" %}</p>
piks3l's avatar
piks3l committed
96
		<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>
97
98
99
100
		<h2 id="stats-title">{% trans "Statistics" %}</h2>
		<div id="stats_graph" ></div>
		<ul id="stats">
			{% for t, n in stats %}
Okhin's avatar
Okhin committed
101
102
103
104
105
106
			<li class="stat">
				<dl>
					<dt class="inline">{{t}}</dt>
					<dd class="inline"><strong>{{n}}</strong></dd>
				</dl>
			</li>
107
108
109
			{% endfor %}
		</ul>
		<h2 id="featured-title">{% trans "Featured Cases" %}</h2>
110
		<table class="table table-stripped" id="featured_cases">
111
112
113
114
115
116
117
118
119
120
121
			<thead>
				<tr>
					<th style="width: 70%;">{% trans "Infringing offering" %}</th>
					<th>{% trans "Confirmed" %}</th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				{% for violation in violations %}
				<tr>
					<td><a href="{{ violation.get_absolute_url }}">{{ violation.operator }} ({{ violation.country|country }}) {{ violation.contract }}</a>
Okhin's avatar
Okhin committed
122
						<div class="well collapse" id="info-{{ violation.pk }}">
Okhin's avatar
Okhin committed
123
							<form method="post" class="metoo" action="/confirm/{{ violation.pk }}" id="{{ violation.pk }}">
Okhin's avatar
Okhin committed
124
125
126
127
								<div class="form-group form-inline">
									<label for"email-{{ violation.pk }}">{% trans "In order to <strong>confirm</strong> this report, please enter your email address" %}</label>
									{% csrf_token %}
									<input type="email" id="email-{{ violation.pk }}" class="form-control" name="email" placeholder="Email"/>
Okhin's avatar
Okhin committed
128
									<input type="hidden" id="id-{{ violation.pk }}" value="{{ violation.pk }}" />
Okhin's avatar
Okhin committed
129
130
									<div class="btn-group" role="group" aria-label="confirm-deny">
										<button class="btn btn-success">{% trans "OK" %}</ button>
Okhin's avatar
Okhin committed
131
											<button data-toggle="collapse" data-target="#info-{{ violation.pk}}" aria-expanded="false" aria-controls="info-{{ volation.pk }}" type="button" class="btn btn-danger" >{% trans "Cancel" %}</button>
Okhin's avatar
Okhin committed
132
133
									</div>
								</div>
134
135
136
137
							</form>
						</div>
					</td>
					<td class='align-right'>{{ violation.confirmations }}</td>
Okhin's avatar
Okhin committed
138
					<td class='align-right'><button type="button" class="btn btn-default" data-toggle="collapse" data-target="#info-{{ violation.pk}}" aria-expanded="false" aria-controls="info-{{ volation.pk }}">{% trans "Me too!" %}</button>
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<div id="description" class='round-box'>
							<strong>{% trans "Affected Resource" %}:</strong> {{violation.resource_name}}
							{%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|date:"SHORT_DATE_FORMAT" }}</span>
						</div>
						{%endfor%}
					</td>
				</tr>
				{% endfor %}
			</tbody>
		</table>
Okhin's avatar
Okhin committed
155
	</div>
Alfa's avatar
Alfa committed
156
	<div id="add-case" class="col-xs-12 col-md-4">
Okhin's avatar
Okhin committed
157
158
159
160
161
		<div class="panel panel-info">
			<div class="panel-heading">
				<h2>{% trans "Add New Case" %}</h2>
			</div>
			<div class="panel-body">
Okhin's avatar
Okhin committed
162
				{% if forms.error %}
Okhin's avatar
Okhin committed
163
164
165
166
167
168
169
				{% for field in form %}
				{% for error in field.error %}
				<div class="alert alert-error">
					{{ error|escape }}
				</div>
				{% endfor %}
				{% endfor %}
Okhin's avatar
Okhin committed
170
				{% endif %}
171
				<p>{% trans "Please report cases of zero-rating (services which are excluded from your download limit), specialised services or the blocking, throttling or prioritisation of online services. For a more detailed description of what to report, check our <a href='/about/#guidelines'>guidelines</a>." %}
Okhin's avatar
Okhin committed
172
				<form name="addForm" enctype="multipart/form-data" action="/" method="post" class="form">
Okhin's avatar
Okhin committed
173
174
175
176
177
					{% csrf_token %}
					{% bootstrap_field form.country %}
					{% bootstrap_field form.operator %}
					{% bootstrap_field form.contract %}
					{% bootstrap_field form.media %}
178
					{% bootstrap_field form.type %}
Okhin's avatar
Okhin committed
179
					<div class="collapse" id="collapseField">
Okhin's avatar
Okhin committed
180
						<hr />
Okhin's avatar
Okhin committed
181
182
						{% bootstrap_field form.temporary %}
						{% bootstrap_field form.loophole %}
183
184
						{% bootstrap_field form.contractual %}
						{% bootstrap_field form.resource_name %}
Okhin's avatar
Okhin committed
185
186
187
188
						{% bootstrap_field form.resource %}
						{% bootstrap_field form.contract_excerpt %}
						{% bootstrap_field form.attachments %}
						{% bootstrap_field form.comment %}
Okhin's avatar
Okhin committed
189
						<hr />
Okhin's avatar
Okhin committed
190
191
192
						{% bootstrap_field form.consent %}
						{% bootstrap_field form.email %}
						{% bootstrap_field form.nick %}
Okhin's avatar
Okhin committed
193
						{% bootstrap_field form.captcha %}
Okhin's avatar
Okhin committed
194
						{% buttons %}
Okhin's avatar
Okhin committed
195
						<button type="submit" class="btn btn-primary">{% trans "save" %}</button>
Okhin's avatar
Okhin committed
196
197
198
						{% endbuttons %}
					</div>
				</form>
Okhin's avatar
Okhin committed
199
200
			</div>
			<div class="panel-footer">
Okhin's avatar
Okhin committed
201
				{% buttons %}
Okhin's avatar
Okhin committed
202
				<button id="lookup_btn" class="btn btn-default" type="button">{% trans "Continue" %}</button>
Okhin's avatar
Okhin committed
203
204
205
206
207
208
209
210
211
212
213
214
215
216
				{% endbuttons %}
			</div>
		</div>
	</div>
</div>
<div class="modal fade" id="similar_modal" tabindex="-1" role="dialog" aria-labelledby="SimilarModalLabel">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="SimilarModalLabel">{% trans "Similar cases" %}</h4>
			</div>
			<div class="modal-body">
				<p>{% trans "Those are cases that might be similar to yours, please feel free to add your input on those cases instead of adding yours if they overlap." %}</p>
217
218
				<dl id="modal-list">
				</dl>
Okhin's avatar
Okhin committed
219
				</table>
Okhin's avatar
Okhin committed
220
221
222
			</div>
			<div class="modal-footer">
				<button type="button" id="btn_dismiss" class="btn btn-default" data-dismiss="modal">{% trans "Dismiss" %}</button>
Okhin's avatar
Okhin committed
223
224
225
			</div>
		</div>
	</div>
Okhin's avatar
Okhin committed
226
</div>
Okhin's avatar
Okhin committed
227
{%endblock%}