From: Guillaume Pellerin Date: Tue, 23 Apr 2013 13:38:32 +0000 (+0200) Subject: avoid multiple testimonial submission X-Git-Tag: 2.8.1-pro~491^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=54e4b17b2d48ffda58595b53edd26bd764c5f657;p=teleforma.git avoid multiple testimonial submission --- diff --git a/teleforma/templates/teleforma/answer_detail.html b/teleforma/templates/teleforma/answer_detail.html index 4b205195..c0a86f0f 100644 --- a/teleforma/templates/teleforma/answer_detail.html +++ b/teleforma/templates/teleforma/answer_detail.html @@ -12,11 +12,13 @@ $(document).ready(function(){ $('#validate').unbind('click').click(function() { json(['{{answer.id}}'],'teleforma.validate_answer'); + $('#validate').unbind('click'); setTimeout(function() {window.location.href = "{% url teleforma-answers %}";}, 1000); }); $('#reject').unbind('click').click(function() { json(['{{answer.id}}'],'teleforma.reject_answer'); + $('#reject').unbind('click'); setTimeout(function() {window.location.href = "{% url teleforma-answers %}";}, 1000); }); diff --git a/teleforma/templates/teleforma/inc/answer_list.html b/teleforma/templates/teleforma/inc/answer_list.html index 3742e5ac..686270e3 100644 --- a/teleforma/templates/teleforma/inc/answer_list.html +++ b/teleforma/templates/teleforma/inc/answer_list.html @@ -29,8 +29,8 @@ {% if user.is_staff %} + if ($(this).hasClass('icon_ok')) {f.reject('{{answer.id}}', $(this)); $(this).unbind('click'); return false;} + if ($(this).hasClass('icon_delete')) {f.validate('{{answer.id}}', $(this)); $(this).unbind('click'); return false;}"> {% if answer.validated %}{% trans " validated" %}{% else %}{% trans " rejected" %}{% endif %} {% endif %}