add walkout info

main
Razmig Sarkissian 2 years ago
parent ef55874f31
commit 65677db2a9
  1. 18
      scores/migrations/0020_match_haswalkoutteam.py
  2. 1
      scores/models.py
  3. 2
      scores/serializers.py
  4. 2
      scores/templates/scores/index.html
  5. 2
      scores/templates/scores/tournament.html

@ -0,0 +1,18 @@
# Generated by Django 4.2 on 2023-07-31 09:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scores', '0019_remove_team_match_team_tournament'),
]
operations = [
migrations.AddField(
model_name='match',
name='hasWalkOutTeam',
field=models.BooleanField(default=False),
),
]

@ -35,6 +35,7 @@ class Match(models.Model):
court = models.IntegerField(default=0)
match_index = models.IntegerField(default=0)
refreshrate = models.IntegerField(default=10)
hasWalkOutTeam = models.BooleanField(default=False)
title = models.CharField(max_length=200, blank=True)
team1 = models.CharField(max_length=200, blank=True)

@ -21,7 +21,7 @@ class TournamentSerializer(serializers.HyperlinkedModelSerializer):
class MatchSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Match
fields = ['id', 'court', 'match_index', 'tournament', 'date', 'enddate', 'title', 'refreshrate', 'team1', 'team2', 'team3', 'team4', 'team5',
fields = ['id', 'court', 'match_index', 'tournament', 'date', 'enddate', 'title', 'refreshrate', 'team1', 'team2', 'team3', 'team4', 'team5', 'hasWalkOutTeam',
'team1scorecolumn1', 'team1scorecolumn2', 'team1scorecolumn3', 'team1scorecolumn4', 'team1scorecolumn5',
'team2scorecolumn1', 'team2scorecolumn2', 'team2scorecolumn3', 'team2scorecolumn4', 'team2scorecolumn5']

@ -239,7 +239,7 @@
{% endif %}
{% if match.isMatch or match.isBracket %}
{% if not match.isStatistic and not match.hasWalkOutTeam %}
<p class="duration">
<div class="small"> {{ match.durationPrefix }}</div>
<div class="big">{{ match.duration }}</div>

@ -216,7 +216,7 @@
{% endif %}
{% if not match.isStatistic %}
{% if not match.isStatistic and not match.hasWalkOutTeam %}
<p class="duration">
<div class="small"> {{ match.durationPrefix }}</div>
<div class="big">{{ match.duration }}</div>

Loading…
Cancel
Save