Add buttons to hide notes from public if needed

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-03-31 22:11:01 +02:00
parent d7b4233282
commit bb579d640c
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 139 additions and 114 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: TFJM\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-31 21:23+0200\n"
"POT-Creation-Date: 2024-03-31 22:09+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -345,10 +345,10 @@ msgstr "équipe"
#: draw/templates/draw/tournament_content.html:228
#: draw/templates/draw/tournament_content.html:229
#: draw/templates/draw/tournament_content.html:230
#: participation/templates/participation/pool_detail.html:77
#: participation/templates/participation/pool_detail.html:81
#: participation/templates/participation/pool_detail.html:86
#: participation/templates/participation/pool_detail.html:90
#: participation/templates/participation/pool_detail.html:85
#: participation/templates/participation/pool_detail.html:89
#: participation/templates/participation/pool_detail.html:94
#: participation/templates/participation/pool_detail.html:98
msgid "Room"
msgstr "Salle"
@ -1161,10 +1161,10 @@ msgstr "Pas d'équipe définie"
#: participation/tables.py:142
#: participation/templates/participation/note_form.html:14
#: participation/templates/participation/passage_detail.html:54
#: participation/templates/participation/passage_detail.html:153
#: participation/templates/participation/passage_detail.html:159
#: participation/templates/participation/pool_detail.html:144
#: participation/templates/participation/passage_detail.html:15
#: participation/templates/participation/passage_detail.html:161
#: participation/templates/participation/passage_detail.html:167
#: participation/templates/participation/pool_detail.html:13
#: participation/templates/participation/pool_detail.html:157
#: participation/templates/participation/team_detail.html:151
#: participation/templates/participation/team_detail.html:215
@ -1231,7 +1231,7 @@ msgid "Team:"
msgstr "Équipe :"
#: participation/templates/participation/participation_detail.html:16
#: participation/templates/participation/pool_detail.html:12
#: participation/templates/participation/pool_detail.html:20
#: participation/templates/participation/team_detail.html:43
msgid "Tournament:"
msgstr "Tournoi :"
@ -1265,7 +1265,7 @@ msgid "Upload solution"
msgstr "Envoyer une solution"
#: participation/templates/participation/participation_detail.html:65
#: participation/templates/participation/passage_detail.html:165
#: participation/templates/participation/passage_detail.html:173
#: participation/templates/participation/pool_detail.html:162
#: participation/templates/participation/team_detail.html:210
#: participation/templates/participation/upload_motivation_letter.html:13
@ -1284,179 +1284,179 @@ msgstr "Envoyer une solution"
msgid "Upload"
msgstr "Téléverser"
#: participation/templates/participation/passage_detail.html:13
#: participation/templates/participation/passage_detail.html:22
msgid "Pool:"
msgstr "Poule :"
#: participation/templates/participation/passage_detail.html:16
#: participation/templates/participation/passage_detail.html:25
msgid "Position:"
msgstr "Position :"
#: participation/templates/participation/passage_detail.html:19
#: participation/templates/participation/passage_detail.html:28
msgid "Defender:"
msgstr "Défenseur⋅se :"
#: participation/templates/participation/passage_detail.html:22
#: participation/templates/participation/passage_detail.html:31
msgid "Opponent:"
msgstr "Opposant⋅e :"
#: participation/templates/participation/passage_detail.html:25
#: participation/templates/participation/passage_detail.html:34
msgid "Reporter:"
msgstr "Rapporteur⋅rice :"
#: participation/templates/participation/passage_detail.html:29
#: participation/templates/participation/passage_detail.html:38
msgid "Observer:"
msgstr "Observateur⋅rice :"
#: participation/templates/participation/passage_detail.html:33
#: participation/templates/participation/passage_detail.html:42
msgid "Defended solution:"
msgstr "Solution défendue"
#: participation/templates/participation/passage_detail.html:36
#: participation/templates/participation/passage_detail.html:45
msgid "Defender penalties count:"
msgstr "Nombre de pénalités :"
#: participation/templates/participation/passage_detail.html:39
#: participation/templates/participation/pool_detail.html:46
#: participation/templates/participation/passage_detail.html:48
#: participation/templates/participation/pool_detail.html:54
msgid "Syntheses:"
msgstr "Notes de synthèse :"
#: participation/templates/participation/passage_detail.html:44
#: participation/templates/participation/pool_detail.html:55
#: participation/templates/participation/passage_detail.html:53
#: participation/templates/participation/pool_detail.html:63
msgid "No synthesis was uploaded yet."
msgstr "Aucune note de synthèse n'a encore été envoyée."
#: participation/templates/participation/passage_detail.html:52
#: participation/templates/participation/passage_detail.html:158
#: participation/templates/participation/passage_detail.html:61
#: participation/templates/participation/passage_detail.html:166
msgid "Update notes"
msgstr "Modifier les notes"
#: participation/templates/participation/passage_detail.html:58
#: participation/templates/participation/passage_detail.html:164
#: participation/templates/participation/passage_detail.html:66
#: participation/templates/participation/passage_detail.html:172
msgid "Upload synthesis"
msgstr "Envoyer une note de synthèse"
#: participation/templates/participation/passage_detail.html:66
#: participation/templates/participation/passage_detail.html:74
msgid "Notes detail"
msgstr "Détails des notes"
#: participation/templates/participation/passage_detail.html:74
#: participation/templates/participation/passage_detail.html:82
msgid "Average points for the defender writing"
msgstr "Moyenne de l'écrit de l'équipe défenseuse"
#: participation/templates/participation/passage_detail.html:80
#: participation/templates/participation/passage_detail.html:88
msgid "Average points for the defender oral"
msgstr "Moyenne de l'oral de l'équipe défenseuse"
#: participation/templates/participation/passage_detail.html:86
#: participation/templates/participation/passage_detail.html:94
msgid "Average points for the opponent writing"
msgstr "Moyenne de l'écrit de l'équipe opposante"
#: participation/templates/participation/passage_detail.html:92
#: participation/templates/participation/passage_detail.html:100
msgid "Average points for the opponent oral"
msgstr "Moyenne de l'oral de l'équipe opposante"
#: participation/templates/participation/passage_detail.html:98
#: participation/templates/participation/passage_detail.html:106
msgid "Average points for the reporter writing"
msgstr "Moyenne de l'écrit de l'équipe rapportrice"
#: participation/templates/participation/passage_detail.html:104
#: participation/templates/participation/passage_detail.html:112
msgid "Average points for the reporter oral"
msgstr "Moyenne de l'oral de l'équipe rapportrice"
#: participation/templates/participation/passage_detail.html:111
#: participation/templates/participation/passage_detail.html:119
msgid "Average points for the observer oral"
msgstr "Moyenne de l'oral de l'équipe observatrice"
#: participation/templates/participation/passage_detail.html:122
#: participation/templates/participation/passage_detail.html:130
msgid "Defender points"
msgstr "Points de l'équipe défenseuse"
#: participation/templates/participation/passage_detail.html:128
#: participation/templates/participation/passage_detail.html:136
msgid "Opponent points"
msgstr "Points de l'équipe opposante"
#: participation/templates/participation/passage_detail.html:134
#: participation/templates/participation/passage_detail.html:142
msgid "Reporter points"
msgstr "Points de l'équipe rapportrice"
#: participation/templates/participation/passage_detail.html:141
#: participation/templates/participation/passage_detail.html:149
msgid "Observer points"
msgstr "Points de l'équipe observatrice"
#: participation/templates/participation/passage_detail.html:152
#: participation/templates/participation/passage_detail.html:160
#: participation/templates/participation/passage_form.html:11
msgid "Update passage"
msgstr "Modifier le passage"
#: participation/templates/participation/pool_detail.html:15
#: participation/templates/participation/pool_detail.html:23
msgid "Round:"
msgstr "Tour :"
#: participation/templates/participation/pool_detail.html:18
#: participation/templates/participation/pool_detail.html:26
msgid "Letter:"
msgstr "Lettre :"
#: participation/templates/participation/pool_detail.html:21
#: participation/templates/participation/pool_detail.html:29
msgid "Teams:"
msgstr "Équipes :"
#: participation/templates/participation/pool_detail.html:28
#: participation/templates/participation/pool_detail.html:36
msgid "Juries:"
msgstr "Juré⋅es :"
#: participation/templates/participation/pool_detail.html:32
#: participation/templates/participation/pool_detail.html:40
msgid "Edit jury"
msgstr "Modifier le jury"
#: participation/templates/participation/pool_detail.html:36
#: participation/templates/participation/pool_detail.html:44
msgid "Defended solutions:"
msgstr "Solutions défendues :"
#: participation/templates/participation/pool_detail.html:42
#: participation/templates/participation/pool_detail.html:61
#: participation/templates/participation/pool_detail.html:50
#: participation/templates/participation/pool_detail.html:69
msgid "Download all"
msgstr "Tout télécharger"
#: participation/templates/participation/pool_detail.html:66
#: participation/templates/participation/pool_detail.html:74
msgid "BigBlueButton link:"
msgstr "Lien BigBlueButton :"
#: participation/templates/participation/pool_detail.html:72
#: participation/templates/participation/pool_detail.html:80
msgid "Notation sheets:"
msgstr "Feuilles de notations :"
#: participation/templates/participation/pool_detail.html:77
#: participation/templates/participation/pool_detail.html:85
msgid "Download the scale sheet"
msgstr "Télécharger la feuille de barème"
#: participation/templates/participation/pool_detail.html:86
#: participation/templates/participation/pool_detail.html:94
msgid "Download the final notation sheet"
msgstr "Télécharger la fiche de notation finale"
#: participation/templates/participation/pool_detail.html:95
#: participation/templates/participation/pool_detail.html:103
msgid "Download all notation sheets"
msgstr "Télécharger toutes les fiches de notation"
#: participation/templates/participation/pool_detail.html:100
#: participation/templates/participation/pool_detail.html:108
msgid "Google Sheets Spreadsheet:"
msgstr "Tableur Google Sheets :"
#: participation/templates/participation/pool_detail.html:104
#: participation/templates/participation/pool_detail.html:112
msgid "Go to the Google Sheets page of the pool"
msgstr "Aller à la page Google Sheets de la poule"
#: participation/templates/participation/pool_detail.html:113
#: participation/templates/participation/tournament_detail.html:98
#: participation/templates/participation/pool_detail.html:121
#: participation/templates/participation/tournament_detail.html:101
#: participation/templates/participation/tournament_harmonize.html:8
msgid "Ranking"
msgstr "Classement"
#: participation/templates/participation/pool_detail.html:128
#: participation/templates/participation/pool_detail.html:136
msgid "Upload notes from a CSV file"
msgstr "Soumettre les notes à partir d'un fichier CSV"
#: participation/templates/participation/pool_detail.html:132
#: participation/templates/participation/pool_detail.html:140
msgid "Download notation spreadsheet"
msgstr "Télécharger le tableur de notes"
@ -1736,42 +1736,50 @@ msgstr "Pour contacter les juré⋅es"
msgid "To contact valid teams"
msgstr "Pour contacter les équipes valides"
#: participation/templates/participation/tournament_detail.html:64
#: participation/templates/participation/tournament_detail.html:66
msgid "Edit tournament"
msgstr "Modifier le tournoi"
#: participation/templates/participation/tournament_detail.html:71
#: participation/templates/participation/tournament_detail.html:74
#: tfjm/templates/navbar.html:29
msgid "Teams"
msgstr "Équipes"
#: participation/templates/participation/tournament_detail.html:79
#: participation/templates/participation/tournament_detail.html:82
msgid "Access to payments list"
msgstr "Accéder à la liste des paiements"
#: participation/templates/participation/tournament_detail.html:87
#: participation/templates/participation/tournament_detail.html:90
msgid "Pools"
msgstr "Poules"
#: participation/templates/participation/tournament_detail.html:114
msgid "Publish notes for first round"
msgstr "Publier les notes pour le premier tour"
#: participation/templates/participation/tournament_detail.html:120
msgid "Publish notes for second round"
msgstr "Publier les notes pour le second tour"
#: participation/templates/participation/tournament_detail.html:128
#: participation/templates/participation/tournament_detail.html:132
#: participation/templates/participation/tournament_detail.html:115
#: participation/templates/participation/tournament_detail.html:119
msgid "Harmonize"
msgstr "Harmoniser"
#: participation/templates/participation/tournament_detail.html:128
#: participation/templates/participation/tournament_detail.html:132
#: participation/templates/participation/tournament_detail.html:115
#: participation/templates/participation/tournament_detail.html:119
msgid "Day"
msgstr "Jour"
#: participation/templates/participation/tournament_detail.html:143
#: participation/templates/participation/tournament_detail.html:128
msgid "Publish notes for first round"
msgstr "Publier les notes pour le premier tour"
#: participation/templates/participation/tournament_detail.html:133
msgid "Unpublish notes for first round"
msgstr "Dépublier les notes pour le premier tour"
#: participation/templates/participation/tournament_detail.html:139
msgid "Publish notes for second round"
msgstr "Publier les notes pour le second tour"
#: participation/templates/participation/tournament_detail.html:144
msgid "Unpublish notes for second round"
msgstr "Dépublier les notes pour le second tour"
#: participation/templates/participation/tournament_detail.html:156
msgid "Files available for download"
msgstr "Fichiers disponibles au téléchargement"
@ -1943,97 +1951,101 @@ msgstr "Participation de l'équipe {trigram}"
msgid "Payments of {tournament}"
msgstr "Paiements de {tournament}"
#: participation/views.py:707
#: participation/views.py:708
msgid "Notes published!"
msgstr "Notes publiées !"
#: participation/views.py:738
#: participation/views.py:710
msgid "Notes hidden!"
msgstr "Notes dissimulées !"
#: participation/views.py:741
#, python-brace-format
msgid "Harmonize notes of {tournament} - Day {round}"
msgstr "Harmoniser les notes de {tournament} - Jour {round}"
#: participation/views.py:818
#: participation/views.py:821
msgid "You can't upload a solution after the deadline."
msgstr "Vous ne pouvez pas envoyer de solution après la date limite."
#: participation/views.py:935
#: participation/views.py:938
#, python-brace-format
msgid "Solutions of team {trigram}.zip"
msgstr "Solutions de l'équipe {trigram}.zip"
#: participation/views.py:935
#: participation/views.py:938
#, python-brace-format
msgid "Syntheses of team {trigram}.zip"
msgstr "Notes de synthèse de l'équipe {trigram}.zip"
#: participation/views.py:952 participation/views.py:967
#: participation/views.py:955 participation/views.py:970
#, python-brace-format
msgid "Solutions of {tournament}.zip"
msgstr "Solutions de {tournament}.zip"
#: participation/views.py:952 participation/views.py:967
#: participation/views.py:955 participation/views.py:970
#, python-brace-format
msgid "Syntheses of {tournament}.zip"
msgstr "Notes de synthèse de {tournament}.zip"
#: participation/views.py:976
#: participation/views.py:979
#, python-brace-format
msgid "Solutions for pool {pool} of tournament {tournament}.zip"
msgstr "Solutions pour la poule {pool} du tournoi {tournament}.zip"
#: participation/views.py:977
#: participation/views.py:980
#, python-brace-format
msgid "Syntheses for pool {pool} of tournament {tournament}.zip"
msgstr "Notes de synthèses pour la poule {pool} du tournoi {tournament}.zip"
#: participation/views.py:1019
#: participation/views.py:1022
#, python-brace-format
msgid "Jury of pool {pool} for {tournament} with teams {teams}"
msgstr "Jury de la poule {pool} pour {tournament} avec les équipes {teams}"
#: participation/views.py:1035
#: participation/views.py:1038
#, python-brace-format
msgid "The jury {name} is already in the pool!"
msgstr "{name} est déjà dans la poule !"
#: participation/views.py:1055
#: participation/views.py:1058
msgid "New TFJM² jury account"
msgstr "Nouveau compte de juré⋅e pour le TFJM²"
#: participation/views.py:1076
#: participation/views.py:1079
#, python-brace-format
msgid "The jury {name} has been successfully added!"
msgstr "{name} a été ajouté⋅e avec succès en tant que juré⋅e !"
#: participation/views.py:1112
#: participation/views.py:1115
#, python-brace-format
msgid "The jury {name} has been successfully removed!"
msgstr "{name} a été retiré⋅e avec succès du jury !"
#: participation/views.py:1138
#: participation/views.py:1141
#, python-brace-format
msgid "The jury {name} has been successfully promoted president!"
msgstr "{name} a été nommé⋅e président⋅e du jury !"
#: participation/views.py:1166
#: participation/views.py:1169
msgid "The following user is not registered as a jury:"
msgstr "L'utilisateur⋅rice suivant n'est pas inscrit⋅e en tant que juré⋅e :"
#: participation/views.py:1183
#: participation/views.py:1186
msgid "Notes were successfully uploaded."
msgstr "Les notes ont bien été envoyées."
#: participation/views.py:1816
#: participation/views.py:1819
#, python-brace-format
msgid "Notation sheets of pool {pool} of {tournament}.zip"
msgstr "Feuilles de notations pour la poule {pool} du tournoi {tournament}.zip"
#: participation/views.py:1821
#: participation/views.py:1824
#, python-brace-format
msgid "Notation sheets of {tournament}.zip"
msgstr "Feuilles de notation de {tournament}.zip"
#: participation/views.py:1971
#: participation/views.py:1974
msgid "You can't upload a synthesis after the deadline."
msgstr "Vous ne pouvez pas envoyer de note de synthèse après la date limite."

