diff --git a/scores/models.py b/scores/models.py index 2093db2..ce3bec9 100644 --- a/scores/models.py +++ b/scores/models.py @@ -46,6 +46,27 @@ class Match(models.Model): team2scorecolumn4 = models.CharField(max_length=200, blank=True) team2scorecolumn5 = models.CharField(max_length=200, blank=True) + def poule(self): + return self.court / 100 + + def isMatch(self): + if self.court < 100 and self.court > 0: + return True + else : + return False + + def isBracket(self): + if self.court >= 100 and self.court < 1000: + return True + else : + return False + + def isStatistic(self): + if self.court >= 1000: + return True + else : + return False + def durationPrefix(self): _seconds = 0 diff --git a/scores/static/scores/style.css b/scores/static/scores/style.css index 74be8a1..e280712 100644 --- a/scores/static/scores/style.css +++ b/scores/static/scores/style.css @@ -93,6 +93,12 @@ td { margin: 0 auto; } +.bigcenter { + text-align: center; + font-size: 400%; + margin: 0 auto; +} + .match { /* display: inline-block; */ display:inline-block; diff --git a/scores/templates/scores/index.html b/scores/templates/scores/index.html index bfcc549..eaa879d 100644 --- a/scores/templates/scores/index.html +++ b/scores/templates/scores/index.html @@ -22,15 +22,35 @@ {% for match in live_matches %}
-

TERRAIN #{{ match.court }}

- -

{{ match.title }}

- - - +
+
+

{{ match.title }}

+
+ {% if match.isMatch or match.isBracket %} + {% if match.isMatch %} +
+

TERRAIN #{{ match.court }}

+

+ {% else %} +
+

POULE #{{ match.poule|floatformat:0 }}

+

+ {% endif %} + {% else %} + {% if match.isStatistic %} +
+

STATISTIQUES

+

+ {% else %} +
+

#{{ match.court }}

+

+ {% endif %} + + {% endif %} +
+ + {% if match.team3 %} @@ -98,7 +118,33 @@ {% for match in ended_matches %}
-

{{ match.title }}

+
+
+

{{ match.title }}

+
+ {% if match.isMatch or match.isBracket %} + {% if match.isMatch %} +
+

TERRAIN #{{ match.court }}

+

+ {% else %} +
+

POULE #{{ match.poule|floatformat:0 }}

+

+ {% endif %} + {% else %} + {% if match.isStatistic %} +
+

STATISTIQUES

+

+ {% else %} +
+

#{{ match.court }}

+

+ {% endif %} + + {% endif %} +
{% if match.team3 %} diff --git a/scores/templates/scores/tournament.html b/scores/templates/scores/tournament.html index ccf75bb..938a185 100644 --- a/scores/templates/scores/tournament.html +++ b/scores/templates/scores/tournament.html @@ -19,15 +19,36 @@
- {% for match in live_matches %} +
{{ tournament.name }}
+ + {% for match in live_matches %}

{{ match.title }}

+ {% if match.isMatch or match.isBracket %} + {% if match.isMatch %} + {% else %} + + {% endif %} + {% else %} + {% if match.isStatistic %} + + {% else %} + + {% endif %} + + {% endif %}
{% if match.team3 %} @@ -92,7 +113,33 @@ {% for match in ended_matches %}
-

{{ match.title }}

+
+
+

{{ match.title }}

+
+ {% if match.isMatch or match.isBracket %} + {% if match.isMatch %} + + {% else %} + + {% endif %} + {% else %} + {% if match.isStatistic %} + + {% else %} + + {% endif %} + + {% endif %} +
{% if match.team3 %}