Merge branch 'master' of github.com:jamesturk/fowl

This commit is contained in:
James Turk 2012-06-01 01:09:06 -04:00
commit 8d2ad2bed2
2 changed files with 18 additions and 6 deletions

View File

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

View File

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