added roster

This commit is contained in:
Erin Braswell 2012-05-28 03:21:29 -04:00
parent 905e1ff14a
commit c8556194cc
3 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,26 @@
{% extends "base.html" %}
{% load static %}
{% block title %} Roster {% endblock %}
{% block content %}
<header class="jumbotron subhead" id="overview">
<h1>Roster</h1>
<p class="lead">The WWE Roster</p>
</header>
<br><br><br>
<table class="table">
<thead>
<tr>
<th>Stars</th>
</tr>
</thead>
<tbody>
{% for star in stars %}
<tr>
<td>{{star}}<span class="label {{star.division}}">{{star.division}}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -6,4 +6,5 @@ urlpatterns = patterns('',
url(r'league/(?P<league_id>\d+)/$', 'fowl.game.views.league', url(r'league/(?P<league_id>\d+)/$', 'fowl.game.views.league',
name='league'), name='league'),
url(r'^edit_event/$', 'fowl.game.views.edit_event', name='edit_event'), url(r'^edit_event/$', 'fowl.game.views.edit_event', name='edit_event'),
url(r'^roster/$', 'fowl.game.views.roster', name='roster'),
) )

View File

@ -1,7 +1,7 @@
from collections import defaultdict from collections import defaultdict
from itertools import izip_longest from itertools import izip_longest
from django.shortcuts import render, get_object_or_404 from django.shortcuts import render, get_object_or_404
from fowl.game.models import Team, TeamPoints from fowl.game.models import Team, TeamPoints, Star
def events(request, league_id): def events(request, league_id):
@ -29,7 +29,6 @@ def edit_event(request, event_id=None):
if request.method == 'GET': if request.method == 'GET':
return render(request, "edit_event.html", {"event": event}) return render(request, "edit_event.html", {"event": event})
def league(request, league_id): def league(request, league_id):
context = { context = {
'view': 'league', 'view': 'league',
@ -41,3 +40,9 @@ def league(request, league_id):
context['star_sets'] = izip_longest(*(team.stars.all().order_by("division") context['star_sets'] = izip_longest(*(team.stars.all().order_by("division")
for team in teams)) for team in teams))
return render(request, "stables.html", context) return render(request, "stables.html", context)
def roster(request):
context = {
'stars': Star.objects.all()
}
return render(request, "roster.html", context)