add court name on summon page

tz
Raz 1 year ago
parent 08761d6902
commit bfc6bf143f
  1. 6
      tournaments/models/tournament.py
  2. 3
      tournaments/templates/tournaments/broadcast/broadcasted_summon.html
  3. 5
      tournaments/templates/tournaments/summon_row.html

@ -221,7 +221,7 @@ class Tournament(models.Model):
names = team_registration.team_names() names = team_registration.team_names()
stage = next_match.summon_stage_name() stage = next_match.summon_stage_name()
weight = team_registration.weight weight = team_registration.weight
summon = TeamSummon(names, next_match.start_date, weight, stage, team_registration.logo) summon = TeamSummon(names, next_match.start_date, weight, stage, next_match.court_name(next_match.court_index), team_registration.logo)
summons.append(summon) summons.append(summon)
summons.sort(key=lambda s: s.date) summons.sort(key=lambda s: s.date)
@ -727,11 +727,12 @@ class MatchGroup:
self.matches = matches self.matches = matches
class TeamSummon: class TeamSummon:
def __init__(self, names, date, weight, stage, image): def __init__(self, names, date, weight, stage, court, image):
self.names = names self.names = names
self.date = date self.date = date
self.weight = weight self.weight = weight
self.stage = stage self.stage = stage
self.court = court
self.image = image self.image = image
def formatted_date(self): def formatted_date(self):
@ -747,6 +748,7 @@ class TeamSummon:
"date": self.formatted_date(), "date": self.formatted_date(),
"weight": self.weight, "weight": self.weight,
"stage": self.stage, "stage": self.stage,
"court": self.court,
"image": self.image, "image": self.image,
} }

@ -13,7 +13,10 @@
{% else %} {% else %}
<div class="table-cell center numbers"><span x-text=""></span></div> <div class="table-cell center numbers"><span x-text=""></span></div>
{% endif %} {% endif %}
<div class="table-cell center">
<div class="table-cell large center"><span x-text="summon.date"></span></div> <div class="table-cell large center"><span x-text="summon.date"></span></div>
<div class="table-cell center"><span x-text="summon.court"></span></div>
</div>
<div class="table-cell right"><div class="mybox center"><span x-text="summon.stage"></span></div></div> <div class="table-cell right"><div class="mybox center"><span x-text="summon.stage"></span></div></div>
</div> </div>

@ -8,7 +8,10 @@
{% endfor %} {% endfor %}
</div> </div>
<div class="table-cell large center">{{ summon.date|date:'l H:i' }}</div> <div class="table-cell center">
<div class="table-cell large">{{ summon.date|date:'l H:i' }}</div>
<div class="table-cell">{{ summon.court }}</div>
</div>
<div class="table-cell"><div class="mybox center">{{ summon.stage }}</div></div> <div class="table-cell"><div class="mybox center">{{ summon.stage }}</div></div>
</div> </div>

Loading…
Cancel
Save