From 8bdecc3afb54b410fd1e2e1058da329273478b11 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Mon, 27 May 2024 21:13:34 +0200 Subject: [PATCH] add a hide teams weight bool --- .../0057_tournament_hide_teams_weight.py | 18 ++++++++++++++++++ tournaments/models/tournament.py | 1 + .../templates/tournaments/team_row.html | 5 ++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tournaments/migrations/0057_tournament_hide_teams_weight.py diff --git a/tournaments/migrations/0057_tournament_hide_teams_weight.py b/tournaments/migrations/0057_tournament_hide_teams_weight.py new file mode 100644 index 0000000..1b81ccf --- /dev/null +++ b/tournaments/migrations/0057_tournament_hide_teams_weight.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.11 on 2024-05-26 16:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tournaments', '0056_tournament_should_verify_bracket_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='tournament', + name='hide_teams_weight', + field=models.BooleanField(default=False), + ), + ] diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 3529a00..b5c3b6e 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -48,6 +48,7 @@ class Tournament(models.Model): local_id = models.CharField(max_length=100, null=True, blank=True) #represent the is_canceled crypted string additional_estimation_duration = models.IntegerField(default=0) publish_teams = models.BooleanField(default=False) + hide_teams_weight = models.BooleanField(default=False) publish_summons = models.BooleanField(default=False) publish_group_stages = models.BooleanField(default=False) publish_brackets = models.BooleanField(default=False) diff --git a/tournaments/templates/tournaments/team_row.html b/tournaments/templates/tournaments/team_row.html index d68f632..a084287 100644 --- a/tournaments/templates/tournaments/team_row.html +++ b/tournaments/templates/tournaments/team_row.html @@ -7,7 +7,10 @@
{{ name }}
{% endfor %} - + {% if hide_teams_weight %} +
+ {% else %}
{{ team.weight }}
+ {% endif %}
{{ team.stage }}