Display dates on syntheses page

This commit is contained in:
Yohann D'ANELLO 2020-05-08 16:25:55 +02:00
parent 397f243c82
commit e5b4a9b80f
4 changed files with 77 additions and 35 deletions

View File

@ -268,7 +268,6 @@ class Synthesis(Document):
source = models.CharField( source = models.CharField(
max_length=16, max_length=16,
choices=[ choices=[
("defender", _("Defender")),
("opponent", _("Opponent")), ("opponent", _("Opponent")),
("rapporteur", _("Rapporteur")), ("rapporteur", _("Rapporteur")),
], ],

View File

@ -368,6 +368,8 @@ class SynthesesView(TeamMixin, BaseFormView, SingleTableView):
self.object_list = self.get_queryset() self.object_list = self.get_queryset()
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
context["now"] = timezone.now() 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 return context
def form_valid(self, form): def form_valid(self, form):

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: TFJM2\n" "Project-Id-Version: TFJM2\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2020-04-29 02:30+0000\n"
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n" "Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
"Language-Team: fr <LL@li.org>\n" "Language-Team: fr <LL@li.org>\n"
@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: apps/api/apps.py:10 #: apps/api/apps.py:7
msgid "API" msgid "API"
msgstr "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}" msgstr "Solution de l'équipe {trigram} pour le problème {problem}"
#: apps/member/models.py:271 #: apps/member/models.py:271
msgid "Defender"
msgstr "Défenseur"
#: apps/member/models.py:272
msgid "Opponent" msgid "Opponent"
msgstr "Opposant" msgstr "Opposant"
#: apps/member/models.py:273 #: apps/member/models.py:272
msgid "Rapporteur" msgid "Rapporteur"
msgstr "Rapporteur" msgstr "Rapporteur"
#: apps/member/models.py:275 #: apps/member/models.py:274
msgid "source" msgid "source"
msgstr "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" msgid "Round 1"
msgstr "Tour 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" msgid "Round 2"
msgstr "Tour 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 #: templates/tournament/pool_detail.html:18
msgid "round" msgid "round"
msgstr "tour" msgstr "tour"
#: apps/member/models.py:288 #: apps/member/models.py:287
msgid "final synthesis" msgid "final synthesis"
msgstr "synthèse pour la finale" msgstr "synthèse pour la finale"
#: apps/member/models.py:296 #: apps/member/models.py:295
msgid "synthesis" msgid "synthesis"
msgstr "synthèse" msgstr "synthèse"
#: apps/member/models.py:297 #: apps/member/models.py:296
msgid "syntheses" msgid "syntheses"
msgstr "synthèses" msgstr "synthèses"
#: apps/member/models.py:301 #: apps/member/models.py:300
#, python-brace-format #, python-brace-format
msgid "" msgid ""
"Synthesis of team {trigram} that is {source} for the tournament {tournament}" "Synthesis of team {trigram} that is {source} for the tournament {tournament}"
msgstr "" msgstr ""
"Synthèse de l'équipe {trigram} qui est {source} pour le tournoi {tournament}" "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" msgid "key"
msgstr "clé" msgstr "clé"
#: apps/member/models.py:314 #: apps/member/models.py:313
msgid "value" msgid "value"
msgstr "valeur" msgstr "valeur"
#: apps/member/models.py:318 #: apps/member/models.py:317
msgid "configuration" msgid "configuration"
msgstr "configuration" msgstr "configuration"
#: apps/member/models.py:319 #: apps/member/models.py:318
msgid "configurations" msgid "configurations"
msgstr "configurations" msgstr "configurations"
@ -311,15 +307,15 @@ msgstr "Cette équipe est pleine en encadrants."
msgid "This team is full of participants." msgid "This team is full of participants."
msgstr "Cette équipe est pleine en 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" msgid "All profiles"
msgstr "Tous les profils" 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" msgid "Orphaned profiles"
msgstr "Profils orphelins" 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" msgid "Organizers"
msgstr "Organisateurs" msgstr "Organisateurs"
@ -595,24 +591,24 @@ msgstr "Tournoi de {name}"
msgid "Update tournament" msgid "Update tournament"
msgstr "Modifier le tournoi" 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 #, python-brace-format
msgid "Solutions for team {team}.zip" msgid "Solutions for team {team}.zip"
msgstr "Solutions pour l'équipe {team}.zip" msgstr "Solutions pour l'équipe {team}.zip"
#: apps/tournament/views.py:187 #: apps/tournament/views.py:189
msgid "Information about team" msgid "Information about team"
msgstr "Informations sur l'équipe" msgstr "Informations sur l'équipe"
#: apps/tournament/views.py:197 #: apps/tournament/views.py:199
msgid "Update team" msgid "Update team"
msgstr "Modifier l'équipe" msgstr "Modifier l'équipe"
#: apps/tournament/views.py:209 #: apps/tournament/views.py:211
msgid "Add organizer" msgid "Add organizer"
msgstr "Ajouter un organisateur" 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 #: templates/tournament/pool_detail.html:31
msgid "Solutions" msgid "Solutions"
msgstr "Solutions" msgstr "Solutions"
@ -811,7 +807,7 @@ msgstr "Filtres"
#: templates/member/my_account.html:8 templates/tournament/add_organizer.html:9 #: templates/member/my_account.html:8 templates/tournament/add_organizer.html:9
#: templates/tournament/pool_form.html:9 #: templates/tournament/pool_form.html:9
#: templates/tournament/solutions_list.html:24 #: 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/team_form.html:9
#: templates/tournament/tournament_form.html:9 #: templates/tournament/tournament_form.html:9
msgid "Submit" msgid "Submit"
@ -1027,6 +1023,31 @@ msgstr "Vous ne pouvez plus publier vos solutions."
msgid "%(tournament)s — ZIP" msgid "%(tournament)s — ZIP"
msgstr "%(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 #: templates/tournament/team_detail.html:8
msgid "Team" msgid "Team"
msgstr "Équipe" msgstr "Équipe"
@ -1048,10 +1069,8 @@ msgid "Edit team"
msgstr "Modifier l'équipe" msgstr "Modifier l'équipe"
#: templates/tournament/team_detail.html:53 #: templates/tournament/team_detail.html:53
#, fuzzy
#| msgid "selected for final"
msgid "Select 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 #: templates/tournament/team_detail.html:59
msgid "Delete team" msgid "Delete team"
@ -1133,6 +1152,3 @@ msgstr "Anglais"
#: tfjm/settings.py:147 #: tfjm/settings.py:147
msgid "French" msgid "French"
msgstr "Français" msgstr "Français"
#~ msgid "date of maximal syntheses submission"
#~ msgstr "date d'envoi maximal des notes de synthèses"

View File

@ -9,6 +9,31 @@
</div> </div>
{% if form %} {% if form %}
{% if now < user.team.future_tournament.date_syntheses %}
<div class="alert alert-warning">
{% blocktrans with deadline=user.team.future_tournament.date_syntheses round=1 %}You can upload your syntheses for round {{ round }} until {{ deadline }}.{% endblocktrans %}
</div>
{% elif now < real_deadline_1 %}
<div class="alert alert-danger">
{% 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 %}
</div>
{% elif now < user.team.future_tournament.date_solutions_2 %}
<div class="alert alert-danger">
{% blocktrans with round=1 %}You can't upload your syntheses for the round {{ round }} anymore.{% endblocktrans %}
</div>
{% elif now < user.team.future_tournament.date_syntheses_2 %}
<div class="alert alert-warning">
{% blocktrans with deadline=user.team.future_tournament.date_syntheses_2 round=2 %}You can upload your syntheses for round {{ round }} until {{ deadline }}.{% endblocktrans %}
</div>
{% elif now < real_deadline_2 %}
<div class="alert alert-danger">
{% 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 %}
</div>
{% else %}
<div class="alert alert-danger">
{% blocktrans with round=2 %}You can't upload your syntheses for the round {{ round }} anymore.{% endblocktrans %}
</div>
{% endif %}
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
{{ form|crispy }} {{ form|crispy }}