From b48f1a1e5852bf7cfe5851fa3c1277c0827d45cb Mon Sep 17 00:00:00 2001 From: yomguy Date: Thu, 3 Jan 2013 00:38:22 +0100 Subject: [PATCH] fix seminar steps --- .../templates/teleforma/answer_form.html | 25 +-------- .../teleforma/inc/document_step.html | 12 ++++ .../templates/teleforma/inc/media_step.html | 33 +++++++++++ .../teleforma/inc/question_step.html | 22 ++++++++ teleforma/templates/teleforma/inc/steps.html | 56 +++++++++++++++++++ .../teleforma/inc/testimonial_step.html | 12 ++++ .../templates/teleforma/seminar_detail.html | 5 +- teleforma/views/pro.py | 2 +- 8 files changed, 139 insertions(+), 28 deletions(-) create mode 100644 teleforma/templates/teleforma/inc/document_step.html create mode 100644 teleforma/templates/teleforma/inc/media_step.html create mode 100644 teleforma/templates/teleforma/inc/question_step.html create mode 100644 teleforma/templates/teleforma/inc/steps.html create mode 100644 teleforma/templates/teleforma/inc/testimonial_step.html diff --git a/teleforma/templates/teleforma/answer_form.html b/teleforma/templates/teleforma/answer_form.html index fb3cd774..446caccb 100644 --- a/teleforma/templates/teleforma/answer_form.html +++ b/teleforma/templates/teleforma/answer_form.html @@ -92,31 +92,8 @@ $(document).ready(function(){ {% block index %}

status {% trans "Steps" %}

-
- - {% with seminar.docs_1 as docs %} - {% include "teleforma/inc/document_simple_list.html" %} - {% endwith %} - - {% with seminar.media as media_packages %} - {% include "teleforma/inc/media_package_list.html" %} - {% endwith %} - - {% with seminar.docs_2 as docs %} - {% include "teleforma/inc/document_simple_list.html" %} - {% endwith %} - - {% with seminar.question as questions %} - {% include "teleforma/inc/question_list.html" %} - {% endwith %} - - {% if seminar_progress == 100 %} - {% with seminar.docs_correct as docs %} - {% include "teleforma/inc/document_simple_list.html" %} - {% endwith %} - {% endif %} - + {% include "teleforma/inc/steps.html" %}
{% endblock index %} diff --git a/teleforma/templates/teleforma/inc/document_step.html b/teleforma/templates/teleforma/inc/document_step.html new file mode 100644 index 00000000..b97fccf0 --- /dev/null +++ b/teleforma/templates/teleforma/inc/document_step.html @@ -0,0 +1,12 @@ +{% load teleforma_tags %} +{% load i18n %} + + + + {% for doc in docs.all %} + + + + {% endfor %} + +
{% if doc.file %}{% endif %} {{ doc.title }}{% if doc.file %}{% endif %}
\ No newline at end of file diff --git a/teleforma/templates/teleforma/inc/media_step.html b/teleforma/templates/teleforma/inc/media_step.html new file mode 100644 index 00000000..fa70aea4 --- /dev/null +++ b/teleforma/templates/teleforma/inc/media_step.html @@ -0,0 +1,33 @@ +{% load teleforma_tags %} +{% load thumbnail %} +{% load i18n %} + + + + {% for media_package in media_packages.all %} + {% with media_package.video.all.0 as media %} + {% if media.is_published or user.is_staff %} + + + + {% endif %} + {% endwith %} + {% endfor %} + +
+ + {% if media.item.related.all %} + {% with media.item.related.all.0 as related %} + {% if related.title == "preview" %} + {% thumbnail related.file "168x96" as im %} +
+ {% trans 'Click here' %} +
+ {% endthumbnail %} + {% endif %} + {% endwith %} + {% else %} + {% trans 'Click here' %} + {% endif %} +
+
\ No newline at end of file diff --git a/teleforma/templates/teleforma/inc/question_step.html b/teleforma/templates/teleforma/inc/question_step.html new file mode 100644 index 00000000..e74e6eea --- /dev/null +++ b/teleforma/templates/teleforma/inc/question_step.html @@ -0,0 +1,22 @@ +{% load teleforma_tags %} +{% load i18n %} + + + + {% for question in questions.all %} + + + + + {% endfor %} + +
+ {{ question.title }}{% if question.rank %} n°{{ question.rank }}{% endif %} + {% if question|submitted:user and not question|validated:user %} + + {% elif question|saved:user and not question|submitted:user %} + + {% elif question|submitted:user and question|validated:user %} + + {% endif %} +
diff --git a/teleforma/templates/teleforma/inc/steps.html b/teleforma/templates/teleforma/inc/steps.html new file mode 100644 index 00000000..723239f3 --- /dev/null +++ b/teleforma/templates/teleforma/inc/steps.html @@ -0,0 +1,56 @@ +{% load teleforma_tags %} +{% load i18n %} + +{% with seminar.docs_1 as docs %} +
+

{% trans "Step" %} 1

+
+ {% include "teleforma/inc/document_step.html" %} +{% endwith %} + +{% with seminar.media as media_packages %} +
+

{% trans "Step" %} 2

+
+ {% include "teleforma/inc/media_step.html" %} +{% endwith %} + + +{% with seminar.docs_2 as docs %} +
+

{% trans "Step" %} 3

+
+ {% include "teleforma/inc/document_step.html" %} +{% endwith %} + +{% with seminar.question as questions %} +
+

{% trans "Step" %} 4

+
+ {% include "teleforma/inc/question_step.html" %} +{% endwith %} + + +{% if seminar_progress == 100 %} +{% with seminar.docs_correct as docs %} +
+

{% trans "Step" %} 5

+
+ {% include "teleforma/inc/document_step.html" %} +{% endwith %} + +{% with seminar.form as form %} +
+

{% trans "Step" %} 6 :

+
+ {% include "teleforma/inc/evaluation_form.html" %} +{% endwith %} +{% endif %} + +{% if seminar|validated:user %} +
+

{% trans "Step" %} 7

+
+ {% include "teleforma/inc/testimonial_step.html" %} +{% endif %} + diff --git a/teleforma/templates/teleforma/inc/testimonial_step.html b/teleforma/templates/teleforma/inc/testimonial_step.html new file mode 100644 index 00000000..77baa0fc --- /dev/null +++ b/teleforma/templates/teleforma/inc/testimonial_step.html @@ -0,0 +1,12 @@ +{% load teleforma_tags %} +{% load i18n %} + + + + + + + + +
{% trans "Testimonial" %} : {{ seminar.title }}{% if seminar.rank %} n°{{seminar.rank}}{% endif %}
+ diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index 9552b7fa..24c97141 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -54,8 +54,7 @@ $(function () { {% block course_content %} - - +

{% trans "Informations" %}

@@ -130,7 +129,7 @@ $(function () { {% endwith %} {% endif %} - {% if validated %} + {% if seminar_validated %}

{% trans "Step" %} 7 : {% trans "download your testimonial" %}

diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 3805cddc..128e30b3 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -108,7 +108,7 @@ class SeminarView(DetailView): context = super(SeminarView, self).get_context_data(**kwargs) seminar = self.get_object() context['seminar_progress'] = seminar_progress(self.request.user, seminar) - context['validated'] = seminar_validated(self.request.user, seminar) + context['seminar_validated'] = seminar_validated(self.request.user, seminar) return context -- 2.39.5