From c8556194ccc880058c9b3bff220a031ab67701dd Mon Sep 17 00:00:00 2001 From: Erin Braswell Date: Mon, 28 May 2012 03:21:29 -0400 Subject: [PATCH] added roster --- fowl/game/templates/roster.html | 26 ++++++++++++++++++++++++++ fowl/game/urls.py | 1 + fowl/game/views.py | 9 +++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 fowl/game/templates/roster.html diff --git a/fowl/game/templates/roster.html b/fowl/game/templates/roster.html new file mode 100644 index 0000000..e0902cb --- /dev/null +++ b/fowl/game/templates/roster.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} +{% load static %} +{% block title %} Roster {% endblock %} + +{% block content %} +
+

Roster

+

The WWE Roster

+
+


+ + + + + + + + {% for star in stars %} + + + + {% endfor %} + +
Stars
{{star}}{{star.division}}
+ +{% endblock %} diff --git a/fowl/game/urls.py b/fowl/game/urls.py index c87abfd..68d235f 100644 --- a/fowl/game/urls.py +++ b/fowl/game/urls.py @@ -6,4 +6,5 @@ urlpatterns = patterns('', url(r'league/(?P\d+)/$', 'fowl.game.views.league', name='league'), url(r'^edit_event/$', 'fowl.game.views.edit_event', name='edit_event'), + url(r'^roster/$', 'fowl.game.views.roster', name='roster'), ) diff --git a/fowl/game/views.py b/fowl/game/views.py index d2712d7..4bf731e 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -1,7 +1,7 @@ from collections import defaultdict from itertools import izip_longest 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): @@ -29,7 +29,6 @@ def edit_event(request, event_id=None): if request.method == 'GET': return render(request, "edit_event.html", {"event": event}) - def league(request, league_id): context = { 'view': 'league', @@ -41,3 +40,9 @@ def league(request, league_id): context['star_sets'] = izip_longest(*(team.stars.all().order_by("division") for team in teams)) return render(request, "stables.html", context) + +def roster(request): + context = { + 'stars': Star.objects.all() + } + return render(request, "roster.html", context) \ No newline at end of file