Compare commits

...

6 Commits

Author SHA1 Message Date
Emmy D'Anello 923b07b97e
Reduce delay to update the left bar to only 2 hours
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-04-03 23:34:59 +02:00
Emmy D'Anello 84860a2875
Add syntheses templates in information bar
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-04-03 23:32:01 +02:00
Emmy D'Anello 6add9a1419
Add links to solutions also for second round
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-04-03 23:21:23 +02:00
Emmy D'Anello eddb741eb7
Important information are not only displayed to organizers
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-04-03 23:17:24 +02:00
Emmy D'Anello a763abf781
Add direct links to the opponent and reporter solutions
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-04-03 23:14:59 +02:00
Emmy D'Anello 78e8a92c3a
Fix solution link
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-04-03 23:06:11 +02:00
3 changed files with 300 additions and 277 deletions

File diff suppressed because it is too large Load Diff

View File

@ -710,7 +710,7 @@ class Participation(models.Model):
'content': content,
})
if timezone.now() <= self.tournament.solution_limit + timedelta(hours=4):
if timezone.now() <= self.tournament.solution_limit + timedelta(hours=2):
text = _("<p>The solutions for the tournament of {tournament} are due on the {date:%Y-%m-%d %H:%M}.</p>"
"<p>You have currently sent <strong>{nb_solutions}</strong> solutions. "
"We suggest to send at least <strong>{min_solutions}</strong> different solutions.</p>"
@ -725,7 +725,7 @@ class Participation(models.Model):
'priority': 1,
'content': content,
})
elif timezone.now() <= self.tournament.solutions_draw + timedelta(hours=4):
elif timezone.now() <= self.tournament.solutions_draw + timedelta(hours=2):
text = _("<p>The draw of the solutions for the tournament {tournament} is planned on the "
"{date:%Y-%m-%d %H:%M}. You can join it on <a href='{url}'>this link</a>.</p>")
url = reverse_lazy("draw:index")
@ -737,41 +737,52 @@ class Participation(models.Model):
'priority': 1,
'content': content,
})
elif timezone.now() <= self.tournament.syntheses_first_phase_limit + timedelta(hours=4):
elif timezone.now() <= self.tournament.syntheses_first_phase_limit + timedelta(hours=2):
pool = self.pools.get(round=1, tournament=self.tournament)
defender_passage = pool.passages.get(defender=self)
opponent_passage = pool.passages.get(opponent=self)
reporter_passage = pool.passages.get(reporter=self)
defender_text = _("<p>The solutions draw is ended. You can check the result on "
"<a href={draw_url}>this page</a>.</p>"
"<a href='{draw_url}'>this page</a>.</p>"
"<p>For the first round, you will defend "
"<a href='{solution_url}'>your solution of the problem {problem}</a>.</p>")
draw_url = reverse_lazy("draw:index")
solution_url = reverse_lazy("solution", args=(defender_passage.defended_solution.pk,))
solution_url = defender_passage.defended_solution.file.url
defender_content = format_lazy(defender_text, draw_url=draw_url,
solution_url=solution_url, problem=defender_passage.solution_number)
opponent_text = _("<p>You will oppose the solution of the team {opponent} on the problem {problem}. "
opponent_text = _("<p>You will oppose the solution of the team {opponent} on the "
"<a href='{solution_url}'>problem {problem}</a>. "
"You can upload your synthesis sheet on <a href='{passage_url}'>this page</a>.</p>")
solution_url = opponent_passage.defended_solution.file.url
passage_url = reverse_lazy("participation:passage_detail", args=(opponent_passage.pk,))
opponent_content = format_lazy(opponent_text, opponent=opponent_passage.defender.team.trigram,
solution_url=solution_url,
problem=opponent_passage.solution_number, passage_url=passage_url)
reporter_text = _("<p>You will report the solution of the team {reporter} on the problem {problem}. "
reporter_text = _("<p>You will report the solution of the team {reporter} on the "
"<a href='{solution_url}'>problem {problem}. "
"You can upload your synthesis sheet on <a href='{passage_url}'>this page</a>.</p>")
solution_url = reporter_passage.defended_solution.file.url
passage_url = reverse_lazy("participation:passage_detail", args=(reporter_passage.pk,))
reporter_content = format_lazy(reporter_text, reporter=reporter_passage.defender.team.trigram,
solution_url=solution_url,
problem=reporter_passage.solution_number, passage_url=passage_url)
content = defender_content + opponent_content + reporter_content
syntheses_template_begin = f"{settings.STATIC_URL}Fiche_synthèse."
syntheses_templates = "".join(f"<a href='{syntheses_template_begin}{ext}'>{ext.upper()}</a>"
for ext in ["pdf", "tex", "odt", "docx"])
syntheses_templates_content = f"<p>{_('Templates:')} {syntheses_templates}</p>"
content = defender_content + opponent_content + reporter_content + syntheses_templates_content
informations.append({
'title': _("First round"),
'type': "info",
'priority': 1,
'content': content,
})
elif timezone.now() <= self.tournament.syntheses_second_phase_limit + timedelta(hours=4):
elif timezone.now() <= self.tournament.syntheses_second_phase_limit + timedelta(hours=2):
pool = self.pools.get(round=2, tournament=self.tournament)
defender_passage = pool.passages.get(defender=self)
opponent_passage = pool.passages.get(opponent=self)
@ -780,23 +791,34 @@ class Participation(models.Model):
defender_text = _("<p>For the second round, you will defend "
"<a href='{solution_url}'>your solution of the problem {problem}</a>.</p>")
draw_url = reverse_lazy("draw:index")
solution_url = reverse_lazy("solution", args=(defender_passage.defended_solution.pk,))
solution_url = defender_passage.defended_solution.file.url
defender_content = format_lazy(defender_text, draw_url=draw_url,
solution_url=solution_url, problem=defender_passage.solution_number)
opponent_text = _("<p>You will oppose the solution of the team {opponent} on the problem {problem}. "
opponent_text = _("<p>You will oppose the solution of the team {opponent} on the "
"<a href='{solution_url}'>problem {problem}</a>. "
"You can upload your synthesis sheet on <a href='{passage_url}'>this page</a>.</p>")
solution_url = opponent_passage.defended_solution.file.url
passage_url = reverse_lazy("participation:passage_detail", args=(opponent_passage.pk,))
opponent_content = format_lazy(opponent_text, opponent=opponent_passage.defender.team.trigram,
solution_url=solution_url,
problem=opponent_passage.solution_number, passage_url=passage_url)
reporter_text = _("<p>You will report the solution of the team {reporter} on the problem {problem}. "
reporter_text = _("<p>You will report the solution of the team {reporter} on the "
"<a href='{solution_url}'>problem {problem}. "
"You can upload your synthesis sheet on <a href='{passage_url}'>this page</a>.</p>")
solution_url = reporter_passage.defended_solution.file.url
passage_url = reverse_lazy("participation:passage_detail", args=(reporter_passage.pk,))
reporter_content = format_lazy(reporter_text, reporter=reporter_passage.defender.team.trigram,
solution_url=solution_url,
problem=reporter_passage.solution_number, passage_url=passage_url)
content = defender_content + opponent_content + reporter_content
syntheses_template_begin = f"{settings.STATIC_URL}Fiche_synthèse."
syntheses_templates = "".join(f"<a href='{syntheses_template_begin}{ext}'>{ext.upper()}</a>"
for ext in ["pdf", "tex", "odt", "docx"])
syntheses_templates_content = f"<p>{_('Templates:')} {syntheses_templates}</p>"
content = defender_content + opponent_content + reporter_content + syntheses_templates_content
informations.append({
'title': _("Second round"),
'type': "info",

View File

@ -528,6 +528,7 @@ class VolunteerRegistration(Registration):
'content': content,
})
for tournament in self.interesting_tournaments:
pools = tournament.pools.filter(juries=self).order_by('round').all()
for pool in pools:
if pool.round == 1 and timezone.now().date() <= tournament.date_start: