From e5b4a9b80f94ec0d60009905918340503a69e05b Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 8 May 2020 16:25:55 +0200 Subject: [PATCH] Display dates on syntheses page --- apps/member/models.py | 1 - apps/tournament/views.py | 2 + locale/fr/LC_MESSAGES/django.po | 84 ++++++++++++++---------- templates/tournament/syntheses_list.html | 25 +++++++ 4 files changed, 77 insertions(+), 35 deletions(-) diff --git a/apps/member/models.py b/apps/member/models.py index fc1306a..621e8e7 100644 --- a/apps/member/models.py +++ b/apps/member/models.py @@ -268,7 +268,6 @@ class Synthesis(Document): source = models.CharField( max_length=16, choices=[ - ("defender", _("Defender")), ("opponent", _("Opponent")), ("rapporteur", _("Rapporteur")), ], diff --git a/apps/tournament/views.py b/apps/tournament/views.py index 8f4e9e4..9384825 100644 --- a/apps/tournament/views.py +++ b/apps/tournament/views.py @@ -368,6 +368,8 @@ class SynthesesView(TeamMixin, BaseFormView, SingleTableView): self.object_list = self.get_queryset() context = super().get_context_data(**kwargs) context["now"] = timezone.now() + context["real_deadline_1"] = self.request.user.team.future_tournament.date_syntheses + timedelta(minutes=30) + context["real_deadline_2"] = self.request.user.team.future_tournament.date_syntheses_2 + timedelta(minutes=30) return context def form_valid(self, form): diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 75c20fa..8bf8c18 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: TFJM2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-06 18:53+0200\n" +"POT-Creation-Date: 2020-05-08 16:24+0200\n" "PO-Revision-Date: 2020-04-29 02:30+0000\n" "Last-Translator: Yohann D'ANELLO \n" "Language-Team: fr \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: apps/api/apps.py:10 +#: apps/api/apps.py:7 msgid "API" msgstr "API" @@ -232,66 +232,62 @@ msgid "Solution of team {trigram} for problem {problem}" msgstr "Solution de l'équipe {trigram} pour le problème {problem}" #: apps/member/models.py:271 -msgid "Defender" -msgstr "Défenseur" - -#: apps/member/models.py:272 msgid "Opponent" msgstr "Opposant" -#: apps/member/models.py:273 +#: apps/member/models.py:272 msgid "Rapporteur" msgstr "Rapporteur" -#: apps/member/models.py:275 +#: apps/member/models.py:274 msgid "source" msgstr "source" -#: apps/member/models.py:280 apps/tournament/models.py:253 +#: apps/member/models.py:279 apps/tournament/models.py:253 msgid "Round 1" msgstr "Tour 1" -#: apps/member/models.py:281 apps/tournament/models.py:254 +#: apps/member/models.py:280 apps/tournament/models.py:254 msgid "Round 2" msgstr "Tour 2" -#: apps/member/models.py:283 apps/tournament/models.py:256 +#: apps/member/models.py:282 apps/tournament/models.py:256 #: templates/tournament/pool_detail.html:18 msgid "round" msgstr "tour" -#: apps/member/models.py:288 +#: apps/member/models.py:287 msgid "final synthesis" msgstr "synthèse pour la finale" -#: apps/member/models.py:296 +#: apps/member/models.py:295 msgid "synthesis" msgstr "synthèse" -#: apps/member/models.py:297 +#: apps/member/models.py:296 msgid "syntheses" msgstr "synthèses" -#: apps/member/models.py:301 +#: apps/member/models.py:300 #, python-brace-format msgid "" "Synthesis of team {trigram} that is {source} for the tournament {tournament}" msgstr "" "Synthèse de l'équipe {trigram} qui est {source} pour le tournoi {tournament}" -#: apps/member/models.py:309 +#: apps/member/models.py:308 msgid "key" msgstr "clé" -#: apps/member/models.py:314 +#: apps/member/models.py:313 msgid "value" msgstr "valeur" -#: apps/member/models.py:318 +#: apps/member/models.py:317 msgid "configuration" msgstr "configuration" -#: apps/member/models.py:319 +#: apps/member/models.py:318 msgid "configurations" msgstr "configurations" @@ -311,15 +307,15 @@ msgstr "Cette équipe est pleine en encadrants." msgid "This team is full of participants." msgstr "Cette équipe est pleine en participants." -#: apps/member/views.py:176 templates/base.html:81 +#: apps/member/views.py:179 templates/base.html:81 msgid "All profiles" msgstr "Tous les profils" -#: apps/member/views.py:185 templates/base.html:80 +#: apps/member/views.py:188 templates/base.html:80 msgid "Orphaned profiles" msgstr "Profils orphelins" -#: apps/member/views.py:194 apps/tournament/forms.py:17 templates/base.html:83 +#: apps/member/views.py:197 apps/tournament/forms.py:17 templates/base.html:83 msgid "Organizers" msgstr "Organisateurs" @@ -595,24 +591,24 @@ msgstr "Tournoi de {name}" msgid "Update tournament" msgstr "Modifier le tournoi" -#: apps/tournament/views.py:134 apps/tournament/views.py:244 +#: apps/tournament/views.py:134 apps/tournament/views.py:246 #, python-brace-format msgid "Solutions for team {team}.zip" msgstr "Solutions pour l'équipe {team}.zip" -#: apps/tournament/views.py:187 +#: apps/tournament/views.py:189 msgid "Information about team" msgstr "Informations sur l'équipe" -#: apps/tournament/views.py:197 +#: apps/tournament/views.py:199 msgid "Update team" msgstr "Modifier l'équipe" -#: apps/tournament/views.py:209 +#: apps/tournament/views.py:211 msgid "Add organizer" msgstr "Ajouter un organisateur" -#: apps/tournament/views.py:228 templates/base.html:108 templates/base.html:126 +#: apps/tournament/views.py:230 templates/base.html:108 templates/base.html:126 #: templates/tournament/pool_detail.html:31 msgid "Solutions" msgstr "Solutions" @@ -811,7 +807,7 @@ msgstr "Filtres" #: templates/member/my_account.html:8 templates/tournament/add_organizer.html:9 #: templates/tournament/pool_form.html:9 #: templates/tournament/solutions_list.html:24 -#: templates/tournament/syntheses_list.html:15 +#: templates/tournament/syntheses_list.html:40 #: templates/tournament/team_form.html:9 #: templates/tournament/tournament_form.html:9 msgid "Submit" @@ -1027,6 +1023,31 @@ msgstr "Vous ne pouvez plus publier vos solutions." msgid "%(tournament)s — ZIP" msgstr "%(tournament)s — ZIP" +#: templates/tournament/syntheses_list.html:14 +#: templates/tournament/syntheses_list.html:26 +#, python-format +msgid "You can upload your syntheses for round %(round)s until %(deadline)s." +msgstr "" +"Vous pouvez envoyer vos notes de synthèses pour le tour %(round)s jusqu'au " +"%(deadline)s." + +#: templates/tournament/syntheses_list.html:18 +#: templates/tournament/syntheses_list.html:30 +msgid "" +"The deadline to send your syntheses for the round %(round)s is reached. " +"However, you have an extra time of 30 minutes to send your papers, no " +"panic :)" +msgstr "" +"La date limite pour envoyer vos notes de synthèses pour le tour %(round) est " +"dépassée. Toutefois, vous avez droit à un délai supplémentaire de 30 minutes " +"pour envoyer vos papiers, pas de panique :)" + +#: templates/tournament/syntheses_list.html:22 +#: templates/tournament/syntheses_list.html:34 +msgid "You can't upload your syntheses for the round %(round)s anymore." +msgstr "" +"Vous ne pouvez plus publier vos notes de synthèses pour le tour %(round)." + #: templates/tournament/team_detail.html:8 msgid "Team" msgstr "Équipe" @@ -1048,10 +1069,8 @@ msgid "Edit team" msgstr "Modifier l'équipe" #: templates/tournament/team_detail.html:53 -#, fuzzy -#| msgid "selected for final" msgid "Select for final" -msgstr "sélectionnée pour la finale" +msgstr "sélectionner pour la finale" #: templates/tournament/team_detail.html:59 msgid "Delete team" @@ -1133,6 +1152,3 @@ msgstr "Anglais" #: tfjm/settings.py:147 msgid "French" msgstr "Français" - -#~ msgid "date of maximal syntheses submission" -#~ msgstr "date d'envoi maximal des notes de synthèses" diff --git a/templates/tournament/syntheses_list.html b/templates/tournament/syntheses_list.html index 7705569..25221e2 100644 --- a/templates/tournament/syntheses_list.html +++ b/templates/tournament/syntheses_list.html @@ -9,6 +9,31 @@ {% if form %} + {% if now < user.team.future_tournament.date_syntheses %} +
+ {% blocktrans with deadline=user.team.future_tournament.date_syntheses round=1 %}You can upload your syntheses for round {{ round }} until {{ deadline }}.{% endblocktrans %} +
+ {% elif now < real_deadline_1 %} +
+ {% blocktrans with round=1 %}The deadline to send your syntheses for the round {{ round }} is reached. However, you have an extra time of 30 minutes to send your papers, no panic :){% endblocktrans %} +
+ {% elif now < user.team.future_tournament.date_solutions_2 %} +
+ {% blocktrans with round=1 %}You can't upload your syntheses for the round {{ round }} anymore.{% endblocktrans %} +
+ {% elif now < user.team.future_tournament.date_syntheses_2 %} +
+ {% blocktrans with deadline=user.team.future_tournament.date_syntheses_2 round=2 %}You can upload your syntheses for round {{ round }} until {{ deadline }}.{% endblocktrans %} +
+ {% elif now < real_deadline_2 %} +
+ {% blocktrans with round=2 %}The deadline to send your syntheses for the round {{ round }} is reached. However, you have an extra time of 30 minutes to send your papers, no panic :){% endblocktrans %} +
+ {% else %} +
+ {% blocktrans with round=2 %}You can't upload your syntheses for the round {{ round }} anymore.{% endblocktrans %} +
+ {% endif %}
{% csrf_token %} {{ form|crispy }}