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

This commit is contained in:
Erin Braswell 2012-05-27 15:11:59 -04:00
commit 21aac4e3f2
3 changed files with 113 additions and 1 deletions

View File

@ -0,0 +1,103 @@
{% extends "base.html" %}
{% block content %}
<form class="well form-inline">
<label>Show Name</label>
<input type="text" class="span3" placeholder="RAW/Smackdown/PPV Name">
<label>Date</label>
<input type="text" class="span3" placeholder="YYYY-MM-DD">
<!-- match -->
<hr>
<h4>Match #1</h4>
<table class="table">
<thead>
<tr>
<th>&nbsp;</th>
<th>member #1</th>
<th>member #2</th>
<th>member #3</th>
</tr>
</thead>
<tbody>
<tr>
<th>team #1</th>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
</tr>
<tr>
<th>team #2</th>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
</tr>
<tr>
<th>team #3</th>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
</tr>
</tbody>
</table>
<label>Winner</label>
<input type="text" class="span3">
<label>Win Type</label>
<select>
<option>Pin</option>
<option>Submission</option>
<option>Disqualification</option>
</select>
<button class="btn">Add Team</button>
<button class="btn">Add Member</button>
<button class="btn btn-danger">Delete Match</button>
<!-- /match -->
<!-- match -->
<hr>
<h4>Match #2</h4>
<table class="table">
<thead>
<tr>
<th>&nbsp;</th>
<th>member #1</th>
<th>member #2</th>
<th>member #3</th>
</tr>
</thead>
<tbody>
<tr>
<th>team #1</th>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
</tr>
<tr>
<th>team #2</th>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
</tr>
<tr>
<th>team #3</th>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
<td><input type="text" class="span3"></td>
</tr>
</tbody>
</table>
<label>Winner</label>
<input type="text" class="span3">
<label>Win Type</label>
<select>
<option>Pin</option>
<option>Submission</option>
<option>Disqualification</option>
</select>
<button class="btn">Add Team</button>
<button class="btn">Add Member</button>
<button class="btn btn-danger">Delete Match</button>
<!-- /match -->
<div>
<button class="btn">Add Match</button>
<button class="btn btn-primary">Save</button>
</div>
</form>
{% endblock %}

View File

@ -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'),
)

View File

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