clubs
laurent 1 year ago
commit a57c2a2828
  1. 10
      tournaments/models/match.py
  2. 4
      tournaments/models/tournament.py
  3. 10
      tournaments/static/tournaments/css/style.css
  4. 10
      tournaments/templates/tournaments/navigation_tournament.html
  5. 2
      tournaments/templates/tournaments/ranking_row.html
  6. 4
      tournaments/templates/tournaments/rankings.html
  7. 3
      tournaments/templates/tournaments/summon_row.html
  8. 4
      tournaments/templates/tournaments/summons.html
  9. 4
      tournaments/templates/tournaments/teams.html

@ -44,6 +44,14 @@ class Match(models.Model):
items.append(f"Match #{self.index}")
return " ".join(items)
def summon_stage_name(self):
if self.round:
return self.round.name()
elif self.group_stage:
return "Poule"
else:
return '--'
def stage_name(self):
if self.name:
return self.name
@ -99,7 +107,7 @@ class Match(models.Model):
return False
def should_appear(self):
return self.start_date and len(self.team_scores.all()) > 0
return (self.start_date or self.end_date) and len(self.team_scores.all()) > 0
def formatted_duration(self):

@ -83,12 +83,12 @@ class Tournament(models.Model):
next_match = team_registration.next_match()
if next_match:
names = team_registration.team_names()
stage = next_match.stage_name()
stage = next_match.summon_stage_name()
weight = team_registration.weight
summon = TeamSummon(names, next_match.start_date, weight, stage, team_registration.logo)
summons.append(summon)
summons.sort(key=lambda s: s.weight)
summons.sort(key=lambda s: s.date)
return summons
def rankings(self):

@ -571,13 +571,21 @@ svg {
.table-row-3-colums-teams {
display: grid;
grid-template-columns: 1px auto 100px 100px;
grid-template-columns: 1px auto 50px 80px;
/* first column is a hack */
align-items: center;
/* Vertically center the content within each column */
padding: 5px 0px;
}
.table-row-3-colums-summons {
display: grid;
grid-template-columns: 1px auto 70px 70px;
/* first column is a hack */
align-items: center;
/* Vertically center the content within each column */
padding: 5px 0px;
}
@media print,
screen and (min-width: 80em) {
.table-row-4-colums {

@ -1,22 +1,22 @@
<nav class="margin10">
{% if tournament.display_matches %}
<a href="{% url 'tournament' tournament.id %}" class="mybox">Matches</a>
<a href="{% url 'tournament' tournament.id %}" class="mybox topmargin5">Matches</a>
{% endif %}
{% if tournament.display_group_stages %}
<a href="{% url 'group-stages' tournament.id %}" class="mybox">Poules</a>
<a href="{% url 'group-stages' tournament.id %}" class="mybox topmargin5">Poules</a>
{% endif %}
{% if tournament.display_summons %}
<a href="{% url 'tournament-summons' tournament.id %}" class="mybox">Convocations</a>
<a href="{% url 'tournament-summons' tournament.id %}" class="mybox topmargin5">Convocations</a>
{% endif %}
{% if tournament.display_teams %}
<a href="{% url 'tournament-teams' tournament.id %}" class="mybox">Équipes</a>
<a href="{% url 'tournament-teams' tournament.id %}" class="mybox topmargin5">Équipes</a>
{% endif %}
{% if tournament.display_rankings %}
<a href="{% url 'tournament-rankings' tournament.id %}" class="mybox">Classement</a>
<a href="{% url 'tournament-rankings' tournament.id %}" class="mybox topmargin5">Classement</a>
{% endif %}
</nav>

@ -1,6 +1,6 @@
{% load static %}
<div class="table-row-3-colums-teams bottom-border">
<div class="table-row-3-colums bottom-border">
<div class="table-cell table-cell-large semibold">
{% for name in ranking.names %}

@ -1,8 +1,8 @@
{% extends 'tournaments/base.html' %}
{% block head_title %}Classement{% endblock %}
{% block first_title %}{{ tournament.display_name }}{% endblock %}
{% block second_title %}Classement{% endblock %}
{% block first_title %}{{ tournament.event.display_name }}{% endblock %}
{% block second_title %}{{ tournament.display_name }}{% endblock %}
{% if tournament.display_rankings %}

@ -1,6 +1,6 @@
{% load static %}
<div class="table-row-4-colums bottom-border">
<div class="table-row-3-colums-summons bottom-border">
<div class="table-cell table-cell-large semibold">
{% for name in summon.names %}
@ -8,7 +8,6 @@
{% endfor %}
</div>
<div class="table-cell center">{{ summon.weight }}</div>
<div class="table-cell large center">{{ summon.date|date:'H:i' }}</div>
<div class="table-cell"><div class="mybox center">{{ summon.stage }}</div></div>
</div>

@ -1,8 +1,8 @@
{% extends 'tournaments/base.html' %}
{% block head_title %}Convocations{% endblock %}
{% block first_title %}{{ tournament.display_name }}{% endblock %}
{% block second_title %}Convocations{% endblock %}
{% block first_title %}{{ tournament.event.display_name }}{% endblock %}
{% block second_title %}{{ tournament.display_name }}{% endblock %}
{% if tournament.display_summons %}

@ -1,8 +1,8 @@
{% extends 'tournaments/base.html' %}
{% block head_title %}Équipes{% endblock %}
{% block first_title %}{{ tournament.display_name }}{% endblock %}
{% block second_title %}Équipes{% endblock %}
{% block first_title %}{{ tournament.event.display_name }}{% endblock %}
{% block second_title %}{{ tournament.display_name }}{% endblock %}
{% if tournament.display_teams %}

Loading…
Cancel
Save