From 54e4b17b2d48ffda58595b53edd26bd764c5f657 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 23 Apr 2013 15:38:32 +0200 Subject: [PATCH] avoid multiple testimonial submission --- teleforma/templates/teleforma/answer_detail.html | 2 ++ teleforma/templates/teleforma/inc/answer_list.html | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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 %} -- 2.39.5