Various UI and graphic improvements

clubs
Laurent 1 year ago
parent bfcf3500ad
commit 4e56b71292
  1. 2
      tournaments/models/group_stage.py
  2. 17
      tournaments/models/match.py
  3. 9
      tournaments/models/player_registration.py
  4. 6
      tournaments/models/team_registration.py
  5. 6
      tournaments/models/team_score.py
  6. 9
      tournaments/models/tournament.py
  7. 10
      tournaments/static/tournaments/css/style.css
  8. 2
      tournaments/templates/tournaments/broadcast/broadcast.html
  9. 8
      tournaments/templates/tournaments/broadcast/broadcast_club.html
  10. 2
      tournaments/templates/tournaments/download.html
  11. 13
      tournaments/templates/tournaments/match_cell.html
  12. 2
      tournaments/templates/tournaments/team_row.html

@ -137,7 +137,7 @@ class LiveGroupStage:
class GroupStageTeam:
def __init__(self, team_registration):
self.names = team_registration.team_names()
self.names = team_registration.shortened_team_names()
if team_registration.group_stage_position:
self.position = team_registration.group_stage_position
else:

@ -121,14 +121,14 @@ class Match(models.Model):
return games
def current_duration(self):
if self.start_date:
if self.confirmed and self.start_date:
if self.end_date:
return (self.end_date - self.start_date).total_seconds()
else:
current = (timezone.now() - self.start_date).total_seconds()
if self.total_number_of_games() > 0 and current < self.average_seconds_duration() * 4:
return current
elif self.total_number_of_games() == 0 and current < 4 * 60 * 60:
elif self.total_number_of_games() == 0 and current < 3 * 60 * 60:
return current
else:
return None
@ -141,14 +141,14 @@ class Match(models.Model):
# return None
# return (timezone.now() - self.start_date).total_seconds()
else:
return 0
return None
def started(self):
if self.confirmed:
if self.end_date:
return True
elif self.start_date:
return timezone.now() > self.start_date
else:
return False
def should_appear(self):
@ -198,7 +198,7 @@ class Match(models.Model):
image = None
weight= None
is_winner = False
names = team_score.team_names()
names = team_score.shortened_team_names()
scores = team_score.scores_array()
walk_out = team_score.walk_out
team = Team(image, names, scores, weight, is_winner, walk_out)
@ -281,3 +281,10 @@ class LiveMatch:
if team.walk_out and len(team.scores) == 0:
return False
return True
def should_show_scores(self):
if self.started:
for team in self.teams:
if len(team.scores) > 0:
return True
return False

@ -39,3 +39,12 @@ class PlayerRegistration(models.Model):
def name(self):
return f"{self.first_name} {self.last_name}"
def shortened_name(self):
name = self.name()
if len(name) > 20 and self.first_name:
name = f"{self.first_name[0]}. {self.last_name}"
if len(name) > 20:
name_parts = self.last_name.split(" ")
name = f"{self.first_name[0]}. {name_parts[0]}"
return name

@ -43,6 +43,12 @@ class TeamRegistration(models.Model):
else:
return [pr.name() for pr in self.playerregistration_set.all()]
def shortened_team_names(self):
if self.name:
return [self.name]
else:
return [pr.shortened_name() for pr in self.playerregistration_set.all()]
def player_names(self):
names = [pr.name() for pr in self.playerregistration_set.all()]
str = " - ".join(names)

@ -23,6 +23,12 @@ class TeamScore(models.Model):
else:
return "--"
def shortened_team_names(self):
names = []
if self.team_registration:
names = self.team_registration.shortened_team_names()
return names
def team_names(self):
names = []
if self.team_registration:

@ -124,6 +124,15 @@ class Tournament(models.Model):
def in_progress(self):
return self.end_date is None
def creator(self):
return self.event.creator.username
def private_label(self):
if self.is_private:
return "Privé"
else:
return "Public"
def summon_count_display(self):
teams = self.team_summons()
if teams is not None and len(teams) > 0:

