$('#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);
});
<td>{% if user.is_staff %}
<a id="validate" href="#" class="{% if answer.validated %}component_icon button icon_ok{% else %}component_icon button icon_delete{% endif %}"
onclick="var f = answerUtils;
- if ($(this).hasClass('icon_ok')) {f.reject('{{answer.id}}', $(this)); return false;}
- if ($(this).hasClass('icon_delete')) {f.validate('{{answer.id}}', $(this)); return false;}">
+ 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 %}</a>
{% endif %}
</td>