udpate title stuff

clubs
Razmig Sarkissian 1 year ago
parent e6fef3d240
commit 189df37c4b
  1. 40
      tournaments/models/tournament.py
  2. 8
      tournaments/static/tournaments/css/style.css
  3. 2
      tournaments/templates/tournaments/rankings.html
  4. 4
      tournaments/templates/tournaments/summons.html
  5. 5
      tournaments/templates/tournaments/teams.html
  6. 15
      tournaments/templates/tournaments/tournament_row.html

@ -81,6 +81,46 @@ class Tournament(models.Model):
def in_progress(self): def in_progress(self):
return self.end_date is None return self.end_date is None
def summon_count_display(self):
teams = self.team_summons()
if teams is not None and len(teams) > 0:
return f"{len(teams)} équipes convoquées"
else:
return None
def ranking_count_display(self):
teams = self.rankings()
if teams is not None and len(teams) > 0:
return f"{len(teams)} équipes"
else:
return None
def registration_count_display(self):
teams = self.teams()
if teams is not None and len(teams) > 0:
return f"{len(teams)} équipes inscrites"
else:
return None
def team_count_display(self):
teams = self.teams()
if teams is not None and len(teams) > 0:
return f"{len(teams)} inscriptions"
else:
return None
def name_and_event(self):
event_name = self.event.name
if event_name and self.name:
return event_name + " : " + self.name
elif event_name:
return event_name
elif self.name:
return self.name
else:
return None
def team_summons(self): def team_summons(self):
summons = [] summons = []
for team_registration in self.teamregistration_set.all(): for team_registration in self.teamregistration_set.all():

@ -560,6 +560,14 @@ svg {
padding: 5px 0px; padding: 5px 0px;
} }
.table-row-4-colums-tournament {
display: grid;
grid-template-columns: auto 1fr auto auto;
align-items: center;
/* Vertically center the content within each column */
padding: 5px 0px;
}
.table-row-4-colums { .table-row-4-colums {
display: grid; display: grid;
grid-template-columns: 1px auto 50px 70px 100px; grid-template-columns: 1px auto 50px 70px 100px;

@ -18,6 +18,8 @@
<div class="cell medium-6 large-6 my-block"> <div class="cell medium-6 large-6 my-block">
<div class="bubble"> <div class="bubble">
<label class="title">{{ tournament.ranking_count_display }}</label>
{% for ranking in rankings %} {% for ranking in rankings %}
{% include 'tournaments/ranking_row.html' %} {% include 'tournaments/ranking_row.html' %}

@ -18,6 +18,10 @@
<div class="cell medium-6 large-6 my-block"> <div class="cell medium-6 large-6 my-block">
<div class="bubble"> <div class="bubble">
{% if tournament.summon_count_display %}
<label class="title">{{ tournament.summon_count_display }}</label>
{% endif %}
{% for summon in team_summons %} {% for summon in team_summons %}
{% include 'tournaments/summon_row.html' %} {% include 'tournaments/summon_row.html' %}

@ -18,6 +18,11 @@
<div class="cell medium-6 large-6 my-block"> <div class="cell medium-6 large-6 my-block">
<div class="bubble"> <div class="bubble">
{% if tournament.registration_count_display %}
<label class="title">{{ tournament.registration_count_display }}</label>
{% endif %}
{% for team in teams %} {% for team in teams %}
{% include 'tournaments/team_row.html' %} {% include 'tournaments/team_row.html' %}

@ -1,17 +1,20 @@
<a href="{% url 'tournament' tournament.id %}"> <a href="{% url 'tournament' tournament.id %}">
<div class="table-row-3-colums bottom-border vertical-padding"> <div class="table-row-4-colums-tournament bottom-border vertical-padding">
<div class="tight table-cell"> <div class="tight table-cell">
<div class="large">{{ tournament.level }}</div> <div class="large">{{ tournament.level }}</div>
<div class="small">{{ tournament.category }}</div> <div class="small">{{ tournament.category }}</div>
</div> </div>
<div class="table-cell table-cell-large horizontal-padding semibold"> <div class="table-cell table-cell-large horizontal-padding semibold">
{% if tournament.name %} <div><span>{{ tournament.event.club.name }}</span></div>
<div><span>{{ tournament.event.display_long_name }}</span></div> {% if tournament.name_and_event %}
<div><span>{{ tournament.name }}</span></div> <div>
{% else %} <span>{{ tournament.name_and_event }}</span>
<span>{{ tournament.event.club.name }}</span> </div>
{% endif %} {% endif %}
</div> </div>
{% if tournament.team_count_display %}
<div class="table-cell center horizontal-padding">{{ tournament.team_count_display }}</div>
{% endif %}
<div class="table-cell"><div class="mybox">{{ tournament.formatted_start_date }}</div></div> <div class="table-cell"><div class="mybox">{{ tournament.formatted_start_date }}</div></div>
</div> </div>
</a> </a>

Loading…
Cancel
Save