From: Yoan Le Clanche Date: Tue, 11 Oct 2022 09:39:20 +0000 (+0200) Subject: Nouveau parcours fixes and evolutions X-Git-Tag: 2.8.1-pro~73 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=154fa5bd6908f724a6dd22f612fbb03c5314cf48;p=teleforma.git Nouveau parcours fixes and evolutions --- diff --git a/requirements.txt b/requirements.txt index 14e4c526..53ca65db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,4 +27,3 @@ psycopg2==2.8.6 uwsgi pymemcache==3.4.4 Mezzanine==5.0.0 - diff --git a/teleforma/context_processors.py b/teleforma/context_processors.py index 323c5b56..eefb9a14 100644 --- a/teleforma/context_processors.py +++ b/teleforma/context_processors.py @@ -137,7 +137,7 @@ def seminar_progress(user, seminar, more=False): quizstep = multipart and '4' or '2bis' for quiz in quizs: if quiz: - quiz_weight = 3 + quiz_weight = quiz.weight or 3 startdate = seminar.date_added enddate = seminar.expiry_date quiz_validations = QuizValidation.objects.filter(user=user, quiz=quiz, validated=True, date_validated__range=[startdate, enddate]) diff --git a/teleforma/migrations/0012_auto_20220919_1428.py b/teleforma/migrations/0012_auto_20220919_1428.py new file mode 100644 index 00000000..3897e01f --- /dev/null +++ b/teleforma/migrations/0012_auto_20220919_1428.py @@ -0,0 +1,30 @@ +# Generated by Django 3.2.3 on 2022-10-04 17:37 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('quiz', '__first__'), + ('teleforma', '0011_merge_20220831_1143'), + ] + + operations = [ + migrations.AddField( + model_name='seminarpart', + name='title', + field=models.CharField(blank=True, max_length=80, null=True, verbose_name='Titre de la séquence'), + ), + migrations.AlterField( + model_name='answer', + name='date_submitted', + field=models.DateTimeField(null=True, verbose_name='date submitted'), + ), + migrations.AlterField( + model_name='seminarpart', + name='quiz', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='seminarpart', to='quiz.quiz', verbose_name='quiz'), + ), + ] diff --git a/teleforma/migrations/0013_seminarpart_index.py b/teleforma/migrations/0013_seminarpart_index.py new file mode 100644 index 00000000..ebf07e75 --- /dev/null +++ b/teleforma/migrations/0013_seminarpart_index.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.3 on 2022-10-05 15:55 + +from django.db import migrations +import tinymce.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('teleforma', '0012_auto_20220919_1428'), + ] + + operations = [ + migrations.AddField( + model_name='seminarpart', + name='index', + field=tinymce.models.HTMLField(blank=True, null=True, verbose_name='Plan détaillé'), + ), + ] diff --git a/teleforma/models/pro.py b/teleforma/models/pro.py index 6cfa56c4..c902b2cb 100644 --- a/teleforma/models/pro.py +++ b/teleforma/models/pro.py @@ -278,6 +278,8 @@ class Seminar(ClonableMixin, Displayable, ProductCodeMixin, SuggestionsMixin): class SeminarPart(models.Model): seminar = models.ForeignKey(Seminar, related_name='parts', verbose_name=_('seminar'), on_delete=models.CASCADE) + + title = models.CharField("Titre de la séquence", max_length=80, blank=True, null=True) docs_1 = models.ManyToManyField(Document, related_name="seminarpart_docs1", verbose_name=_('documents 1'), blank=True) @@ -293,7 +295,13 @@ class SeminarPart(models.Model): # blank=True) quiz = models.ForeignKey(Quiz, related_name="seminarpart", verbose_name=_('quiz'), + blank=True, null=True, on_delete=models.PROTECT) + index = tinymce.models.HTMLField("Plan détaillé", + help_text="", + null=True, + blank=True) + def is_validated(self, user): diff --git a/teleforma/static/teleforma/css/teleforma.css b/teleforma/static/teleforma/css/teleforma.css index 4203e1f6..1a8d5ba2 100644 --- a/teleforma/static/teleforma/css/teleforma.css +++ b/teleforma/static/teleforma/css/teleforma.css @@ -2172,7 +2172,9 @@ form .exceed{ .multipart-tabs li { display: inline-block; } - +.multipart-tabs li { + font-size: 0.9em; +} .multipart-tabs .disabled { color: grey; pointer-events: none; @@ -2185,6 +2187,9 @@ form .exceed{ padding: 6px 12px; animation: fadeEffect 1s; } +.tab-content h2 { + font-size: 1.1em; +} @keyframes fadeEffect { from { diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index 5f374930..ed0ea018 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -84,7 +84,7 @@ function openTab(tab) { - $(".tab-content").each(function() { + $(".tab-content, .index-multipart").each(function() { $(this).hide(); }) $(".tab-link").each(function() { @@ -92,6 +92,8 @@ }) $("a[href="+tab+"]").addClass('active'); $(tab).show().addClass("active"); + $(tab + "-index").show(); + } @@ -180,7 +182,7 @@
@@ -188,7 +190,7 @@ {% for part in parts %}
-

Séquence {{ part.index }}

+

{% if part.object.title %}{{ part.object.title }}{% else %}Séquence {{ part.index }}{% endif %}

{% with part.object.docs_1 as docs %}
@@ -415,13 +417,20 @@ {% block index %} -{% if seminar.index %} +{% if seminar.index or seminar.is_multipart %}

status {% trans "Plan" %}

- {{ seminar.index|safe }} + {% if seminar.is_multipart %} + {% for part in parts %} +
+ {{ part.object.index|safe }} +
+ {% endfor %} + {% elif seminar.index %} + {{ seminar.index|safe }} + {% endif %}
-
{% endif %} {% endblock index %} \ No newline at end of file