View File

@ -109,22 +109,6 @@
</div>
{% if user.registration.is_admin or user.registration in tournament.organizers.all %}
<div class="card-footer text-center">
{% if not available_notes_1 or not available_notes_2 %}
<div class="btn-group">
{% if not available_notes_1 %}
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=1 %}" class="btn btn-info">
<i class="fas fa-upload"></i>
{% trans "Publish notes for first round" %}
</a>
{% endif %}
{% if not available_notes_2 %}
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=2 %}" class="btn btn-info">
<i class="fas fa-upload"></i>
{% trans "Publish notes for second round" %}
</a>
{% endif %}
</div>
{% endif %}
<div class="btn-group">
<a href="{% url 'participation:tournament_harmonize' pk=tournament.pk round=1 %}" class="btn btn-secondary">
<i class="fas fa-ranking-star"></i>
@ -136,6 +120,32 @@
</a>
</div>
</div>
<div class="card-footer text-center">
<div class="btn-group">
{% if not available_notes_1 %}
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=1 %}" class="btn btn-sm btn-info">
<i class="fas fa-eye"></i>
{% trans "Publish notes for first round" %}
</a>
{% else %}
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=1 %}?hide" class="btn btn-sm btn-danger">
<i class="fas fa-eye-slash"></i>
{% trans "Unpublish notes for first round" %}
</a>
{% endif %}
{% if not available_notes_2 %}
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=2 %}" class="btn btn-sm btn-info">
<i class="fas fa-eye"></i>
{% trans "Publish notes for second round" %}
</a>
{% else %}
<a href="{% url 'participation:tournament_publish_notes' pk=tournament.pk round=2 %}?hide" class="btn btn-sm btn-danger">
<i class="fas fa-eye-slash"></i>
{% trans "Unpublish notes for second round" %}
</a>
{% endif %}
</div>
</div>
{% endif %}
</div>
{% endif %}

View File

@ -703,8 +703,11 @@ class TournamentPublishNotesView(VolunteerMixin, SingleObjectMixin, RedirectView
raise Http404
tournament = Tournament.objects.get(pk=kwargs["pk"])
tournament.pools.filter(round=kwargs["round"]).update(results_available=True)
tournament.pools.filter(round=kwargs["round"]).update(results_available='hide' not in request.GET)
if 'hide' not in request.GET:
messages.success(request, _("Notes published!"))
else:
messages.success(request, _("Notes hidden!"))
return super().get(request, *args, **kwargs)
def get_redirect_url(self, *args, **kwargs):