mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 18:17:28 +02:00
More ETEAM parametrization
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -966,7 +966,7 @@ class Participation(models.Model):
|
||||
reviews_template_begin = f"{settings.STATIC_URL}eteam/Written_review."
|
||||
reviews_templates = " — ".join(f"<a href='{reviews_template_begin}{ext}'>{ext.upper()}</a>"
|
||||
for ext in ["pdf", "tex"])
|
||||
reviews_templates_content = "<p>" + _('Templates:') + " {reviews_templates}</p>"
|
||||
reviews_templates_content = "<p>" + _('Templates:') + f" {reviews_templates}</p>"
|
||||
|
||||
content = reporter_content + opponent_content + reviewer_content + observer_content \
|
||||
+ reviews_templates_content
|
||||
@ -1039,7 +1039,7 @@ class Participation(models.Model):
|
||||
'priority': 1,
|
||||
'content': content,
|
||||
})
|
||||
elif settings.TFJM_APP == "ETEAM" \
|
||||
elif settings.NB_ROUNDS >= 3 \
|
||||
and timezone.now() <= tournament.reviews_third_phase_limit + timedelta(hours=2):
|
||||
reporter_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=3, reporter=self)
|
||||
opponent_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=3, opponent=self)
|
||||
@ -1230,7 +1230,7 @@ class Pool(models.Model):
|
||||
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
|
||||
|
||||
pool_size = self.participations.count()
|
||||
has_observer = settings.TFJM_APP == "ETEAM" and pool_size >= 4
|
||||
has_observer = settings.HAS_OBSERVER and pool_size >= 4
|
||||
passage_width = 6 + (2 if has_observer else 0)
|
||||
passages = self.passages.all()
|
||||
|
||||
@ -1638,7 +1638,7 @@ class Pool(models.Model):
|
||||
if not data or not data[0]:
|
||||
return
|
||||
|
||||
has_observer = settings.TFJM_APP == "ETEAM" and self.participations.count() >= 4
|
||||
has_observer = settings.HAS_OBSERVER and self.participations.count() >= 4
|
||||
passage_width = 6 + (2 if has_observer else 0)
|
||||
for line in data:
|
||||
jury_name = line[0]
|
||||
|
@ -1259,7 +1259,7 @@ class PoolUploadNotesView(VolunteerMixin, FormView, DetailView):
|
||||
return self.form_invalid(form)
|
||||
|
||||
for vr, notes in parsed_notes.items():
|
||||
notes_count = 6 + (2 if pool.participations.count() >= 4 and settings.TFJM_APP == "ETEAM" else 0)
|
||||
notes_count = 6 + (2 if pool.participations.count() >= 4 and settings.HAS_OBSERVER else 0)
|
||||
for i, passage in enumerate(pool.passages.all()):
|
||||
note = Note.objects.get_or_create(jury=vr, passage=passage)[0]
|
||||
passage_notes = notes[notes_count * i:notes_count * (i + 1)]
|
||||
@ -1297,7 +1297,7 @@ class PoolNotesTemplateView(VolunteerMixin, DetailView):
|
||||
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
|
||||
|
||||
pool_size = self.object.passages.count()
|
||||
has_observer = self.object.participations.count() >= 4 and settings.TFJM_APP == "ETEAM"
|
||||
has_observer = self.object.participations.count() >= 4 and settings.HAS_OBSERVER
|
||||
passage_width = 6 + (2 if has_observer else 0)
|
||||
line_length = pool_size * passage_width
|
||||
|
||||
|
Reference in New Issue
Block a user