1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-04-28 18:52:40 +00:00

Compare commits

..

No commits in common. "c11a40e0547dff0eb3822f59b1e86917c8af34f1" and "52c8a836f19528f766f72d266498b18a15272038" have entirely different histories.

5 changed files with 21 additions and 81 deletions

View File

@ -45,27 +45,14 @@ class Command(BaseCommand):
preset=RoomPreset.public_chat,
)
if not async_to_sync(Matrix.resolve_room_alias)("#je-cherche-une-equipe:correspondances-maths.fr"):
Matrix.create_room(
visibility=RoomVisibility.public,
alias="je-cherche-une-equipe",
name="Je cherche une équipe",
topic="Le Tinder des Correspondances",
federate=False,
preset=RoomPreset.public_chat,
)
Matrix.set_room_avatar("#annonces:correspondances-maths.fr", avatar_uri)
Matrix.set_room_avatar("#faq:correspondances-maths.fr", avatar_uri)
Matrix.set_room_avatar("#je-cherche-une-equipe:correspondances-maths.fr", avatar_uri)
Matrix.set_room_power_level_event("#annonces:correspondances-maths.fr", "events_default", 50)
for r in Registration.objects.all():
Matrix.invite("#annonces:correspondances-maths.fr", f"@{r.matrix_username}:correspondances-maths.fr")
Matrix.invite("#faq:correspondances-maths.fr", f"@{r.matrix_username}:correspondances-maths.fr")
Matrix.invite("#je-cherche-une-equipe:correspondances-maths.fr",
f"@{r.matrix_username}:correspondances-maths.fr")
for admin in AdminRegistration.objects.all():
Matrix.set_room_power_level("#annonces:correspondances-maths.fr",

View File

@ -211,7 +211,7 @@ class Video(models.Model):
If the video is uploaded on Youtube, search in the URL the video code.
"""
return re.compile("(https?://|)(www\\.|)(youtube\\.com/watch\\?v=|youtu\\.be/)([a-zA-Z0-9-_]*)?.*?")\
.match(self.link).group(4)
.match("https://www.youtube.com/watch?v=73nsrixx7eI").group(4)
def as_iframe(self):
"""

View File

@ -21,7 +21,7 @@
<dl class="row">
{% trans "No video sent" as novideo %}
<dt class="col-sm-2">{% trans "Proposed solution:" %}</dt>
<dd class="col-sm-10"><a href="{{ participation.solution.link|default:"#" }}"{% if participation.solution.link %} target="_blank"{% endif %}>
<dd class="col-sm-10"><a href="{{ participation.solution.link|default:"#" }}" target="_blank">
{{ participation.solution.link|default:novideo }}</a>
{% if current_phase.phase_number == 1 or participation.solution.link == "" %}
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadSolutionModal">{% trans "Upload" %}</button>
@ -35,7 +35,7 @@
</div>
</div>
{% if user.registration.is_admin or current_phase.phase_number >= 2 %}
{% if user.registration.is_admin or current_phase >= 2 %}
<hr>
<div class="row">
@ -94,28 +94,12 @@
<button class="btn btn-primary" data-toggle="modal" data-target="#defineReceivedParticipationModal">{% trans "Change" %}</button>
</dd>
{% endif %}
<dt class="col-xl-5 text-right">{% trans "Proposed solution:" %}</dt>
<dd class="col-sm-7"><a href="{{ participation.received_participation.solution.link|default:"#" }}"{% if participation.received_participation.solution.link %} target="_blank"{% endif %}>
{{ participation.received_participation.solution.link|default:novideo }}</a>
{% if participation.received_participation.solution.link %}
<button class="btn btn-info" data-toggle="modal" data-target="#displaySolutionModal">{% trans "Display" %}</button>
{% endif %}
</dd>
</dl>
{% if current_phase.phase_number == 2 %}
<div class="alert alert-info">
{% blocktrans trimmed %}
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 questions about the video.
After that, you will be invited to exchange with the other team about the solution.
{% endblocktrans %}
</div>
{# TODO Display solution #}
{% if user.registration.participates %}
<button class="btn btn-success"><i class="fas fa-plus-circle"></i> {% trans "Add a question" %}</button>
{% endif %}
{% if current_phase.phase_number == 2 %}
{# TODO Send questions #}
{% elif current_phase.phase_number == 3 %}
<div class="alert alert-info">
{% blocktrans trimmed with user_id=user.pk %}
@ -155,15 +139,6 @@
{% 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 %}
{% if user.registration.is_admin or current_phase.phase_number >= 2 %}
{% 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 %}
{% endif %}
{% endif %}
{% endblock %}
{% block extrajavascript %}

View File

@ -48,5 +48,3 @@ def invite_to_public_rooms(instance: Registration, **_):
if not instance.pk:
Matrix.invite("#annonces:correspondances-maths.fr", f"@{instance.matrix_username}:correspondances-maths.fr")
Matrix.invite("#faq:correspondances-maths.fr", f"@{instance.matrix_username}:correspondances-maths.fr")
Matrix.invite("#je-cherche-une-equip:correspondances-maths.fr",
f"@{instance.matrix_username}:correspondances-maths.fr")

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Corres2math\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-31 14:16+0100\n"
"POT-Creation-Date: 2020-10-31 13:32+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -123,15 +123,15 @@ msgstr "Vous ne pouvez pas envoyer de vidéo après la date limite."
msgid "Send to team"
msgstr "Envoyer à l'équipe"
#: apps/participation/forms.py:163
#: apps/participation/forms.py:162
msgid "Start date must be before the end date."
msgstr "La date de début doit être avant la date de fin."
#: apps/participation/forms.py:165
#: apps/participation/forms.py:164
msgid "This phase must start after the previous phases."
msgstr "Cette phase doit commencer après les phases précédentes."
#: apps/participation/forms.py:167
#: apps/participation/forms.py:166
msgid "This phase must end after the next phases."
msgstr "Cette phase doit finir avant les phases suivantes."
@ -312,12 +312,11 @@ 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
msgid "Proposed solution:"
msgstr "Solution proposée :"
#: apps/participation/templates/participation/participation_detail.html:27
#: apps/participation/templates/participation/participation_detail.html:152
#: apps/participation/templates/participation/participation_detail.html:136
#: 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
@ -325,13 +324,12 @@ msgid "Upload"
msgstr "Téléverser"
#: apps/participation/templates/participation/participation_detail.html:30
#: apps/participation/templates/participation/participation_detail.html:102
msgid "Display"
msgstr "Afficher"
#: apps/participation/templates/participation/participation_detail.html:45
msgid "Sent solution"
msgstr "Solution envoyée"
msgstr "Solution envoyée :"
#: apps/participation/templates/participation/participation_detail.html:49
msgid "Team that received your solution:"
@ -373,29 +371,13 @@ msgstr ""
#: apps/participation/templates/participation/participation_detail.html:86
msgid "Received solution"
msgstr "Solution reçue"
msgstr "Solution reçue :"
#: apps/participation/templates/participation/participation_detail.html:90
msgid "Team that sent you their solution:"
msgstr "Équipe qui vous a envoyé leur solution :"
#: apps/participation/templates/participation/participation_detail.html:109
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 "
"questions about the video. After that, you will be invited to exchange with "
"the other team about the solution."
msgstr ""
"Vous avez reçu une vidéo à propos du même problème que vous avez traité de "
"la part d'une autre équipe. Vous êtes désormais encouragés à visionner la "
"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:117
msgid "Add a question"
msgstr "Ajouter une question"
#: apps/participation/templates/participation/participation_detail.html:121
#: apps/participation/templates/participation/participation_detail.html:105
#, python-format
msgid ""
"You sent your questions to the other team about their solution. When they "
@ -414,12 +396,12 @@ msgstr ""
"client Element dédié : <a href=\"https://element.correspondances-maths.fr"
"\">element.correpondances-maths.fr</a>"
#: apps/participation/templates/participation/participation_detail.html:140
#: apps/participation/templates/participation/participation_detail.html:124
msgid "Define received video"
msgstr "Définir la vidéo reçue"
#: apps/participation/templates/participation/participation_detail.html:141
#: apps/participation/templates/participation/participation_detail.html:146
#: apps/participation/templates/participation/participation_detail.html:125
#: apps/participation/templates/participation/participation_detail.html:130
#: 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
@ -433,21 +415,19 @@ msgstr "Définir la vidéo reçue"
msgid "Update"
msgstr "Modifier"
#: apps/participation/templates/participation/participation_detail.html:145
#: apps/participation/templates/participation/participation_detail.html:129
msgid "Define team that receives your video"
msgstr "Définir l'équipe qui recevra votre vidéo"
#: apps/participation/templates/participation/participation_detail.html:151
#: apps/participation/templates/participation/participation_detail.html:135
msgid "Upload video"
msgstr "Envoyer la vidéo"
#: apps/participation/templates/participation/participation_detail.html:155
#: apps/participation/templates/participation/participation_detail.html:162
#: apps/participation/templates/participation/participation_detail.html:139
msgid "Display solution"
msgstr "Afficher la solution"
#: apps/participation/templates/participation/participation_detail.html:156
#: apps/participation/templates/participation/participation_detail.html:163
#: apps/participation/templates/participation/participation_detail.html:140
msgid "This video platform is not supported yet."
msgstr "La plateforme de cette vidéo n'est pas encore supportée."