]> git.parisson.com Git - teleforma.git/commitdiff
fix seminar steps
authoryomguy <yomguy@parisson.com>
Wed, 2 Jan 2013 23:38:22 +0000 (00:38 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 2 Jan 2013 23:38:22 +0000 (00:38 +0100)
teleforma/templates/teleforma/answer_form.html
teleforma/templates/teleforma/inc/document_step.html [new file with mode: 0644]
teleforma/templates/teleforma/inc/media_step.html [new file with mode: 0644]
teleforma/templates/teleforma/inc/question_step.html [new file with mode: 0644]
teleforma/templates/teleforma/inc/steps.html [new file with mode: 0644]
teleforma/templates/teleforma/inc/testimonial_step.html [new file with mode: 0644]
teleforma/templates/teleforma/seminar_detail.html
teleforma/views/pro.py

index fb3cd774d38ac4ce2aed4514d1e747a5c15fda4e..446caccb7ff65a4792ee286703c6f4d25811ac95 100644 (file)
@@ -92,31 +92,8 @@ $(document).ready(function(){
 {% block index %}
 <div class="module">
   <h3><img src="{{STATIC_URL}}telemeta/images/module_playlist.png" alt="status" style="vertical-align:middle" /> {% trans "Steps" %}</h3>
  <div id="index">
-  
-          {% 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" %}
  </div>
 </div>
 {% endblock index %}
diff --git a/teleforma/templates/teleforma/inc/document_step.html b/teleforma/templates/teleforma/inc/document_step.html
new file mode 100644 (file)
index 0000000..b97fccf
--- /dev/null
@@ -0,0 +1,12 @@
+{% load teleforma_tags %}
+{% load i18n %}
+
+<table class="listing" width="100%">
+    <tbody>
+        {% for doc in docs.all %}
+            <tr>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="95%">{% if doc.file %}<a href="{% url teleforma-document-view doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ doc.title }}{% if doc.file %}</a>{% endif %}</td>
+            </tr>
+        {% endfor %}
+    </tbody>
+</table>
\ 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 (file)
index 0000000..fa70aea
--- /dev/null
@@ -0,0 +1,33 @@
+{% load teleforma_tags %}
+{% load thumbnail %}
+{% load i18n %}
+
+<table class="listing" width="100%">
+    <tbody>
+      {% for media_package in media_packages.all %}
+       {% with media_package.video.all.0 as media %}
+        {% if media.is_published or user.is_staff %}
+            <tr>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
+            <a href="{% url teleforma-media-video seminar.id media_package.id %}" title="{% trans "Play" %}">
+            {% if media.item.related.all %}
+             {% with media.item.related.all.0 as related %}
+              {% if related.title == "preview" %}
+               {% thumbnail related.file "168x96" as im %}
+                <div style="background: no-repeat url('{{ im.url }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
+                 <img src="{{ STATIC_URL }}teleforma/images/play_168.png" width="100%" alt="{% trans 'Click here' %}" />
+                </div>
+               {% endthumbnail %}
+              {% endif %}
+             {% endwith %}
+            {% else %}
+              {% trans 'Click here' %}
+            {% endif %}
+            </a>
+          </td>
+          </tr>
+        {% endif %}
+       {% endwith %}
+      {% endfor %}
+   </tbody>
+</table>
\ 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 (file)
index 0000000..e74e6ee
--- /dev/null
@@ -0,0 +1,22 @@
+{% load teleforma_tags %}
+{% load i18n %}
+
+<table class="listing" width="100%">
+    <tbody>
+        {% for question in questions.all %}
+            <tr>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="95%">
+               <a href="{% url teleforma-question-answer question.id %}">{{ question.title }}{% if question.rank %} n°{{ question.rank }}{% endif %}</a></td>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="5%" align="center">
+               {% if question|submitted:user and not question|validated:user %}
+                       <img src="{{ STATIC_URL }}teleforma/images/chronometer.png" style="vertical-align:middle" alt="" title="{% trans "Waiting for validation" %}" />
+               {% elif question|saved:user and not question|submitted:user %}
+                       <img src="{{ STATIC_URL }}telemeta/images/media-record.png" style="vertical-align:middle" alt="" title="{% trans "Saved" %}" />
+               {% elif question|submitted:user and question|validated:user %}
+                       <img src="{{ STATIC_URL }}telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans "Validated" %}" />
+               {% endif %}
+            </td>
+            </tr>
+        {% endfor %}
+    </tbody>
+</table>
diff --git a/teleforma/templates/teleforma/inc/steps.html b/teleforma/templates/teleforma/inc/steps.html
new file mode 100644 (file)
index 0000000..723239f
--- /dev/null
@@ -0,0 +1,56 @@
+{% load teleforma_tags %}
+{% load i18n %}
+        
+{% with seminar.docs_1 as docs %}
+  <div class="course_subtitle">
+    <h4><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 1</h4>
+  </div>
+  {% include "teleforma/inc/document_step.html" %}
+{% endwith %}
+
+{% with seminar.media as media_packages %}
+  <div class="course_subtitle">
+    <h4><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 2</h4>
+  </div>
+  {% include "teleforma/inc/media_step.html" %}  
+{% endwith %}
+
+
+{% with seminar.docs_2 as docs %}
+  <div class="course_subtitle">
+    <h4><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 3</h4>
+  </div>
+  {% include "teleforma/inc/document_step.html" %}
+{% endwith %}
+
+{% with seminar.question as questions %}
+  <div class="course_subtitle">
+    <h4><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 4</h4>
+  </div>
+  {% include "teleforma/inc/question_step.html" %}
+{% endwith %}
+
+
+{% if seminar_progress == 100 %}
+{% with seminar.docs_correct as docs %}
+   <div class="course_subtitle">
+    <h4><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 5</h4>
+  </div>
+  {% include "teleforma/inc/document_step.html" %}
+{% endwith %}
+
+{% with seminar.form as form %}
+  <div class="course_subtitle">
+    <h4><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 6 :</h4>
+  </div>
+  {% include "teleforma/inc/evaluation_form.html" %}
+{% endwith %}
+{% endif %}
+
+{% if seminar|validated:user %}
+  <div class="course_subtitle">
+    <h4><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 7</h4>
+  </div>
+  {% 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 (file)
index 0000000..77baa0f
--- /dev/null
@@ -0,0 +1,12 @@
+{% load teleforma_tags %}
+{% load i18n %}
+
+<table class="listing" width="100%">
+    <tbody>        
+            <tr>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="100%"><a href="{% url teleforma-seminar-testimonial seminar.id %}?format=pdf" target="_blank" title="{% trans "Testimonial" %}"><img src="{{ STATIC_URL }}teleforma/images/icon_doc_16.png" style="vertical-align:middle" alt="" /> {% trans "Testimonial" %} : {{ seminar.title }}{% if seminar.rank %} n°{{seminar.rank}}{% endif %}</a></td>
+            </tr>
+        
+    </tbody>
+</table>
+
index 9552b7faac21f3b00c4fc81180017adb96fbef31..24c9714141dc92a1530da28fea95fe4f29c60353 100644 (file)
@@ -54,8 +54,7 @@ $(function () {
         </div>
 
         {% block course_content %}
-
-        
+      
         <div class="course_content">
           <div class="course_subtitle">
              <h3><img src="{{ STATIC_URL }}telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Informations" %}</h3>
@@ -130,7 +129,7 @@ $(function () {
       {% endwith %}
      {% endif %}
       
-     {% if validated %}
+     {% if seminar_validated %}
        <div class="course_content">
         <div class="course_subtitle">
           <h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 7 : {% trans "download your testimonial" %}</h3>
index 3805cddc5bbe26eef52f744964abb313e0ef836f..128e30b348e26ae02a2ad159920122d2b63854d0 100644 (file)
@@ -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