@ -108,6 +108,10 @@ tr {
/* height: 40px; */
}
.numbers {
font-feature-settings: "tnum";
}
.orange {
color: #f39200;
}
@ -250,7 +254,7 @@ tr {
.score {
display: inline-block;
font-size: 1.4em;
font-size: 1.3em;
vertical-align: middle;
text-align: center;
padding: 0px 5px;
@ -494,9 +498,9 @@ h-margin {
padding: 5px 0px;
}
.table-row-4-colums-club-tournament {
.table-row-6-colums-club-tournament {
display: grid;
grid-template-columns: 100px 100px 1fr auto;
grid-template-columns: 100px 80px 100px 80px 1fr auto;
align-items: center;
/* Vertically center the content within each column */
padding: 5px 0px;

@ -11,7 +11,7 @@
<div class="grid-x">
<div class="cell medium-6 large-6 topblock my-block">
<div class="bubble">
<div><a href="{% url 'automatic-broadcast' tournament.id %}">Automatic</a></div>
<div><a href="{% url 'automatic-broadcast' tournament.id %}">Automatique</a></div>
<div><a href="{% url 'broadcasted-matches' tournament.id %}">Matchs</a></div>
<div><a href="{% url 'broadcasted-group-stages' tournament.id %}">Poules</a></div>
<div><a href="{% url 'broadcasted-summons' tournament.id %}">Convocations</a></div>

@ -13,13 +13,19 @@
{% for tournament in tournaments %}
<div class="table-row-4-colums-club-tournament">
<div class="table-row-6-colums-club-tournament">
<div class="table-cell mybox center">{{ tournament.formatted_start_date }}</div>
<div class="tight table-cell">
<div class="large">{{ tournament.level }}</div>
<div class="small">{{ tournament.category }}</div>
</div>
<div class="tight table-cell">
<span>{{ tournament.creator }}</span>
</div>
<div class="tight table-cell">
<span>{{ tournament.private_label }}</span>
</div>
<div class="table-cell">
<span><a href="{% url 'automatic-broadcast' tournament.id %}">Automatic</a></span> |
<span><a href="{% url 'broadcasted-matches' tournament.id %}">Matchs</a></span> |

@ -60,7 +60,7 @@
<span class="orange">Organisez vos tournois comme les pros</span> et accueillez les joueurs et le public comme dans les plus grands événements
</h3>
<p id="main">
<span class="bold">PadelClub est une application de gestion de tournois destinée aux juges-arbitres, clubs et passionnés</span> qui souhaitent organiser aisément des tournois homologués ou amicaux. Gérez vos tournois de A à Z : des inscriptions jusqu’aux résultats finaux et retrouvez tous les résultats des matchs en temps réel.
<span class="bold">Padel Club est une application de gestion de tournois destinée aux juges-arbitres, clubs et passionnés</span> qui souhaitent organiser aisément des tournois homologués ou amicaux. Gérez vos tournois de A à Z : des inscriptions jusqu’aux résultats finaux et retrouvez tous les résultats des matchs en ligne.
</p>
</div>
<div class="cell large-6 topblock center">

@ -21,23 +21,18 @@
{% endfor %}
</div>
{% if match.started %}
{% if match.should_show_scores %}
<div class="scores">
{% if team.scores %}
{% for score in team.scores %}
<span class="score ws w30px{% if team.is_winner %} winner{% endif %}">{{ score }}</span>
{% endfor %}
{% else %}
<span class="score ws">{{ team.weight }}</span>
{% endif %}
{% if match.has_walk_out %}
</div>
{% elif match.has_walk_out %}
<span class="score ws w60px">
{% if team.walk_out %}WO{% endif %}
</span>
{% endif %}
</div>
{% elif not tournament.hide_weight %}
<span class="score ws">{{ team.weight }}</span>
<span class="score ws numbers">{{ team.weight }}</span>
{% endif %}
</div>

@ -12,7 +12,7 @@
{% elif tournament.hide_weight %}
<div class="table-cell right horizontal-padding"></div>
{% else %}
<div class="table-cell right horizontal-padding large">{{ team.weight }}</div>
<div class="table-cell right horizontal-padding large numbers">{{ team.weight }}</div>
{% endif %}
<div class="table-cell "><div class="mybox center">{{ team.stage }}</div></div>
</div>

Loading…
Cancel
Save