Commit eebfe201 authored by Okhin's avatar Okhin

Fixing the form captchas

parent e7763914
......@@ -23,14 +23,14 @@ class AddViolation(forms.Form):
country = forms.ChoiceField(required=True, choices=(('',''),)+tuple(sorted(COUNTRIES,key=itemgetter(1))), label=_("Country"), help_text=_('EU member state where the restriction is reported.'))
operator = forms.CharField(required=True, max_length=256, label=_("Operator"), help_text=_('The ISP or operator providing the Internet service.'))
contract = forms.CharField(required=True, max_length=256, label=_("Contract"), help_text=_('The specific contract at the ISP provider. (please be as specific as possible)'))
media = forms.ChoiceField(required=True, choices=(('',''),)+tuple(sorted(MEDIA,key=itemgetter(1))), label=_('Is the Internet connection over mobile or fixed line?'))
media = forms.ChoiceField(required=True, choices=tuple(sorted(MEDIA,key=itemgetter(1))), label=_('Is the Internet connection over mobile or fixed line?'))
comment = forms.CharField(required=True, widget=AdvancedEditor(), label=_('Please describe the symptoms you are experiencing.'))
email = forms.EmailField(required=True, label=_('Email (set this to enable saving)'), help_text=_("We need your email to validate your report. Your email address is obligatory, but we will never use your personal data for anything else than checking the submission. (see next for an optional exception)"))
consent = forms.BooleanField(required=False, label=_("I want to help further"), help_text=_("We need your consent to contact you for clarifications regarding your report. This is optional, but helps us improve the quality of the reports. Thanks!"))
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=True, choices=(('',''),)+tuple(sorted(TYPES,key=itemgetter(1))), label=_('What types of resctriction happens in this case?)'))
resource = forms.ChoiceField(required=False, choices=tuple(sorted(RESOURCES,key=itemgetter(1))), label=_('What is the affected resource type. (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=_('The restriction is described in the subscribers contract.'))
......
......@@ -48,7 +48,8 @@ h1, h2, h3, h4, div { padding: 0; margin: 0; }
#addForm .fieldWrapper label { display: inline-block; min-width: 6em; }
#addForm.index .help_text { font-size: 0.7em; width: 30%; position: relative; float: right; left: 0; }
.index #add_attach { cursor: pointer; }
#id_captcha_1 { width: 2em; }
img.captcha {float: left; }
#id_captcha_1 { width: auto; }
.innerfield { display: inline-block; margin-top: 0.5em;}
.align-right { text-align: right;}
dd.text { width: 50%; display: block !important; }
......@@ -757,4 +758,4 @@ input[type="text"], input[type="textarea"] {
.navbar-right input[type="text"]{
width:100px;
}
}
\ No newline at end of file
}
......@@ -16,17 +16,17 @@
url: "/lookup/",
data: {
country: $("#id_country").val(),
q: $("#id_ressource").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").hide();
$("#lookup_btn").parent().parent().hide();
$("#collapseField").collapse('show');
return;
}
......@@ -65,7 +65,7 @@
$("#btn_dismiss").click(function(event) {
event.preventDefault();
$("#similar_modal").modal('hide');
$("#lookup_btn").hide();
$("#lookup_btn").parent().parent().hide();
$("#collapseField").collapse('show');
});
</script>
......@@ -163,6 +163,7 @@
{% bootstrap_field form.media %}
{% bootstrap_field form.type %}
<div class="collapse" id="collapseField">
<hr />
{% bootstrap_field form.temporary %}
{% bootstrap_field form.loophole %}
{% bootstrap_field form.contractual %}
......@@ -171,6 +172,7 @@
{% bootstrap_field form.contract_excerpt %}
{% bootstrap_field form.attachments %}
{% bootstrap_field form.comment %}
<hr />
{% bootstrap_field form.consent %}
{% bootstrap_field form.email %}
{% bootstrap_field form.nick %}
......@@ -180,8 +182,10 @@
{% endbuttons %}
</div>
</form>
</div>
<div class="panel-footer">
{% buttons %}
<button id="lookup_btn" class="btn btn-default" type="button">...</button>
<button id="lookup_btn" class="btn btn-default" type="button">{% trans "Continue" %}</button>
{% endbuttons %}
</div>
</div>
......
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