put live data into leagues and added show labels

This commit is contained in:
Erin Braswell 2012-05-27 22:31:00 -04:00
parent 716f9d836a
commit be810e0093
3 changed files with 14 additions and 28 deletions

View File

@ -15,6 +15,9 @@
.event-title { font-size: 125%; } .event-title { font-size: 125%; }
.match-notes { font-size: 80%; color: #999999; } .match-notes { font-size: 80%; color: #999999; }
.belt-img img { display: block; margin-left: auto; margin-right: auto } .belt-img img { display: block; margin-left: auto; margin-right: auto }
.raw { float: right; margin-right:12em; background-color: #900000;}
.divas { float: right; margin-right:11em; background-color: #900099;}
.smackdown { float: right; margin-right:8em; background-color: #003090;}
</style> </style>
<link href="{% static "assets/css/bootstrap-responsive.css" %}" rel="stylesheet"> <link href="{% static "assets/css/bootstrap-responsive.css" %}" rel="stylesheet">

View File

@ -9,7 +9,7 @@
</header> </header>
<br><br> <br><br>
<h2>Belts</h2> <h2>Belts</h2>
<br><br>
<div class="row-fluid"> <div class="row-fluid">
<!-- begin belt block --> <!-- begin belt block -->
{% for belt in belts %} {% for belt in belts %}
@ -43,40 +43,23 @@
<br><br><br> <br><br><br>
<h2> Stables </h2> <h2> Stables </h2>
<br><br>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>GM Punk</th> {% for team in teams %}
<th>I'm AWEsome</th> <th>{{team}}</th>
<th>COBRA!</th> {% endfor %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for star_set in star_sets %}
<tr> <tr>
<td>CM Punk</td> {% for star in star_set %}
<td>Brodus Clay</td> <td>{{star}}<span class="label {{star.division}}">{{star.division}}</span></td>
<td>Santino</td> {% endfor %}
</tr>
<tr>
<td>Kane</td>
<td>John Cena</td>
<td>Dolph Ziggler</td>
</tr>
<tr>
<td>R Truth</td>
<td>Chris Jericho</td>
<td>Kofi Kingston</td>
</tr>
<tr>
<td>Cody Rhodes</td>
<td>Sheamus</td>
<td>Alberto del Rio</td>
</tr>
<tr>
<td>Sin Cara</td>
<td>Daniel Bryan</td>
<td>Randy Orton</td>
</tr> </tr>
{% endfor %}
</tbody> </tbody>
</table> </table>

View File

@ -34,5 +34,5 @@ def stables(request):
} }
teams = list(Team.objects.all().prefetch_related('stars')) teams = list(Team.objects.all().prefetch_related('stars'))
context['teams'] = teams context['teams'] = teams
context['star_sets'] = izip_longest(*(team.stars.all() for team in teams)) context['star_sets'] = izip_longest(*(team.stars.all().order_by("division") for team in teams))
return render(request, "stables.html", context) return render(request, "stables.html", context)