From 8be47772596a410a7ab936d6d5c11ec3dad1612a Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Mon, 15 Jun 2020 09:28:38 +0200 Subject: [PATCH] webclass v1 --- .../templates/teleforma/course_webclass.html | 141 ++++++++++-------- teleforma/templates/teleforma/inc/steps.html | 92 ++++++------ teleforma/templatetags/teleforma_tags.py | 22 +++ 3 files changed, 149 insertions(+), 106 deletions(-) diff --git a/teleforma/templates/teleforma/course_webclass.html b/teleforma/templates/teleforma/course_webclass.html index 3d446961..6431f00c 100644 --- a/teleforma/templates/teleforma/course_webclass.html +++ b/teleforma/templates/teleforma/course_webclass.html @@ -10,79 +10,100 @@ {% block course %}
- - -{% if not seminar and user.is_superuser %} -

Attention, aucun séminaire n'est associé à cette conférence.

-{% endif %} + + + {% if not seminar and user.is_superuser %} +

Attention, aucun séminaire n'est associé à cette conférence.

+ {% endif %} -

+

-{% if webclass_status == 'past' %} + {% if webclass_status == 'past' %} {% if record %} -

La conférence est terminée, vous pouvez la revoir ci-dessous.

- Voir l'enregistrement +

La conférence est terminée, vous pouvez la revoir ci-dessous.

+ Voir l'enregistrement {% else %} -

La conférence est terminée. L'enregistrement n'est pas encore ligne.

+

La conférence est terminée. L'enregistrement n'est pas encore ligne.

{% endif %} -{% elif webclass_status == 'ingoing' %} + {% elif webclass_status == 'ingoing' %}

La conférence est en cours.

- Cliquez ici pour rejoindre la conférence -{% elif webclass_status == 'almost' %} + Cliquez ici pour rejoindre la conférence + {% elif webclass_status == 'almost' %}

Le salon « Pro-Barreau Live » est accessible.

- Cliquez ici pour rejoindre la conférence -{% elif webclass_status == 'future' %} + Cliquez ici pour rejoindre la conférence + {% elif webclass_status == 'future' %}

- Votre Webconférence débutera le {{ conference.date_begin|date:"d/m/Y" }} à {{ conference.date_begin|time:"H\hi" }}. - 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 {{ conference.date_begin|date:"d/m/Y" }} à + {{ conference.date_begin|time:"H\hi" }}. + 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.

-{% endif %} - - -{% if user.is_superuser %} -
-

Liens d'invitation

-

-Se connecter en tant qu'admin : Cliquez ici pour rejoindre la conférence en tant que {{ request.user.username }} -

- -
-{% endif %} + {% endif %} -{% block general_info %} -
-
+ {% if user.is_superuser %} +
+

Liens d'invitation

+

+ Se connecter en tant qu'admin : Cliquez ici pour rejoindre la conférence en tant que + {{ request.user.username }} +

+ +
+ {% endif %} -{% if conference.professor %} -
{% trans "Course" %}
{{ conference.course.title }}{% if conference.course_type != None %} - {{ conference.course_type }}{% endif %}
-
Niveau
{{ conference.level }}
-
{% trans "Professor" %}
-
{{ conference.professor }}
-{% endif %} -{% if conference.comment %}
{% trans "Comment" %}
{{ conference.comment }}
{% endif %} -
{% trans "Begin date" %}
{{ conference.date_begin }}
-{% if conference.date_end %}
{% trans "End date" %}
{{ conference.date_end }}
{% endif %} -{% comment %}
{% trans "Live" %}
{% if is_webclass_running %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}
{% endcomment %} -
{% trans "Duration" %}
{{ conference.webclass_duration|hours }} {% trans "hours" %}
-
{% trans "Live" %}
{% trans "Yes" %}
-{% comment %} {% if conference.room %}
{% trans "Room" %}
{{ conference.room }}
{% endif %} {% endcomment %} -{% if user.is_staff or user.is_superuser %} -
{% trans "Conference ID" %}
{{ conference.webclass_id }}
-{% endif %} -
-
-{% endblock general_info %} + {% block general_info %} +
+
+ + {% if conference.professor %} +
{% trans "Course" %}
+
{{ conference.course.title }}{% if conference.course_type != None %} + - {{ conference.course_type }}{% endif %}
+
Niveau
+
{{ conference.level }}
+
{% trans "Professor" %}
+
{{ conference.professor }}
+ {% endif %} + {% if conference.comment %}
{% trans "Comment" %}
+
{{ conference.comment }}
{% endif %} +
{% trans "Begin date" %}
+
{{ conference.date_begin }}
+ {% if conference.date_end %}
{% trans "End date" %}
+
{{ conference.date_end }}
{% endif %} + {% comment %}
{% trans "Live" %}
+
{% if is_webclass_running %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}
{% endcomment %} +
{% trans "Duration" %}
+
{{ conference.webclass_duration.seconds|fancy_seconds }}
+
{% trans "Live" %}
+
{% trans "Yes" %}
+ {% comment %} {% if conference.room %}
{% trans "Room" %}
+
{{ conference.room }}
{% endif %} {% endcomment %} + {% if user.is_staff or user.is_superuser %} +
{% trans "Conference ID" %}
+
{{ conference.webclass_id }}
+ {% endif %} + +
+
+ {% endblock general_info %}
{% endblock course %} @@ -93,4 +114,4 @@ Se connecter en tant qu'admin : -

{% trans "Step" %} 1

- - {% include "teleforma/inc/document_step.html" %} +
+

{% trans "Step" %} 1

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

{% trans "Step" %} 2

-
- {% include "teleforma/inc/media_step.html" %} +
+

{% 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" %} +
+

{% trans "Step" %} 3

+
+{% include "teleforma/inc/document_step.html" %} {% endwith %} - {% if not seminar.conference in user.auditor.get.conferences.all %} - - {% 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 %} - - {% endif %} +{% if not seminar.conference in user.auditor.get.conferences.all %} + +{% 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 %} + +{% endif %} \ No newline at end of file diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index 415d731b..28f9049a 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -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(): -- 2.39.5