Laurent 2 years ago
parent 71b359e559
commit b8f9f4edf7
  1. 9
      padelclub_backend/settings.py
  2. 2
      tournaments/models/match.py
  3. 2
      tournaments/models/tournament.py
  4. 2
      tournaments/static/tournaments/css/style.css
  5. 10
      tournaments/templates/tournaments/broadcasted_matches.html

@ -109,10 +109,10 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/ # https://docs.djangoproject.com/en/4.1/topics/i18n/
LANGUAGES = [ # LANGUAGES = [
('fr', 'French'), # ('fr', 'French'),
('en', 'English'), # ('en', 'English'),
] # ]
LANGUAGE_CODE = 'fr' LANGUAGE_CODE = 'fr'
@ -122,6 +122,7 @@ USE_I18N = True
USE_TZ = True USE_TZ = True
USE_L10N = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/ # https://docs.djangoproject.com/en/4.1/howto/static-files/

@ -106,7 +106,7 @@ class Match(models.Model):
# return (timezone.now() - self.start_date).total_seconds() # return (timezone.now() - self.start_date).total_seconds()
def live_match(self): def live_match(self):
title = self.name title = self.name if self.name else self.backup_name()
date = self.formatted_start_date() date = self.formatted_start_date()
duration = self.time_indication() duration = self.time_indication()
court = "" court = ""

@ -76,7 +76,7 @@ class Tournament(models.Model):
matches.append(match) matches.append(match)
matches = [m for m in matches if m.broadcasted==True] matches = [m for m in matches if m.broadcasted==True]
matches = [m for m in matches if len(m.team_scores.all()) > 0] # matches = [m for m in matches if len(m.team_scores.all()) > 0]
matches.sort(key=lambda m: m.order) matches.sort(key=lambda m: m.order)
return map(lambda match: match.live_match(), matches) return map(lambda match: match.live_match(), matches)

@ -351,7 +351,7 @@ tr {
.flex-row { .flex-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
/* height: 29px; */ height: 29px;
align-items: center; align-items: center;
/* vertical-align: middle; */ /* vertical-align: middle; */
} }

@ -37,7 +37,7 @@
setInterval(() => { setInterval(() => {
this.retrieveMatches() this.retrieveMatches()
this.active = this.active === this.paginatedMatches.length ? 1 : this.active+1 this.active = this.active === this.paginatedMatches.length ? 1 : this.active+1
}, 30000) }, 15000)
} }
}" x-init="loop()"> }" x-init="loop()">
@ -78,15 +78,15 @@
<template x-for="i in match.teams.length"> <template x-for="i in match.teams.length">
<div> <div>
<div class="table-row-3-colums padding-bottom-small"> <div class="table-row-3-colums team-names-box padding-bottom-small">
<template x-if="match.teams[i-1].image"> <!-- <template x-if="match.teams[i-1].image">
<div class="table-cell"> <div class="table-cell">
<img src="{% static 'tournaments/images/pc_icon_round_200.png' %}" class="team_image" /> <img src="{% static 'tournaments/images/pc_icon_round_200.png' %}" class="team_image" />
</div> </div>
</template> </template> -->
<div class="table-cell table-cell-large horizontal-padding"> <div class="table-cell table-cell-large">
<template x-for="name in match.teams[i-1].names"> <template x-for="name in match.teams[i-1].names">
<div class="semibold" x-data="{ <div class="semibold" x-data="{

Loading…
Cancel
Save