mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-23 00:38:25 +02:00
Compare commits
6 Commits
424dee4aea
...
923b07b97e
Author | SHA1 | Date | |
---|---|---|---|
923b07b97e
|
|||
84860a2875
|
|||
6add9a1419
|
|||
eddb741eb7
|
|||
a763abf781
|
|||
78e8a92c3a
|
File diff suppressed because it is too large
Load Diff
@ -710,7 +710,7 @@ class Participation(models.Model):
|
|||||||
'content': content,
|
'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>"
|
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. "
|
"<p>You have currently sent <strong>{nb_solutions}</strong> solutions. "
|
||||||
"We suggest to send at least <strong>{min_solutions}</strong> different solutions.</p>"
|
"We suggest to send at least <strong>{min_solutions}</strong> different solutions.</p>"
|
||||||
@ -725,7 +725,7 @@ class Participation(models.Model):
|
|||||||
'priority': 1,
|
'priority': 1,
|
||||||
'content': content,
|
'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 "
|
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>")
|
"{date:%Y-%m-%d %H:%M}. You can join it on <a href='{url}'>this link</a>.</p>")
|
||||||
url = reverse_lazy("draw:index")
|
url = reverse_lazy("draw:index")
|
||||||
@ -737,41 +737,52 @@ class Participation(models.Model):
|
|||||||
'priority': 1,
|
'priority': 1,
|
||||||
'content': content,
|
'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)
|
pool = self.pools.get(round=1, tournament=self.tournament)
|
||||||
defender_passage = pool.passages.get(defender=self)
|
defender_passage = pool.passages.get(defender=self)
|
||||||
opponent_passage = pool.passages.get(opponent=self)
|
opponent_passage = pool.passages.get(opponent=self)
|
||||||
reporter_passage = pool.passages.get(reporter=self)
|
reporter_passage = pool.passages.get(reporter=self)
|
||||||
|
|
||||||
defender_text = _("<p>The solutions draw is ended. You can check the result on "
|
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 "
|
"<p>For the first round, you will defend "
|
||||||
"<a href='{solution_url}'>your solution of the problem {problem}</a>.</p>")
|
"<a href='{solution_url}'>your solution of the problem {problem}</a>.</p>")
|
||||||
draw_url = reverse_lazy("draw:index")
|
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,
|
defender_content = format_lazy(defender_text, draw_url=draw_url,
|
||||||
solution_url=solution_url, problem=defender_passage.solution_number)
|
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>")
|
"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,))
|
passage_url = reverse_lazy("participation:passage_detail", args=(opponent_passage.pk,))
|
||||||
opponent_content = format_lazy(opponent_text, opponent=opponent_passage.defender.team.trigram,
|
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)
|
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>")
|
"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,))
|
passage_url = reverse_lazy("participation:passage_detail", args=(reporter_passage.pk,))
|
||||||
reporter_content = format_lazy(reporter_text, reporter=reporter_passage.defender.team.trigram,
|
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)
|
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({
|
informations.append({
|
||||||
'title': _("First round"),
|
'title': _("First round"),
|
||||||
'type': "info",
|
'type': "info",
|
||||||
'priority': 1,
|
'priority': 1,
|
||||||
'content': content,
|
'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)
|
pool = self.pools.get(round=2, tournament=self.tournament)
|
||||||
defender_passage = pool.passages.get(defender=self)
|
defender_passage = pool.passages.get(defender=self)
|
||||||
opponent_passage = pool.passages.get(opponent=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 "
|
defender_text = _("<p>For the second round, you will defend "
|
||||||
"<a href='{solution_url}'>your solution of the problem {problem}</a>.</p>")
|
"<a href='{solution_url}'>your solution of the problem {problem}</a>.</p>")
|
||||||
draw_url = reverse_lazy("draw:index")
|
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,
|
defender_content = format_lazy(defender_text, draw_url=draw_url,
|
||||||
solution_url=solution_url, problem=defender_passage.solution_number)
|
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>")
|
"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,))
|
passage_url = reverse_lazy("participation:passage_detail", args=(opponent_passage.pk,))
|
||||||
opponent_content = format_lazy(opponent_text, opponent=opponent_passage.defender.team.trigram,
|
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)
|
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>")
|
"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,))
|
passage_url = reverse_lazy("participation:passage_detail", args=(reporter_passage.pk,))
|
||||||
reporter_content = format_lazy(reporter_text, reporter=reporter_passage.defender.team.trigram,
|
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)
|
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({
|
informations.append({
|
||||||
'title': _("Second round"),
|
'title': _("Second round"),
|
||||||
'type': "info",
|
'type': "info",
|
||||||
|
@ -528,6 +528,7 @@ class VolunteerRegistration(Registration):
|
|||||||
'content': content,
|
'content': content,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
for tournament in self.interesting_tournaments:
|
||||||
pools = tournament.pools.filter(juries=self).order_by('round').all()
|
pools = tournament.pools.filter(juries=self).order_by('round').all()
|
||||||
for pool in pools:
|
for pool in pools:
|
||||||
if pool.round == 1 and timezone.now().date() <= tournament.date_start:
|
if pool.round == 1 and timezone.now().date() <= tournament.date_start:
|
||||||
|
Reference in New Issue
Block a user