on event save actions
This commit is contained in:
parent
46ec093e0d
commit
9ee51a524b
@ -44,6 +44,7 @@
|
||||
<a class="brand" href="#"><img src="{% static "images/duck.png" %}" width="30" height="30"> </a>
|
||||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
{% if league %}
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{league}}<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
@ -52,9 +53,11 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li {% if view == "league" %}class="active"{%endif%}><a href="{% url league league.id %}">League</a></li>
|
||||
<li {% if view == "events" %}class="active"{%endif%}><a href="{% url events league.id %}">Events</a></li>
|
||||
<li {% if view == "roster" %}class="active"{%endif%}><a href="{% url roster league.id %}">Roster</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
|
@ -2,6 +2,7 @@
|
||||
{% block content %}
|
||||
<form class="well form-inline" action="." method="post">
|
||||
<label>Show Name</label>
|
||||
<input type="hidden" name="id" value="{{event.id}}">
|
||||
<input type="text" class="span3" name="name" value="{{event.name}}"
|
||||
placeholder="RAW/Smackdown/PPV Name">
|
||||
<label>Date</label>
|
||||
|
@ -55,6 +55,15 @@ def edit_event(request, event):
|
||||
edict['matches'][int(match)-1]['teams'].append(v)
|
||||
|
||||
event = Event.from_dict(edict)
|
||||
# score the event for all active leagues
|
||||
for league in League.objects.filter(active=True):
|
||||
league.score_event(event)
|
||||
# after event is scored, do title change on all matches
|
||||
for match in event.matches.all():
|
||||
match.do_title_change()
|
||||
# TODO: title changes should take place inline somehow?
|
||||
# (would fix for case if title changes twice)
|
||||
event = event.to_dict()
|
||||
|
||||
return render(request, "edit_event.html",
|
||||
{'event': event,
|
||||
|
Loading…
Reference in New Issue
Block a user