Skip to content

Commit

Permalink
revamped schedule page
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Ngo committed Jun 19, 2011
1 parent cff9ae2 commit ae838da
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 11 deletions.
10 changes: 7 additions & 3 deletions schedule/templates/schedule/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

{% block content %}

<h1>Schedule</h1><br/><br/>
<h1>Schedule</h1>
<h2>{{term}}</h2>

{% block header %}

<link rel="stylesheet" type="text/css" href="/site_media/stylesheets/make_schedule.css"/>
<script type="text/javascript" src="/site_media/javascripts/jquery-min.js"></script>
<script>schedule = {{json|safe}}</script>
<script type="text/javascript" src="/site_media/javascripts/schedule.js"></script>
{% endblock %}

<div class="schedule-navigation">
{% if current_term %}
<h3><a href="next_term/">Next Term >></a></h3>
<a href="next_term/"><span>Next Term >></span></a>
{% else %}
<h3><a href="/schedule/">&#060;&#060; Current Term</a></h3>
<a href="/schedule/"><span>&#060;&#060; Current Term</span></a>
{% endif %}
</div>

<div class="span-24 last">
<div class="span-18">
Expand Down
17 changes: 13 additions & 4 deletions schedule/templates/schedule/no_course.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@

{% block content %}

<h1>Schedule</h1><br/><br/>
<h1>Schedule</h1>
<h2>{{term}}</h2>

<link rel="stylesheet" type="text/css" href="/site_media/stylesheets/make_schedule.css"/>

{% comment %} Navigation {% endcomment %}
<div class="schedule-navigation">
{% if current_term %}
<h4><a href="next_term/">Next Term >></a></h4>
<a href="next_term/"><span>Next Term >></span></a>
{% else %}
<h4><a href="/schedule/">&#060;&#060; Current Term</a></h4>
<a href="/schedule/"><span>&#060;&#060; Current Term</span></a>
{% endif %}
<br/>
<br/>
<br/>
<h4>[No courses registered for this term]</h4>
</div>

<h3>No courses registered for this term</h3>

{% endblock %}
12 changes: 8 additions & 4 deletions schedule/views.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
import simplejson as json

from reglib.utilities import utilities

# Create your views here.

def index(request):
regclass = request.session['regclass']
schedule = regclass.schedule.current_classes
term = utilities.adjust_schedule_term(regclass.schedule.current_term)
term = utilities.format_term(term, True)
schedule_json = json.dumps(schedule)

no_courses = False
if len(schedule) is 0:
no_courses = True

if no_courses:
return render_to_response('schedule/no_course.html', {'current_term': True})
return render_to_response('schedule/index.html', {'schedule':schedule, 'range':range(24), 'json':schedule_json, 'current_term': True})
return render_to_response('schedule/no_course.html', {'current_term': True, 'term': term})
return render_to_response('schedule/index.html', {'schedule':schedule, 'term':term, 'range':range(24), 'json':schedule_json, 'current_term': True})

def next_term(request):
regclass = request.session['regclass']
schedule = regclass.next_schedule.current_classes
term = utilities.adjust_schedule_term(regclass.next_schedule.current_term)
term = utilities.format_term(term, True)
schedule_json = json.dumps(schedule)

no_courses = False
Expand All @@ -29,7 +33,7 @@ def next_term(request):

if no_courses:
return render_to_response('schedule/no_course.html', {'current_term': False})
return render_to_response('schedule/index.html', {'schedule':schedule, 'range':range(24), 'json':schedule_json, 'current_term': False})
return render_to_response('schedule/index.html', {'schedule':schedule, 'term':term, 'range':range(24), 'json':schedule_json, 'current_term': False})



21 changes: 21 additions & 0 deletions site_media/stylesheets/make_schedule.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,24 @@ td{
.combination-full{
display:none;
}

.schedule-navigation{
text-align:center;
}

.schedule-navigation a{
text-decoration:none;
color:black;
}

.schedule-navigation span{
font-size:1.5em;
padding-right:10px;
padding-left:10px;
padding-top: 3px;
padding-bottom: 3px;
}

.schedule-navigation span:hover{
background:#6C8DD5;
}

0 comments on commit ae838da

Please sign in to comment.