update html to handle bracket

main
Razmig Sarkissian 2 years ago
parent 0874f07ba0
commit 9d63bc2564
  1. 21
      scores/models.py
  2. 6
      scores/static/scores/style.css
  3. 66
      scores/templates/scores/index.html
  4. 51
      scores/templates/scores/tournament.html

@ -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

@ -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;

@ -22,15 +22,35 @@
{% for match in live_matches %}
<div class="match">
<p><a href="/match/{{ match.id }}/">TERRAIN #{{ match.court }}</a></p>
<h1>{{ match.title }}</h1>
<!-- <p class="duration">
<div class="alignleft"><h1>{{ match.title }}</h1></div>
<div class="big alignright"><a href="/match/{{ match.id }}/">TERRAIN #{{ match.court }}</a></div>
</p> -->
<div style="width: 100%;">
<div style="float: left;">
<h1>{{ match.title }}</h1>
</div>
{% if match.isMatch or match.isBracket %}
{% if match.isMatch %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">TERRAIN #{{ match.court }}</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">POULE #{{ match.poule|floatformat:0 }}</a><h1>
</div>
{% endif %}
{% else %}
{% if match.isStatistic %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">STATISTIQUES</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">#{{ match.court }}</a><h1>
</div>
{% endif %}
{% endif %}
</div>
{% if match.team3 %}
<table>
@ -98,7 +118,33 @@
{% for match in ended_matches %}
<div class="match">
<h1>{{ match.title }}</h1>
<div style="width: 100%;">
<div style="float: left;">
<h1>{{ match.title }}</h1>
</div>
{% if match.isMatch or match.isBracket %}
{% if match.isMatch %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">TERRAIN #{{ match.court }}</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">POULE #{{ match.poule|floatformat:0 }}</a><h1>
</div>
{% endif %}
{% else %}
{% if match.isStatistic %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">STATISTIQUES</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">#{{ match.court }}</a><h1>
</div>
{% endif %}
{% endif %}
</div>
{% if match.team3 %}

@ -19,15 +19,36 @@
<div class="container">
{% for match in live_matches %}
<div class="bigcenter">{{ tournament.name }}</div>
{% for match in live_matches %}
<div class="match">
<div style="width: 100%;">
<div style="float: left;">
<h1>{{ match.title }}</h1>
</div>
{% if match.isMatch or match.isBracket %}
{% if match.isMatch %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">TERRAIN #{{ match.court }}</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">POULE #{{ match.poule|floatformat:0 }}</a><h1>
</div>
{% endif %}
{% else %}
{% if match.isStatistic %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">STATISTIQUES</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">#{{ match.court }}</a><h1>
</div>
{% endif %}
{% endif %}
</div>
{% if match.team3 %}
@ -92,7 +113,33 @@
{% for match in ended_matches %}
<div class="match">
<h1>{{ match.title }}</h1>
<div style="width: 100%;">
<div style="float: left;">
<h1>{{ match.title }}</h1>
</div>
{% if match.isMatch or match.isBracket %}
{% if match.isMatch %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">TERRAIN #{{ match.court }}</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">POULE #{{ match.poule|floatformat:0 }}</a><h1>
</div>
{% endif %}
{% else %}
{% if match.isStatistic %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">STATISTIQUES</a><h1>
</div>
{% else %}
<div style="float: right;">
<h1><a href="/match/{{ match.id }}/">#{{ match.court }}</a><h1>
</div>
{% endif %}
{% endif %}
</div>
{% if match.team3 %}

Loading…
Cancel
Save