From: Yoan Le Clanche Date: Thu, 26 Nov 2020 13:44:16 +0000 (+0100) Subject: Better handling of blended learning detection X-Git-Tag: 2.8.1-pro~180^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=91f8600fb342f58e081a71e83c666e9e1846ee52;p=teleforma.git Better handling of blended learning detection --- diff --git a/teleforma/templates/teleforma/seminar_testimonial.html b/teleforma/templates/teleforma/seminar_testimonial.html index 900fa609..6f3f57cb 100644 --- a/teleforma/templates/teleforma/seminar_testimonial.html +++ b/teleforma/templates/teleforma/seminar_testimonial.html @@ -36,17 +36,15 @@ {% trans "Address" %} : {{ testimonial.user.auditor.all.0.address }} {{ testimonial.user.auditor.all.0.postal_code }} {{ testimonial.user.auditor.all.0.city }} {% trans "Object" %} : {{ seminar.title }} {% trans "Course" %} : {{ seminar.course }} - {% trans "Training type" %} : {% if seminar.conference and seminar.conference.webclass %}Blended-learning{% else %}E-learning{% endif %} + {% trans "Training type" %} : {% if blended %}Blended-learning{% else %}E-learning{% endif %} {% trans "Duration" %} : {{ seminar.duration|hours }} {% trans "hours" %} - {% if seminar.conference and seminar.conference.webclass %} - {% with conference=seminar.conference %} - {% if seminar.conference.webclass_hours_complementary %} - ({{conference.webclass_duration|fancy_seconds}} de webconférence en direct + {{conference.webclass_hours_complementary.as_seconds|fancy_seconds}} de - validation des acquis) -

- {% endif %} - {% endwith %} + {% if blended %} + {% if conference.webclass_hours_complementary %} + ({{conference.webclass_duration|fancy_seconds}} de webconférence en direct + {{conference.webclass_hours_complementary.as_seconds|fancy_seconds}} de + validation des acquis) +

+ {% endif %} {% endif %} {% trans "Training begin date" %} : {{ first_revision.date|date:'j F Y' }} diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index b02e0baf..29b089bf 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -774,6 +774,7 @@ class TestimonialView(PDFTemplateResponseMixin, SeminarView): def get_context_data(self, **kwargs): context = super(TestimonialView, self).get_context_data(**kwargs) seminar = context['seminar'] + revisions = SeminarRevision.objects.filter(seminar=seminar, user=self.request.user).order_by('date') if revisions: context['first_revision'] = revisions[0] @@ -782,6 +783,12 @@ class TestimonialView(PDFTemplateResponseMixin, SeminarView): if testimonials: context['testimonial'] = testimonials[0] + context['blended'] = False + if seminar.conference: + if seminar.conference.webclass and seminar.conference in self.request.user.auditor.get().conferences.all(): + context['blended'] = True + context['conference'] = seminar.conference + return context @method_decorator(login_required)