From 82f8d61eb7bb96b4d516ea7fd4ddc6d18480386f Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 1 Nov 2020 20:53:41 +0100 Subject: [PATCH] Send synthesis button --- .../participation/participation_detail.html | 56 +++++++++++- locale/fr/LC_MESSAGES/django.po | 89 ++++++++++++------- 2 files changed, 107 insertions(+), 38 deletions(-) diff --git a/apps/participation/templates/participation/participation_detail.html b/apps/participation/templates/participation/participation_detail.html index 8d1de32..a232fbd 100644 --- a/apps/participation/templates/participation/participation_detail.html +++ b/apps/participation/templates/participation/participation_detail.html @@ -75,7 +75,15 @@ {% endblocktrans %} {% elif current_phase.phase_number == 4 %} - {# TODO View synthesis #} +
+
{% trans "Synthesis from the other team:" %}
+
+ {{ participation.received_participation.synthesis.link|default:novideo }} + {% if participation.received_participation.synthesis.link %} + + {% endif %} +
+
{% endif %} @@ -99,7 +107,7 @@
{{ participation.received_participation.solution.link|default:novideo }} {% if participation.received_participation.solution.link %} - + {% endif %}
@@ -137,7 +145,19 @@ {% endblocktrans %} {% elif current_phase.phase_number == 4 %} - {# TODO Send synthesis #} +
+
+ {% trans "No video sent" as novideo %} +
{% trans "Your synthesis of the exchange:" %}
+
+ {{ participation.synthesis.link|default:novideo }} + + {% if participation.synthesis.link %} + + {% endif %} +
+
+
{% endif %} @@ -162,6 +182,7 @@ {% trans "Upload" as modal_button %} {% url "participation:upload_video" pk=participation.solution_id as modal_action %} {% include "base_modal.html" with modal_id="uploadSolution" %} + {% trans "Display solution" as modal_title %} {% trans "This video platform is not supported yet." as unsupported_platform %} {% include "base_modal.html" with modal_id="displaySolution" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.solution.as_iframe|default:unsupported_platform %} @@ -171,7 +192,7 @@ {% if participation.received_participation.solution.link %} {% trans "Display solution" as modal_title %} {% trans "This video platform is not supported yet." as unsupported_platform %} - {% include "base_modal.html" with modal_id="displaySolution" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.received_participation.solution.as_iframe|default:unsupported_platform %} + {% include "base_modal.html" with modal_id="displayOtherSolution" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.received_participation.solution.as_iframe|default:unsupported_platform %} {% endif %} {% endif %} @@ -201,6 +222,25 @@ {% endwith %} {% endfor %} {% endif %} + +{% if current_phase.phase_number >= 4 %} + {% if participation.received_participation.synthesis.link %} + {% trans "Display synthesis" as modal_title %} + {% trans "This video platform is not supported yet." as unsupported_platform %} + {% include "base_modal.html" with modal_id="displayOtherSynthesis" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.received_participation.synthesis.as_iframe|default:unsupported_platform %} + {% endif %} + + {% trans "Upload video" as modal_title %} + {% trans "Upload" as modal_button %} + {% url "participation:upload_video" pk=participation.synthesis_id as modal_action %} + {% include "base_modal.html" with modal_id="uploadSynthesis" %} + + {% if participation.synthesis.link %} + {% trans "Display synthesis" as modal_title %} + {% trans "This video platform is not supported yet." as unsupported_platform %} + {% include "base_modal.html" with modal_id="displaySynthesis" modal_action="" modal_button="" modal_additional_class="modal-lg" modal_content=participation.synthesis.as_iframe|default:unsupported_platform %} + {% endif %} +{% endif %} {% endblock %} {% block extrajavascript %} @@ -247,6 +287,14 @@ if (!modalBody.html().trim()) modalBody.load("{% url "participation:upload_video" pk=participation.solution_id %} #form-content"); }); + + {% if current_phase.phase_number == 4 %} + $('button[data-target="#uploadSynthesisModal"]').click(function() { + let modalBody = $("#uploadSynthesisModal div.modal-body"); + if (!modalBody.html().trim()) + modalBody.load("{% url "participation:upload_video" pk=participation.synthesis_id %} #form-content"); + }); + {% endif %} }); {% endblock %} diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 9ea9b49..2d77018 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Corres2math\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-31 22:13+0100\n" +"POT-Creation-Date: 2020-11-01 20:50+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Yohann D'ANELLO \n" "Language-Team: LANGUAGE \n" @@ -250,23 +250,23 @@ msgstr "vidéos" msgid "question" msgstr "question" -#: apps/participation/models.py:256 +#: apps/participation/models.py:259 msgid "phase number" msgstr "phase" -#: apps/participation/models.py:261 +#: apps/participation/models.py:264 msgid "phase description" msgstr "description" -#: apps/participation/models.py:265 +#: apps/participation/models.py:268 msgid "start date of the given phase" msgstr "début de la phase" -#: apps/participation/models.py:270 +#: apps/participation/models.py:273 msgid "end date of the given phase" msgstr "fin de la phase" -#: apps/participation/models.py:288 +#: apps/participation/models.py:291 msgid "" "Phase {phase_number:d} starts on {start:%Y-%m-%d %H:%M} and ends on {end:%Y-" "%m-%d %H:%M}" @@ -274,11 +274,11 @@ msgstr "" "Phase {phase_number:d} démarrant le {start:%d/%m/%Y %H:%M} et finissant le " "{end:%d/%m/%Y %H:%M}" -#: apps/participation/models.py:292 +#: apps/participation/models.py:295 msgid "phase" msgstr "phase" -#: apps/participation/models.py:293 +#: apps/participation/models.py:296 msgid "phases" msgstr "phases" @@ -316,16 +316,19 @@ msgid "Chosen problem:" msgstr "Problème choisi :" #: apps/participation/templates/participation/participation_detail.html:22 +#: apps/participation/templates/participation/participation_detail.html:150 msgid "No video sent" msgstr "Pas de vidéo envoyée" #: apps/participation/templates/participation/participation_detail.html:23 -#: apps/participation/templates/participation/participation_detail.html:98 +#: apps/participation/templates/participation/participation_detail.html:106 msgid "Proposed solution:" msgstr "Solution proposée :" #: apps/participation/templates/participation/participation_detail.html:27 -#: apps/participation/templates/participation/participation_detail.html:162 +#: apps/participation/templates/participation/participation_detail.html:154 +#: apps/participation/templates/participation/participation_detail.html:182 +#: apps/participation/templates/participation/participation_detail.html:235 #: apps/participation/templates/participation/upload_video.html:11 #: apps/registration/templates/registration/upload_photo_authorization.html:18 #: apps/registration/templates/registration/user_detail.html:78 @@ -333,7 +336,9 @@ msgid "Upload" msgstr "Téléverser" #: apps/participation/templates/participation/participation_detail.html:30 -#: apps/participation/templates/participation/participation_detail.html:102 +#: apps/participation/templates/participation/participation_detail.html:83 +#: apps/participation/templates/participation/participation_detail.html:110 +#: apps/participation/templates/participation/participation_detail.html:156 msgid "Display" msgstr "Afficher" @@ -346,8 +351,8 @@ msgid "Team that received your solution:" msgstr "Équipe qui a reçu votre solution :" #: apps/participation/templates/participation/participation_detail.html:53 -#: apps/participation/templates/participation/participation_detail.html:94 -#: apps/participation/templates/participation/participation_detail.html:118 +#: apps/participation/templates/participation/participation_detail.html:102 +#: apps/participation/templates/participation/participation_detail.html:126 msgid "Change" msgstr "Modifier" @@ -380,15 +385,19 @@ msgstr "" "client Element dédié : element.correpondances-maths.fr" -#: apps/participation/templates/participation/participation_detail.html:86 +#: apps/participation/templates/participation/participation_detail.html:79 +msgid "Synthesis from the other team:" +msgstr "Synthèse de l'autre équipe :" + +#: apps/participation/templates/participation/participation_detail.html:94 msgid "Received solution" msgstr "Solution reçue" -#: apps/participation/templates/participation/participation_detail.html:90 +#: apps/participation/templates/participation/participation_detail.html:98 msgid "Team that sent you their solution:" msgstr "Équipe qui vous a envoyé leur solution :" -#: apps/participation/templates/participation/participation_detail.html:108 +#: apps/participation/templates/participation/participation_detail.html:116 msgid "" "You received a solution about the same problem that you treated from another " "team. You are now encouraged to see the video, then to ask from 3 to 6 " @@ -400,11 +409,11 @@ msgstr "" "vidéo, puis à poser 3 à 6 questions à propos de la vidéo. Après cela, vous " "serez invités à échanger avec l'autre équipe à propos de la solution." -#: apps/participation/templates/participation/participation_detail.html:125 +#: apps/participation/templates/participation/participation_detail.html:133 msgid "Add a question" msgstr "Ajouter une question" -#: apps/participation/templates/participation/participation_detail.html:130 +#: apps/participation/templates/participation/participation_detail.html:138 #, python-format msgid "" "You sent your questions to the other team about their solution. When they " @@ -423,13 +432,17 @@ msgstr "" "client Element dédié : element.correpondances-maths.fr" -#: apps/participation/templates/participation/participation_detail.html:150 +#: apps/participation/templates/participation/participation_detail.html:151 +msgid "Your synthesis of the exchange:" +msgstr "Votre synthèse de l'échange :" + +#: apps/participation/templates/participation/participation_detail.html:170 msgid "Define received video" msgstr "Définir la vidéo reçue" -#: apps/participation/templates/participation/participation_detail.html:151 -#: apps/participation/templates/participation/participation_detail.html:156 -#: apps/participation/templates/participation/participation_detail.html:189 +#: apps/participation/templates/participation/participation_detail.html:171 +#: apps/participation/templates/participation/participation_detail.html:176 +#: apps/participation/templates/participation/participation_detail.html:210 #: apps/participation/templates/participation/phase_form.html:11 #: apps/participation/templates/participation/phase_list.html:18 #: apps/participation/templates/participation/receive_participation_form.html:11 @@ -443,46 +456,54 @@ msgstr "Définir la vidéo reçue" msgid "Update" msgstr "Modifier" -#: apps/participation/templates/participation/participation_detail.html:155 +#: apps/participation/templates/participation/participation_detail.html:175 msgid "Define team that receives your video" msgstr "Définir l'équipe qui recevra votre vidéo" -#: apps/participation/templates/participation/participation_detail.html:161 +#: apps/participation/templates/participation/participation_detail.html:181 +#: apps/participation/templates/participation/participation_detail.html:234 msgid "Upload video" msgstr "Envoyer la vidéo" -#: apps/participation/templates/participation/participation_detail.html:165 -#: apps/participation/templates/participation/participation_detail.html:172 +#: apps/participation/templates/participation/participation_detail.html:186 +#: apps/participation/templates/participation/participation_detail.html:193 msgid "Display solution" msgstr "Afficher la solution" -#: apps/participation/templates/participation/participation_detail.html:166 -#: apps/participation/templates/participation/participation_detail.html:173 +#: apps/participation/templates/participation/participation_detail.html:187 +#: apps/participation/templates/participation/participation_detail.html:194 +#: apps/participation/templates/participation/participation_detail.html:230 +#: apps/participation/templates/participation/participation_detail.html:241 msgid "This video platform is not supported yet." msgstr "La plateforme de cette vidéo n'est pas encore supportée." -#: apps/participation/templates/participation/participation_detail.html:179 +#: apps/participation/templates/participation/participation_detail.html:200 msgid "Add question" msgstr "Ajouter une question" -#: apps/participation/templates/participation/participation_detail.html:180 +#: apps/participation/templates/participation/participation_detail.html:201 msgid "Add" msgstr "Ajouter" -#: apps/participation/templates/participation/participation_detail.html:186 -#: apps/participation/templates/participation/participation_detail.html:197 +#: apps/participation/templates/participation/participation_detail.html:207 +#: apps/participation/templates/participation/participation_detail.html:218 #: apps/participation/templates/participation/question_confirm_delete.html:14 msgid "Delete" msgstr "Supprimer" -#: apps/participation/templates/participation/participation_detail.html:188 +#: apps/participation/templates/participation/participation_detail.html:209 msgid "Update question" msgstr "Modifier la question" -#: apps/participation/templates/participation/participation_detail.html:196 +#: apps/participation/templates/participation/participation_detail.html:217 msgid "Delete question" msgstr "Supprimer la question" +#: apps/participation/templates/participation/participation_detail.html:229 +#: apps/participation/templates/participation/participation_detail.html:240 +msgid "Display synthesis" +msgstr "Afficher la synthèse" + #: apps/participation/templates/participation/phase_list.html:10 #: templates/base.html:68 templates/base.html:70 templates/base.html:217 msgid "Calendar"