diff --git a/fowl/game/templates/edit_event.html b/fowl/game/templates/edit_event.html new file mode 100644 index 0000000..29ab47d --- /dev/null +++ b/fowl/game/templates/edit_event.html @@ -0,0 +1,103 @@ +{% extends "base.html" %} +{% block content %} +
+ + + + + +
+

Match #1

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 member #1member #2member #3
team #1
team #2
team #3
+ + + + + + + + + +
+

Match #2

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 member #1member #2member #3
team #1
team #2
team #3
+ + + + + + + + +
+ + +
+
+{% endblock %} diff --git a/fowl/game/urls.py b/fowl/game/urls.py index dbe2a50..68cf1ec 100644 --- a/fowl/game/urls.py +++ b/fowl/game/urls.py @@ -2,5 +2,6 @@ from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^events/$', 'fowl.game.views.events'), + url(r'^edit_event/$', 'fowl.game.views.edit_event'), url(r'^stables/$', 'fowl.game.views.stables'), ) diff --git a/fowl/game/views.py b/fowl/game/views.py index e58068f..94812f7 100644 --- a/fowl/game/views.py +++ b/fowl/game/views.py @@ -1,5 +1,5 @@ from collections import defaultdict -from django.shortcuts import render +from django.shortcuts import render, get_object_or_404 from fowl.game.models import TeamPoints @@ -19,6 +19,14 @@ def events(request): events[event_id].scores[tp.team.name] += tp.points return render(request, "events.html", {'events': events}) +def edit_event(request, event_id=None): + if event_id: + event = get_object_or_404(Event, pk=event_id) + else: + event = None + if request.method == 'GET': + return render(request, "edit_event.html", {"event": event}) + def stables(request): return render(request, "stables.html")