fix nav in team details and wc stuff

sync
Raz 8 months ago
parent 8d8fa1a7d3
commit 50d8740260
  1. 6
      tournaments/models/group_stage.py
  2. 14
      tournaments/models/team_registration.py
  3. 5
      tournaments/models/team_score.py
  4. 6
      tournaments/models/tournament.py
  5. 2
      tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html
  6. 6
      tournaments/templates/tournaments/group_stage_cell.html
  7. 4
      tournaments/templates/tournaments/match_cell.html
  8. 3
      tournaments/templates/tournaments/team_details.html
  9. 4
      tournaments/templates/tournaments/team_row.html

@ -199,7 +199,11 @@ class GroupStageTeam:
self.set_diff = 0
self.game_diff = 0
self.display_set_difference = False
self.weight = team_registration.weight
if team_registration.playerregistration_set.count() == 0:
weight = None
else:
weight = team_registration.weight
self.weight = weight
self.team_registration = team_registration
self.qualified = team_registration.qualified

@ -58,7 +58,12 @@ class TeamRegistration(models.Model):
else:
players = list(self.playerregistration_set.all())
if len(players) == 0:
return []
if self.wild_card_bracket:
return ['Place réservée wildcard']
elif self.wild_card_group_stage:
return ['Place réservée wildcard']
else:
return ['Place réservée']
elif len(players) == 1:
return [players[0].shortened_name()]
else:
@ -270,3 +275,10 @@ class TeamRegistration(models.Model):
if p.registered_online:
return True
return False
def formatted_special_status(self):
if self.wild_card_bracket:
return "(wildcard tableau)"
if self.wild_card_group_stage:
return "(wildcard poule)"
return ""

@ -87,8 +87,11 @@ class TeamScore(models.Model):
if self.team_registration:
id = self.team_registration.id
image = self.team_registration.logo
weight = self.team_registration.weight
is_winner = self.team_registration.id == match.winning_team_id
if self.team_registration.playerregistration_set.count() == 0:
weight = None
else:
weight = self.team_registration.weight
else:
id = None
image = None

@ -1437,7 +1437,11 @@ class TeamItem:
self.names = team_registration.team_names()
self.date = team_registration.local_call_date()
self.registration_date = team_registration.registration_date
self.weight = team_registration.weight
if team_registration.playerregistration_set.count() == 0:
weight = None
else:
weight = team_registration.weight
self.weight = weight
self.initial_weight = team_registration.initial_weight()
self.image = team_registration.logo
self.stage = ""

@ -34,7 +34,7 @@
<div class="flex-right">
<div x-show="group_stage.started === false">
<div class="score ws numbers" x-show="hide_weight === false">
<div class="score ws numbers" x-show="hide_weight === false && group_stage.teams[i-1].weight">
<span x-text="group_stage.teams[i-1].weight"></span>
</div>
</div>

@ -14,7 +14,7 @@
<div class="flex {% if team.qualified %}qualified{% endif %}">
<div class="flex-left player {% if team.names|length == 1 %}single-player{% else %}two-players{% endif %}">
{% if team.team_registration.id %}
{% if team.team_registration.id and team.weight %}
<a href="{% url 'team-details' tournament.id team.team_registration.id %}" class="group-stage-link"> <!-- Add this anchor tag -->
{% endif %}
@ -24,7 +24,7 @@
</div>
{% endfor %}
{% if team.team_registration.id %}
{% if team.team_registration.id and team.weight %}
</a>
{% endif %}
@ -36,7 +36,7 @@
{% else %}
{% if tournament.hide_weight %}
<div class="score ws"></div>
{% else %}
{% elif team.weight %}
<div class="score ws numbers">{{ team.weight }}</div>
{% endif %}
{% endif %}

@ -15,7 +15,7 @@
{% for team in match.teams %}
<div class="match-result {% cycle 'bottom-border' '' %}">
<div class="player {% if team.names|length == 1 %}single-player{% else %}two-players{% endif %}">
{% if team.id %}
{% if team.id and team.weight %}
<a href="{% url 'team-details' tournament.id team.id %}" class="player-link">
{% endif %}
@ -30,7 +30,7 @@
{{ name }}
</div>
{% endfor %}
{% if team.id %}
{% if team.id and team.weight %}
</a>
{% endif %}
</div>

@ -5,6 +5,7 @@
{% block second_title %}{{ tournament.display_name }}{% endblock %}
{% block content %}
{% include 'tournaments/navigation_tournament.html' %}
<div class="grid-x grid-margin-x">
<style>
.bubble {
@ -12,7 +13,7 @@
}
</style>
<div class="cell medium-12">
<h1 class="club my-block topmargin20">{{ team.formatted_team_names }}</h1>
<h1 class="club my-block topmargin20">{{ team.formatted_team_names }} {{team.formatted_special_status}}</h1>
<div class="grid-x">
{% for player in team.playerregistration_set.all %}
{% include 'tournaments/player_row.html' with player=player %}

@ -30,9 +30,9 @@
<div class="table-cell right horizontal-padding"></div>
{% elif tournament.hide_weight %}
<div class="table-cell right horizontal-padding"></div>
{% elif not team.wildcard_bracket and not team.wildcard_groupstage %}
{% elif not team.wildcard_bracket and not team.wildcard_groupstage and team.weight %}
<div class="table-cell right horizontal-padding large numbers">{{ team.weight }}</div>
{% elif team.names %}
{% elif team.names and team.weight %}
<div class="table-cell right horizontal-padding large numbers">{{ team.weight }}</div>
{% else %}
<div class="table-cell right horizontal-padding large numbers"></div>

Loading…
Cancel
Save