X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/9b59b6bb395208c913ce5ce19212dd5341cfa98a..97437472d927023d91b7fbb1a35e57af373bfb7e:/forum/skins/default/templates/ask.html diff --git a/forum/skins/default/templates/ask.html b/forum/skins/default/templates/ask.html index c17ea51..f2b5b53 100644 --- a/forum/skins/default/templates/ask.html +++ b/forum/skins/default/templates/ask.html @@ -33,12 +33,16 @@ }); //Tags autocomplete action - $("#id_tags").autocomplete("/matching_tags/", { + $("#id_tags").autocomplete("{% url matching_tags %}", { minChars: 1, matchContains: true, - max: 20, + max: 10, multiple: true, multipleSeparator: " ", + highlightItem: true, + scroll: true, + scrollHeight: 300, + /* formatItem: function(row, i, max) { @@ -50,21 +54,31 @@ */ formatItem: function(row, i, max, value) { - return row[1].split(".")[0] + " (" + row[1].split(".")[1] + ")"; + return row[1] + " (" + row[2] + ")"; }, formatResult: function(row, i, max, value){ - return row[0]; + return row[1]; } }); + }); + function submitClicked(e, f) { + if(!(browserTester('chrome') || browserTester('safari'))) { + $("input.submit")[0].disabled=true; + } + window.removeEventListener('beforeunload', beforeUnload, true); + if (f) { + f.submit(); + } + } + function beforeUnload(e) { if($("input#id_title")[0].value != "" || $("textarea#editor")[0].value != "" || $("input#id_tags")[0].value != "") { - yourWorkWillBeLost(e); + return yourWorkWillBeLost(e); } - return false; } window.addEventListener('beforeunload', beforeUnload, true); @@ -80,6 +94,7 @@
+ {% csrf_token %} {% if not request.user.is_authenticated %}
{% trans "You are welcome to start submitting your question anonymously." %} @@ -114,6 +129,7 @@ {% trans "toggle preview" %} + {% if settings.WIKI_ON %} {{ form.wiki }} {{ form.wiki.label_tag }} @@ -133,10 +149,19 @@

{{ form.tags.help_text }}

- {% if not request.user.is_authenticated %} - + + {% if form.recaptcha %} +
+ {{ form.recaptcha.errors }} + {{ form.recaptcha }} +
+
+ {% endif %} + + {% if not request.user.is_authenticated %} + {% else %} - + {% endif %}