]> git.parisson.com Git - teleforma.git/commitdiff
webclass v1
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 15 Jun 2020 07:28:38 +0000 (09:28 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 15 Jun 2020 07:28:38 +0000 (09:28 +0200)
teleforma/templates/teleforma/course_webclass.html
teleforma/templates/teleforma/inc/steps.html
teleforma/templatetags/teleforma_tags.py

index 3d4469619abaed6c900da6373b6ff89512089df2..6431f00c377017f80c314db94604360c5a7098e4 100644 (file)
 {% block course %}
 <div class="course_media">
 
-<div class="course_title">
-    <a href="{% url teleforma-course-detail course.id %}" style="color: #000;">
-    Webconférence - {{ conference.title }}
-    </a>
-</div>
-
-{% if not seminar and user.is_superuser %}
-<p class="warning">Attention, aucun séminaire n'est associé à cette conférence.</p>
-{% endif %}
+    <div class="course_title">
+        <a href="{% url teleforma-course-detail course.id %}" style="color: #000;">
+            Webconférence - {{ conference.title }}
+        </a>
+    </div>
+
+    {% if not seminar and user.is_superuser %}
+    <p class="warning">Attention, aucun séminaire n'est associé à cette conférence.</p>
+    {% endif %}
 
-<br/><br/>
+    <br /><br />
 
 
-{% if webclass_status == 'past' %}
+    {% if webclass_status == 'past' %}
     {% if record %}
-        <p>La conférence est terminée, vous pouvez la revoir ci-dessous.</p>
-        <a href="{% url teleforma-conference-webclass-record conference.id%}" class="conference-big-button component_icon button icon_next">Voir l'enregistrement</a>
+    <p>La conférence est terminée, vous pouvez la revoir ci-dessous.</p>
+    <a href="{% url teleforma-conference-webclass-record conference.id%}"
+        class="conference-big-button component_icon button icon_next">Voir l'enregistrement</a>
     {% else %}
-        <p>La conférence est terminée. L'enregistrement n'est pas encore ligne.</p>
+    <p>La conférence est terminée. L'enregistrement n'est pas encore ligne.</p>
     {% endif %}
-{% elif webclass_status == 'ingoing' %}
+    {% elif webclass_status == 'ingoing' %}
     <p>La conférence est en cours.</p>
-    <a href="{% url teleforma-conference-join conference.id %}" target="_blank" class="conference-big-button component_icon button icon_next">Cliquez ici pour rejoindre la conférence</a>
-{% elif webclass_status == 'almost' %}
+    <a href="{% url teleforma-conference-join conference.id %}" target="_blank"
+        class="conference-big-button component_icon button icon_next">Cliquez ici pour rejoindre la conférence</a>
+    {% elif webclass_status == 'almost' %}
     <p>Le salon « Pro-Barreau Live » est accessible.</p>
-    <a href="{% url teleforma-conference-join conference.id %}" target="_blank" class="conference-big-button component_icon button icon_next">Cliquez ici pour rejoindre la conférence</a>
-{% elif webclass_status == 'future' %}
+    <a href="{% url teleforma-conference-join conference.id %}" target="_blank"
+        class="conference-big-button component_icon button icon_next">Cliquez ici pour rejoindre la conférence</a>
+    {% elif webclass_status == 'future' %}
     <p>
-        Votre Webconférence débutera le <strong>{{ conference.date_begin|date:"d/m/Y" }} à {{ conference.date_begin|time:"H\hi" }}</strong>. 
-        Vous pourrez accéder au salon « Pro-Barreau Live » dès {{ begin_minus_1_hour|time:"H\hi" }} en cliquant sur le lien qui apparaitra ci-dessous.
+        Votre Webconférence débutera le <strong>{{ conference.date_begin|date:"d/m/Y" }} à
+            {{ conference.date_begin|time:"H\hi" }}</strong>.
+        Vous pourrez accéder au salon « Pro-Barreau Live » dès {{ begin_minus_1_hour|time:"H\hi" }} en cliquant sur le
+        lien qui apparaitra ci-dessous.
     </p>
-{% endif %}
-
-
-{% if user.is_superuser %}
-<div style="border:1px solid grey">
-<h3>Liens d'invitation</h3>
-<p>
-Se connecter en tant qu'admin : <a href="{% url teleforma-conference-join conference.id %}" target="_blank">Cliquez ici pour rejoindre la conférence en tant que <strong>{{ request.user.username }}</strong></a>
-</p>
-<ul>
-{% for i in range %}
-<li><a href="{% url teleforma-conference-join conference.id %}?username=utilisateur{{i}}" target="_blank">Cliquez ici pour rejoindre la conférence en tant que <strong>utilisateur{{i}}</strong></a></li>
-{% endfor %}
-</ul>
-</div>
-{% endif %}
+    {% endif %}
 
 
-{% block general_info %}
-<div class="course_content" id="media_infos">
-<dl class="listing">
+    {% if user.is_superuser %}
+    <div style="border:1px solid grey">
+        <h3>Liens d'invitation</h3>
+        <p>
+            Se connecter en tant qu'admin : <a href="{% url teleforma-conference-join conference.id %}"
+                target="_blank">Cliquez ici pour rejoindre la conférence en tant que
+                <strong>{{ request.user.username }}</strong></a>
+        </p>
+        <ul>
+            {% for i in range %}
+            <li><a href="{% url teleforma-conference-join conference.id %}?username=utilisateur{{i}}"
+                    target="_blank">Cliquez ici pour rejoindre la conférence en tant que
+                    <strong>utilisateur{{i}}</strong></a></li>
+            {% endfor %}
+        </ul>
+    </div>
+    {% endif %}
 
-{% if conference.professor %}
-<dt>{% trans "Course" %}</dt><dd><a href="{% url teleforma-course-detail course.id %}">{{ conference.course.title }}{% if conference.course_type != None %} - {{ conference.course_type }}{% endif %}</a></dd>
-<dt>Niveau</dt><dd>{{ conference.level }}</dd>
-<dt>{% trans "Professor" %}</dt>
-    <dd><a href="{% url telemeta-profile-detail conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a></dd>
-{% endif %}
-{% if conference.comment %}<dt>{% trans "Comment" %}</dt><dd>{{ conference.comment }}</dd>{% endif %}
-<dt>{% trans "Begin date" %}</dt><dd>{{ conference.date_begin }}</dd>
-{% if conference.date_end %}<dt>{% trans "End date" %}</dt><dd>{{ conference.date_end }}</dd>{% endif %}
-{% comment %} <dt>{% trans "Live" %}</dt><dd>{% if is_webclass_running %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</dd> {% endcomment %}
-<dt>{% trans "Duration" %}</dt><dd>{{ conference.webclass_duration|hours }} {% trans "hours" %}</dd>
-<dt>{% trans "Live" %}</dt><dd>{% trans "Yes" %}</dd>
-{% comment %} {% if conference.room %}<dt>{% trans "Room" %}</dt><dd>{{ conference.room }}</dd>{% endif %} {% endcomment %}
-{% if user.is_staff or user.is_superuser %}
-<dt>{% trans "Conference ID" %}</dt><dd>{{ conference.webclass_id }}</dd>
-{% endif %}
 
-</dl>
-</div>
-{% endblock general_info %}
+    {% block general_info %}
+    <div class="course_content" id="media_infos">
+        <dl class="listing">
+
+            {% if conference.professor %}
+            <dt>{% trans "Course" %}</dt>
+            <dd><a href="{% url teleforma-course-detail course.id %}">{{ conference.course.title }}{% if conference.course_type != None %}
+                    - {{ conference.course_type }}{% endif %}</a></dd>
+            <dt>Niveau</dt>
+            <dd>{{ conference.level }}</dd>
+            <dt>{% trans "Professor" %}</dt>
+            <dd><a href="{% url telemeta-profile-detail conference.professor.user.username %}"
+                    target="_blank">{{ conference.professor }}</a></dd>
+            {% endif %}
+            {% if conference.comment %}<dt>{% trans "Comment" %}</dt>
+            <dd>{{ conference.comment }}</dd>{% endif %}
+            <dt>{% trans "Begin date" %}</dt>
+            <dd>{{ conference.date_begin }}</dd>
+            {% if conference.date_end %}<dt>{% trans "End date" %}</dt>
+            <dd>{{ conference.date_end }}</dd>{% endif %}
+            {% comment %} <dt>{% trans "Live" %}</dt>
+            <dd>{% if is_webclass_running %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</dd> {% endcomment %}
+            <dt>{% trans "Duration" %}</dt>
+            <dd>{{ conference.webclass_duration.seconds|fancy_seconds }}</dd>
+            <dt>{% trans "Live" %}</dt>
+            <dd>{% trans "Yes" %}</dd>
+            {% comment %} {% if conference.room %}<dt>{% trans "Room" %}</dt>
+            <dd>{{ conference.room }}</dd>{% endif %} {% endcomment %}
+            {% if user.is_staff or user.is_superuser %}
+            <dt>{% trans "Conference ID" %}</dt>
+            <dd>{{ conference.webclass_id }}</dd>
+            {% endif %}
+
+        </dl>
+    </div>
+    {% endblock general_info %}
 
 </div>
 {% endblock course %}
@@ -93,4 +114,4 @@ Se connecter en tant qu'admin : <a href="{% url teleforma-conference-join confer
 {% include "teleforma/inc/chat_room.html" %}
 {% endwith %}
 {% endif %}
-{% endblock chat %}
+{% endblock chat %}
\ No newline at end of file
index 6ac29594d13a2701eba5c99409383483ce7550c6..444ce787ee99cfc2b6183c1634e89c5bba2b4fae 100644 (file)
@@ -2,58 +2,58 @@
 {% 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" %}
+<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.medias as medias %}
-  <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" %}
+<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" %}
+<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 %}
 
-  {% if not seminar.conference in user.auditor.get.conferences.all %}
-
-  {% 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 %}
-
-  {% endif %}
+{% if not seminar.conference in user.auditor.get.conferences.all %}
+
+{% 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 %}
+
+{% endif %}
\ No newline at end of file
index 415d731bb784e11b23fc867d38599f35c10cd62c..28f9049a6ebf205dde348e2cf95306923e0327db 100644 (file)
@@ -317,6 +317,28 @@ def fancy_duration(duration):
         minutes = str(minutes)
     time +=  minutes + 'mn'
     return time
+    
+@register.filter
+def fancy_seconds(seconds):
+    time = ''
+    hours = int(seconds / 3600)
+    minutes_int = (seconds % 3600) / 60
+    if hours:
+        if minutes_int:
+            time += str(hours) + 'h'
+        else:
+            time += str(hours) + ' heures'
+    if minutes_int<10:
+        minutes = '0' + str(minutes_int)
+    else:
+        minutes = str(minutes_int)
+    if minutes_int == 0 and hours:
+        pass
+    elif not hours:
+        time = minutes + ' minutes'
+    else:
+        time += minutes
+    return time
 
 @register.simple_tag
 def untreated_answer_count():