Skip to content

Commit

Permalink
attempt fix scheduler, placebo register button added
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Jun 14, 2011
1 parent e7b80cf commit 8e56676
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Binary file added scheduler/templates/scheduler/.index.html.swp
Binary file not shown.
Expand Up @@ -107,6 +107,7 @@ <h3>
{% endifequal %}
Combination {{forloop.counter}}
</h4>

<table>
<tr>
<th>Class</th>
Expand All @@ -130,10 +131,13 @@ <h3>
<td>TBA</td>
{% endifnotequal %}
<td>{{course.crn}}</td>
</tr>
</tr>
{% endfor %}

</table>
<form action='.' method='POST'>
<input type="hidden" name="courses" value="{{combination}}" />
<input type="submit" name="register" value="Register" />
</form>
<br/>
</div>
{% endfor %}
Expand Down
14 changes: 14 additions & 0 deletions scheduler/views.py
Expand Up @@ -10,6 +10,16 @@ def index(request):

if request.method == 'GET':
return render_to_response('scheduler/index.html')

# if user chose to register a list of courses
try:
if request.session['courses']:
register(courses)
del(request.session['courses'])
return render_to_response('scheduler/index.html')
except:
pass

regclass = request.session['regclass']
#try:
classes = request.POST['classes'].split(', ')
Expand All @@ -23,3 +33,7 @@ def index(request):

return render_to_response('scheduler/index.html', {'combinations':combinations, 'json':combinations_json, 'range':range(24), 'classes_possible':classes_possible})

def register(courses):
print courses


0 comments on commit 8e56676

Please sign in to comment.