From: yomguy Date: Mon, 21 Jan 2013 10:17:48 +0000 (+0100) Subject: fix answer validation, bugfix X-Git-Tag: 0.9-probarreau~121 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=66406661cbbf54c04bc834bc7f8ffad9463afdfd;p=teleforma.git fix answer validation, bugfix --- diff --git a/teleforma/templates/teleforma/answer_detail.html b/teleforma/templates/teleforma/answer_detail.html index 68a1b393..b018a220 100644 --- a/teleforma/templates/teleforma/answer_detail.html +++ b/teleforma/templates/teleforma/answer_detail.html @@ -3,12 +3,28 @@ {% load i18n %} {% block extra_javascript %} - +{% endblock extra_javascript %} + +{% block infra_javascript %} -{% endblock extra_javascript %} +{% endblock infra_javascript %} {% block course_content %} @@ -27,7 +43,7 @@

{% trans "Answer" %}

-
+
{{ answer.answer|safe }}
@@ -35,8 +51,8 @@
{% if user.is_staff %} -{% trans " validate" %} -{% trans " reject" %} +{% trans " validate" %} +{% trans " reject" %} {% endif %} {% endblock course_content %} diff --git a/teleforma/templates/teleforma/answers.html b/teleforma/templates/teleforma/answers.html index b9bd6e7a..92e34441 100644 --- a/teleforma/templates/teleforma/answers.html +++ b/teleforma/templates/teleforma/answers.html @@ -15,14 +15,14 @@ var answerUtils = { validate : function(id, a){ json([id],'teleforma.validate_answer',function(){ - a.removeClass('icon_delete').addClass('icon_ok') - a.html('{% trans " validated" %}') + a.removeClass('icon_delete').addClass('icon_ok'); + a.html('{% trans " validated" %}'); }); }, reject : function(id, a){ json([id],'teleforma.reject_answer',function(){ - a.removeClass('icon_ok').addClass('icon_delete') - a.html('{% trans " rejected" %}') + a.removeClass('icon_ok').addClass('icon_delete'); + a.html('{% trans " rejected" %}'); }); } } diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 52cd07be..03442fc3 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -176,7 +176,7 @@ class AnswerView(FormView): context['status'] = self.status context['seminar'] = self.question.seminar context['seminar_progress'] = seminar_progress(user, self.question.seminar) - revision, c = SeminarRevision.objects.get_or_create(seminar=seminar, user=user) + revision, c = SeminarRevision.objects.get_or_create(seminar=self.question.seminar, user=user) revision.save() return context