From c1059c79fdbd37cb56a5f9feb9b702d534cfc2ad Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Mon, 18 May 2020 09:38:28 +0200 Subject: [PATCH] Add record on new page --- teleforma/models/core.py | 2 -- .../templates/teleforma/course_webclass.html | 30 ++++--------------- .../teleforma/course_webclass_record.html | 30 +++++++++++++++++++ teleforma/urls.py | 3 ++ teleforma/views/core.py | 6 ++-- 5 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 teleforma/templates/teleforma/course_webclass_record.html diff --git a/teleforma/models/core.py b/teleforma/models/core.py index 7c77262a..68624d41 100755 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -635,8 +635,6 @@ class WebclassMixin(Model): data['duration'] = data['end'] - data['start'] all_records.append(data) - print('all_records') - print(all_records) if not all_records: return None all_records = sorted(all_records, key=lambda record:-record['duration']) diff --git a/teleforma/templates/teleforma/course_webclass.html b/teleforma/templates/teleforma/course_webclass.html index f3945aba..667d52db 100644 --- a/teleforma/templates/teleforma/course_webclass.html +++ b/teleforma/templates/teleforma/course_webclass.html @@ -4,25 +4,6 @@ {% load i18n %} -{% block infra_javascript %} - - - -{% endblock infra_javascript %} - - {% block module-action %} {% endblock module-action %} @@ -39,23 +20,24 @@ $(window).ready(function(){

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

{% endif %} +

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

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. {% endif %} {% elif webclass_status == 'ingoing' %}

La conférence est en cours.

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

La conférence va bientôt démarrer.

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

La conférence est prévue pour le {{ conference.date_begin }}. Revenez ici à ce moment là pour pouvoir la rejoindre.

{% endif %} @@ -64,11 +46,11 @@ $(window).ready(function(){

Liens de test

-Utilisateur courant : Cliquez ici pour rejoindre la conférence en tant que {{ request.user.username }} +Utilisateur courant : Cliquez ici pour rejoindre la conférence en tant que {{ request.user.username }}

diff --git a/teleforma/templates/teleforma/course_webclass_record.html b/teleforma/templates/teleforma/course_webclass_record.html new file mode 100644 index 00000000..07a324ce --- /dev/null +++ b/teleforma/templates/teleforma/course_webclass_record.html @@ -0,0 +1,30 @@ +{% extends "teleforma/base.html" %} +{% load telemeta_utils %} +{% load teleforma_tags %} +{% load i18n %} + + +{% block infra_javascript %} + + + +{% endblock infra_javascript %} + + + +{% block content %} + +{% endblock content %} + diff --git a/teleforma/urls.py b/teleforma/urls.py index 605bb788..98c4f0d9 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -94,6 +94,9 @@ urlpatterns = patterns('', url(r'^desk/conferences/(?P.*)/audio/$', ConferenceView.as_view(template_name="teleforma/course_conference_audio.html"), name="teleforma-conference-audio"), + url(r'^desk/conferences/(?P.*)/webclass-record/$', + ConferenceView.as_view(template_name="teleforma/course_webclass_record.html"), + name="teleforma-conference-webclass-record"), url(r'^desk/conference_record/$', ConferenceRecordView.as_view(), name="teleforma-conference-record"), url(r'^desk/conferences/(?P.*)/join/$', diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 97b5e83a..9540595b 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -435,10 +435,11 @@ class DocumentReadView(DocumentView): class ConferenceView(DetailView): model = Conference - # template_name='teleforma/course_conference.html' - def get_template_names(self): + def get_template_names(self, *args, **kwargs): conference = self.get_object() + if self.template_name: + return [self.template_name] if conference.webclass: return ['teleforma/course_webclass.html'] else: @@ -449,6 +450,7 @@ class ConferenceView(DetailView): conference = self.get_object() if conference.webclass: context['is_webclass_running'] = conference.is_webclass_running() + context['show_record'] = True try: context['seminar'] = conference.seminar.all()[0] -- 2.39.5