Commit 5646e531 authored by Okhin's avatar Okhin

Starting the work on the new form content

parent ac349d94
......@@ -30,10 +30,10 @@ class AddViolation(forms.Form):
nick = forms.CharField(required=False, label=_("Name or nickname"), help_text=_("We need some name to display that instead of an email address."))
attachments = MultiFileField(required=False, label=_("Attach screenshot, document or any other relevant information."))
resource = forms.ChoiceField(required=False, choices=(('',''),)+tuple(sorted(RESOURCES,key=itemgetter(1))), label=_('What is the affected resource type. (optional)'))
type = forms.ChoiceField(required=False, choices=(('',''),)+tuple(sorted(TYPES,key=itemgetter(1))), label=_('Is the Resource Blocked or otherwise discrimated? (optional)'))
type = forms.ChoiceField(required=True, choices=(('',''),)+tuple(sorted(TYPES,key=itemgetter(1))), label=_('What types of resctriction happens in this case?)'))
temporary = forms.BooleanField(required=False, label=_('Is the restriction only temporary, e.g. due to network overload? (optional)'))
loophole = forms.BooleanField(required=False, label=_('Is there another offer provided by this Operator which removes this restriction? (optional)'))
contractual = forms.BooleanField(required=False, label=_('Is the restriction described in the subscribers contract? (optional)'))
contractual = forms.BooleanField(required=False, label=_('The restriction is described in the subscribers contract.'))
contract_excerpt = forms.CharField(required=False, widget=AdvancedEditor(), label=_('Please copy the relevant section describing the restriction from the user contract. (optional)'))
captcha = CaptchaField(label=_("In order to protect against spam, please fill in the result of the following calculation. (note the + and the * are somewhat confusing)"))
......@@ -46,9 +46,9 @@ class SearchViolation(SearchForm):
def search(self):
# By default, the search field is q. So let's check if it's empty
if not self.cleaned_data['q']:
sqs = SearchQuerySet().all()
sqs = SearchQuerySet().all().exclude(old=True)
else:
sqs = super(SearchViolation, self).search()
sqs = super(SearchViolation, self).search().exclude(old=True)
if not self.is_valid():
return self.no_query_found()
......
......@@ -5,6 +5,7 @@ from django_comments.moderation import CommentModerator, moderator
COUNTRIES = (
('BE', _('Belgium')),
('BG', _('Bulgaria')),
('CH', _('Switzerland')),
('CZ', _('Czech Republic')),
('DK', _('Denmark')),
('DE', _('Germany')),
......@@ -13,9 +14,11 @@ COUNTRIES = (
('EL', _('Greece')),
('ES', _('Spain')),
('FR', _('France')),
('IC', _('Iceland')),
('IS', _('Iceland')),
('IT', _('Italy')),
('CY', _('Cyprus')),
('LI', _('Liechtenstein')),
('LV', _('Latvia')),
('LT', _('Lithuania')),
('LU', _('Luxembourg')),
......@@ -38,13 +41,21 @@ RESOURCES = (
('port', _('port')),
('protocol', _('protocol')),
('service', _('service')),
('site', _('site')),
('site', _('website')),
('user', _('user')),
('ip', _('ip')),
('video', _('video streaming')),
('audio', _('audio streaming')),
('class', _('class of application or contraint')),
('other', _('other')
)
TYPES = (
('zerorating', _('Zero Rating')),
('blocking', _('Blocking')),
('throttling', _('Throttling')),
('prioritisation', _('Prioritisation')),
('specialised', _('Specialised Service')),
('other', _('Other'))
)
MEDIA = (
('fixed', _('Fixed')),
......
......@@ -157,16 +157,16 @@
<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>." %}
<form name="addForm" enctype="multipart/form-data" action="/" method="post" class="form">
{% csrf_token %}
{% bootstrap_field form.resource_name %}
{% bootstrap_field form.country %}
{% bootstrap_field form.operator %}
{% bootstrap_field form.contract %}
{% bootstrap_field form.media %}
{% bootstrap_field form.contractual %}
{% bootstrap_field form.type %}
<div class="collapse" id="collapseField">
{% bootstrap_field form.temporary %}
{% bootstrap_field form.loophole %}
{% bootstrap_field form.type %}
{% bootstrap_field form.contractual %}
{% bootstrap_field form.resource_name %}
{% bootstrap_field form.resource %}
{% bootstrap_field form.contract_excerpt %}
{% bootstrap_field form.attachments %}
......
{% extends 'base.html' %}
{% load bt %}
{% load i18n %}
{% load bootstrap3 %}
{% block active_tab_search %}id="current"{% endblock %}
{% block styles %}
<link rel="stylesheet" href="/static/css/map.css" type="text/css" />
......@@ -21,23 +22,27 @@ $("#sortedList").tablesorter({
{% endblock %}
{% block content %}
<div id="global">
{% trans "Search through cases" %}
<div id="map"> </div>
<form method="get" action=".">
{{ form.as_p }}
<input type="submit" value="Search">
</form>
<div class="row">
<div class="col-xs-12 col-md-8">
{% trans "Search through cases" %}
<form method="get" class="form" action="/Search/">
{% bootstrap_form form %}
{% buttons %}
<button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
{% endbuttons %}
</form>
{% if query %}
<h3>Results</h3>
{% if query %}
<h3>Results</h3>
<h2 id="stats-title">{% trans "Statistics" %}</h2>
<ul id="stats">
{% for t, n in stats %}
<li class="stat"><dl><dt class="inline">{{t}}</dt><dd class="inline"><strong>{{n}}</strong></dd></dl></li>
{% endfor %}
</ul>
<h2 id="stats-title">{% trans "Statistics" %}</h2>
<ul id="stats">
{% for t, n in stats %}
<li class="stat"><dl><dt class="inline">{{t}}</dt><dd class="inline"><strong>{{n}}</strong></dd></dl></li>
{% endfor %}
</ul>
</div>
<div class="hidden-sm col-md-4" id="map"> </div>
</div>
<div class="table-responsive" id="table">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment