Commits

Frederic De Groef committed b025126

new layout for course summary little boxes everywhere

Comments (0)

Files changed (2)

coursecalendar.py

 from geholwrapper import get_calendar
 from utils import is_course_mnemo_valid, render_course_notfound_page
 from savedrequests import PreviousRequest
+from gehol.utils import convert_weekspan_to_dates
 
 class CourseCalendar(webapp.RequestHandler):
     def get(self):
                 cal = get_calendar(course_mnemo)
                 if cal:
                     ical_url, csv_url = self._build_file_urls(course_mnemo)
+                    start, end = convert_weekspan_to_dates("1-36", "20/09/2010")
+                    caption = "Schedule from %s to %s" % (start.strftime("%B %d, %Y"),
+                                                          end.strftime("%B %d, %Y"))
 
                     template_values = {'gehol_is_down': is_status_down(),
                                      'last_status_update': get_last_status_update(),
                                     'mnemo':course_mnemo,
                                     'ical_url':ical_url,
-                                    'csv_url':csv_url
+                                    'csv_url':csv_url,
+                                    'caption':caption
                     }
 
                     template_values.update(cal.metadata)

templates/course.html

 
 {% block content %}
 
-    <h2>Report for <strong>{{mnemo}}</strong></h2>
+    <div class="span-15">
+        <h2>Summary for <strong>{{mnemo}}</strong></h2>
+        <i>Title:</i> {{title}} <br/>
+        <i>Lecturer(s):</i> {{tutor}} <br/>
 
-    <h3>Summary:</h3>
-    <i>Title:</i> {{title}} <br/>
-    <i>Lecturer(s):</i> {{tutor}} <br/>
-    <i>Type:</i>  {{type}} <br/>
+    <br/> <br/>
+        
+    <h3>We can generate the following files for you:</h3>
 
-    <br/><br/>
+        <div class="box" style="text-align:center">
+            <h3><a href="{{ical_url}}">{{mnemo}}.ics</a></h3>
+            <div class="quiet" style="font-style:italic;">  {{caption}}</div>
+        </div>
 
-    <h3><a href="{{ical_url}}">{{mnemo}}.ics</a></h3>
-    <p>
-        Click this link to download an iCal file with the events for this course. iCal files can be opened with
-        Apple iCal, Microsoft Outlook and Mozilla Sunbird.
-    </p>
-        
+        <p>
+            Click this link to download an iCal file with the events for this course. iCal files can be opened with
+            Apple iCal, Microsoft Outlook and Mozilla Sunbird.
+        </p>
 
-    <br/><br/>
-    <h3><a href="{{csv_url}}">{{mnemo}}.csv</a></h3>
-    <p>
-        Click this link to download a CSV file with the events for this course. This file can be imported in
-        Google Calendar.
-    </p>
 
+    <br/><br/><br/>
+    <div class="box" style="text-align:center">
+            <h3><a href="{{csv_url}}">{{mnemo}}.csv</a></h3>
+            <div class="quiet" style="font-style:italic;">{{caption}}</div>
+        </div>
+        <p>
+            Click this link to download a CSV file with the events for this course. This file can be imported in
+            Google Calendar.
+        </p>
+</div>
 {% endblock %}