mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-04-28 13:32:40 +00:00
Compare commits
5 Commits
52c8a836f1
...
c11a40e054
Author | SHA1 | Date | |
---|---|---|---|
|
c11a40e054 | ||
|
2895fb88db | ||
|
4b14d3562f | ||
|
0ea51f47b3 | ||
|
0e9afc780c |
@ -45,14 +45,27 @@ class Command(BaseCommand):
|
|||||||
preset=RoomPreset.public_chat,
|
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("#annonces:correspondances-maths.fr", avatar_uri)
|
||||||
Matrix.set_room_avatar("#faq: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)
|
Matrix.set_room_power_level_event("#annonces:correspondances-maths.fr", "events_default", 50)
|
||||||
|
|
||||||
for r in Registration.objects.all():
|
for r in Registration.objects.all():
|
||||||
Matrix.invite("#annonces:correspondances-maths.fr", f"@{r.matrix_username}:correspondances-maths.fr")
|
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("#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():
|
for admin in AdminRegistration.objects.all():
|
||||||
Matrix.set_room_power_level("#annonces:correspondances-maths.fr",
|
Matrix.set_room_power_level("#annonces:correspondances-maths.fr",
|
||||||
|
@ -211,7 +211,7 @@ class Video(models.Model):
|
|||||||
If the video is uploaded on Youtube, search in the URL the video code.
|
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-_]*)?.*?")\
|
return re.compile("(https?://|)(www\\.|)(youtube\\.com/watch\\?v=|youtu\\.be/)([a-zA-Z0-9-_]*)?.*?")\
|
||||||
.match("https://www.youtube.com/watch?v=73nsrixx7eI").group(4)
|
.match(self.link).group(4)
|
||||||
|
|
||||||
def as_iframe(self):
|
def as_iframe(self):
|
||||||
"""
|
"""
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<dl class="row">
|
<dl class="row">
|
||||||
{% trans "No video sent" as novideo %}
|
{% trans "No video sent" as novideo %}
|
||||||
<dt class="col-sm-2">{% trans "Proposed solution:" %}</dt>
|
<dt class="col-sm-2">{% trans "Proposed solution:" %}</dt>
|
||||||
<dd class="col-sm-10"><a href="{{ participation.solution.link|default:"#" }}" target="_blank">
|
<dd class="col-sm-10"><a href="{{ participation.solution.link|default:"#" }}"{% if participation.solution.link %} target="_blank"{% endif %}>
|
||||||
{{ participation.solution.link|default:novideo }}</a>
|
{{ participation.solution.link|default:novideo }}</a>
|
||||||
{% if current_phase.phase_number == 1 or participation.solution.link == "" %}
|
{% if current_phase.phase_number == 1 or participation.solution.link == "" %}
|
||||||
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadSolutionModal">{% trans "Upload" %}</button>
|
<button class="btn btn-primary" data-toggle="modal" data-target="#uploadSolutionModal">{% trans "Upload" %}</button>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if user.registration.is_admin or current_phase >= 2 %}
|
{% if user.registration.is_admin or current_phase.phase_number >= 2 %}
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -94,12 +94,28 @@
|
|||||||
<button class="btn btn-primary" data-toggle="modal" data-target="#defineReceivedParticipationModal">{% trans "Change" %}</button>
|
<button class="btn btn-primary" data-toggle="modal" data-target="#defineReceivedParticipationModal">{% trans "Change" %}</button>
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% 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>
|
</dl>
|
||||||
|
|
||||||
{# TODO Display solution #}
|
|
||||||
|
|
||||||
{% if current_phase.phase_number == 2 %}
|
{% if current_phase.phase_number == 2 %}
|
||||||
{# TODO Send questions #}
|
<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>
|
||||||
|
|
||||||
|
{% if user.registration.participates %}
|
||||||
|
<button class="btn btn-success"><i class="fas fa-plus-circle"></i> {% trans "Add a question" %}</button>
|
||||||
|
{% endif %}
|
||||||
{% elif current_phase.phase_number == 3 %}
|
{% elif current_phase.phase_number == 3 %}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{% blocktrans trimmed with user_id=user.pk %}
|
{% blocktrans trimmed with user_id=user.pk %}
|
||||||
@ -139,6 +155,15 @@
|
|||||||
{% trans "Display solution" as modal_title %}
|
{% trans "Display solution" as modal_title %}
|
||||||
{% trans "This video platform is not supported yet." as unsupported_platform %}
|
{% 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 %}
|
{% 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 %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrajavascript %}
|
{% block extrajavascript %}
|
||||||
|
@ -48,3 +48,5 @@ def invite_to_public_rooms(instance: Registration, **_):
|
|||||||
if not instance.pk:
|
if not instance.pk:
|
||||||
Matrix.invite("#annonces:correspondances-maths.fr", f"@{instance.matrix_username}:correspondances-maths.fr")
|
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("#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")
|
||||||
|
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Corres2math\n"
|
"Project-Id-Version: Corres2math\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-10-31 13:32+0100\n"
|
"POT-Creation-Date: 2020-10-31 14:16+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
|
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\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"
|
msgid "Send to team"
|
||||||
msgstr "Envoyer à l'équipe"
|
msgstr "Envoyer à l'équipe"
|
||||||
|
|
||||||
#: apps/participation/forms.py:162
|
#: apps/participation/forms.py:163
|
||||||
msgid "Start date must be before the end date."
|
msgid "Start date must be before the end date."
|
||||||
msgstr "La date de début doit être avant la date de fin."
|
msgstr "La date de début doit être avant la date de fin."
|
||||||
|
|
||||||
#: apps/participation/forms.py:164
|
#: apps/participation/forms.py:165
|
||||||
msgid "This phase must start after the previous phases."
|
msgid "This phase must start after the previous phases."
|
||||||
msgstr "Cette phase doit commencer après les phases précédentes."
|
msgstr "Cette phase doit commencer après les phases précédentes."
|
||||||
|
|
||||||
#: apps/participation/forms.py:166
|
#: apps/participation/forms.py:167
|
||||||
msgid "This phase must end after the next phases."
|
msgid "This phase must end after the next phases."
|
||||||
msgstr "Cette phase doit finir avant les phases suivantes."
|
msgstr "Cette phase doit finir avant les phases suivantes."
|
||||||
|
|
||||||
@ -312,11 +312,12 @@ msgid "No video sent"
|
|||||||
msgstr "Pas de vidéo envoyée"
|
msgstr "Pas de vidéo envoyée"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:23
|
#: apps/participation/templates/participation/participation_detail.html:23
|
||||||
|
#: apps/participation/templates/participation/participation_detail.html:98
|
||||||
msgid "Proposed solution:"
|
msgid "Proposed solution:"
|
||||||
msgstr "Solution proposée :"
|
msgstr "Solution proposée :"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:27
|
#: apps/participation/templates/participation/participation_detail.html:27
|
||||||
#: apps/participation/templates/participation/participation_detail.html:136
|
#: apps/participation/templates/participation/participation_detail.html:152
|
||||||
#: apps/participation/templates/participation/upload_video.html:11
|
#: apps/participation/templates/participation/upload_video.html:11
|
||||||
#: apps/registration/templates/registration/upload_photo_authorization.html:18
|
#: apps/registration/templates/registration/upload_photo_authorization.html:18
|
||||||
#: apps/registration/templates/registration/user_detail.html:78
|
#: apps/registration/templates/registration/user_detail.html:78
|
||||||
@ -324,12 +325,13 @@ msgid "Upload"
|
|||||||
msgstr "Téléverser"
|
msgstr "Téléverser"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:30
|
#: apps/participation/templates/participation/participation_detail.html:30
|
||||||
|
#: apps/participation/templates/participation/participation_detail.html:102
|
||||||
msgid "Display"
|
msgid "Display"
|
||||||
msgstr "Afficher"
|
msgstr "Afficher"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:45
|
#: apps/participation/templates/participation/participation_detail.html:45
|
||||||
msgid "Sent solution"
|
msgid "Sent solution"
|
||||||
msgstr "Solution envoyée :"
|
msgstr "Solution envoyée"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:49
|
#: apps/participation/templates/participation/participation_detail.html:49
|
||||||
msgid "Team that received your solution:"
|
msgid "Team that received your solution:"
|
||||||
@ -371,13 +373,29 @@ msgstr ""
|
|||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:86
|
#: apps/participation/templates/participation/participation_detail.html:86
|
||||||
msgid "Received solution"
|
msgid "Received solution"
|
||||||
msgstr "Solution reçue :"
|
msgstr "Solution reçue"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:90
|
#: apps/participation/templates/participation/participation_detail.html:90
|
||||||
msgid "Team that sent you their solution:"
|
msgid "Team that sent you their solution:"
|
||||||
msgstr "Équipe qui vous a envoyé leur solution :"
|
msgstr "Équipe qui vous a envoyé leur solution :"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:105
|
#: 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
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"You sent your questions to the other team about their solution. When they "
|
"You sent your questions to the other team about their solution. When they "
|
||||||
@ -396,12 +414,12 @@ msgstr ""
|
|||||||
"client Element dédié : <a href=\"https://element.correspondances-maths.fr"
|
"client Element dédié : <a href=\"https://element.correspondances-maths.fr"
|
||||||
"\">element.correpondances-maths.fr</a>"
|
"\">element.correpondances-maths.fr</a>"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:124
|
#: apps/participation/templates/participation/participation_detail.html:140
|
||||||
msgid "Define received video"
|
msgid "Define received video"
|
||||||
msgstr "Définir la vidéo reçue"
|
msgstr "Définir la vidéo reçue"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:125
|
#: apps/participation/templates/participation/participation_detail.html:141
|
||||||
#: apps/participation/templates/participation/participation_detail.html:130
|
#: apps/participation/templates/participation/participation_detail.html:146
|
||||||
#: apps/participation/templates/participation/phase_form.html:11
|
#: apps/participation/templates/participation/phase_form.html:11
|
||||||
#: apps/participation/templates/participation/phase_list.html:18
|
#: apps/participation/templates/participation/phase_list.html:18
|
||||||
#: apps/participation/templates/participation/receive_participation_form.html:11
|
#: apps/participation/templates/participation/receive_participation_form.html:11
|
||||||
@ -415,19 +433,21 @@ msgstr "Définir la vidéo reçue"
|
|||||||
msgid "Update"
|
msgid "Update"
|
||||||
msgstr "Modifier"
|
msgstr "Modifier"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:129
|
#: apps/participation/templates/participation/participation_detail.html:145
|
||||||
msgid "Define team that receives your video"
|
msgid "Define team that receives your video"
|
||||||
msgstr "Définir l'équipe qui recevra votre vidéo"
|
msgstr "Définir l'équipe qui recevra votre vidéo"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:135
|
#: apps/participation/templates/participation/participation_detail.html:151
|
||||||
msgid "Upload video"
|
msgid "Upload video"
|
||||||
msgstr "Envoyer la vidéo"
|
msgstr "Envoyer la vidéo"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:139
|
#: apps/participation/templates/participation/participation_detail.html:155
|
||||||
|
#: apps/participation/templates/participation/participation_detail.html:162
|
||||||
msgid "Display solution"
|
msgid "Display solution"
|
||||||
msgstr "Afficher la solution"
|
msgstr "Afficher la solution"
|
||||||
|
|
||||||
#: apps/participation/templates/participation/participation_detail.html:140
|
#: apps/participation/templates/participation/participation_detail.html:156
|
||||||
|
#: apps/participation/templates/participation/participation_detail.html:163
|
||||||
msgid "This video platform is not supported yet."
|
msgid "This video platform is not supported yet."
|
||||||
msgstr "La plateforme de cette vidéo n'est pas encore supportée."
|
msgstr "La plateforme de cette vidéo n'est pas encore supportée."
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user