changed roster page to display by division
This commit is contained in:
parent
b47f3e0eec
commit
18363a08b2
@ -11,16 +11,27 @@
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Stars</th>
|
<th>Raw</th>
|
||||||
|
<th>Smackdown</th>
|
||||||
|
<th>Divas</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for star in stars %}
|
{% for star_set in star_sets %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{star}}<span class="label {{star.division}}">{{star.division}}</span></td>
|
{% for star in star_set %}
|
||||||
|
<td>{{star}}</td>
|
||||||
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<h2>Others</h2>
|
||||||
|
<ul>
|
||||||
|
{% for other in others %}
|
||||||
|
<li>{{other}}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -159,10 +159,11 @@ def roster(request, league_id):
|
|||||||
divisions = {'raw': [], 'smackdown': [], 'other': [], 'divas': []}
|
divisions = {'raw': [], 'smackdown': [], 'other': [], 'divas': []}
|
||||||
for star in Star.objects.all():
|
for star in Star.objects.all():
|
||||||
divisions[star.division].append(star)
|
divisions[star.division].append(star)
|
||||||
stars = izip_longest(divisions['raw'], divisions['smackdown'],
|
star_sets = izip_longest(divisions['raw'], divisions['smackdown'],
|
||||||
divisions['divas'], divisions['other'])
|
divisions['divas'], fillvalue='')
|
||||||
context = {
|
context = {
|
||||||
'stars': stars,
|
'star_sets': star_sets,
|
||||||
|
'others': divisions['other'],
|
||||||
'view': 'roster',
|
'view': 'roster',
|
||||||
'league': league,
|
'league': league,
|
||||||
'leagues': leagues
|
'leagues': leagues
|
||||||
|
Loading…
Reference in New Issue
Block a user