git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@94 6d9bc8c9-1ec2-4278...
authorartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 6 Jan 2009 03:09:44 +0000 (03:09 +0000)
committerartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 6 Jan 2009 03:09:44 +0000 (03:09 +0000)
conifer/syrup/views.py
conifer/templates/master.xhtml

index 5f6571b..b273404 100644 (file)
@@ -66,6 +66,7 @@ def join_course(request):
     return g.render('join_course.xhtml')
 
 def browse_courses(request, browse_option=''):
+    #the defaults should be moved into a config file or something...
     page_num = int(request.GET.get('page', 1))
     count = int(request.GET.get('count', 5))
 
@@ -77,15 +78,15 @@ def browse_courses(request, browse_option=''):
             count=count)
 
     elif browse_option == 'departments':
-        paginator = Paginator(models.UserProfile.active_instructors(), count)
+        paginator = Paginator(models.Department.objects.filter(active=True), count)
 
-        return g.render('instructors.xhtml', paginator=paginator,
+        return g.render('departments.xhtml', paginator=paginator,
             page_num=page_num,
             count=count)
     elif browse_option == 'courses':
-        paginator = Paginator(models.UserProfile.active_instructors(), count)
+        paginator = Paginator(models.Course.objects.filter(active=True), count)
 
-        return g.render('instructors.xhtml', paginator=paginator,
+        return g.render('courses.xhtml', paginator=paginator,
             page_num=page_num,
             count=count)
 
@@ -137,7 +138,6 @@ def _heading_detail(request, item):
     """Display a heading. Show the subitems for this heading."""
     return g.render('item_heading_detail.xhtml', item=item)
     
-
 def normalize_query(query_string,
                     findterms=re.compile(r'"([^"]+)"|(\S+)').findall,
                     normspace=re.compile(r'\s{2,}').sub):
index fecc1e1..c9d715d 100644 (file)
@@ -59,7 +59,7 @@ app_name = 'Syrup E-Reserve System'
         probably a more elegant way of detecting whether we are on
         the front page but this works for the short term
     -->
-    <span py:if="not request.META.PATH_INFO == '/syrup/'">
+    <span py:if="not user.is_authenticated() and not request.META.PATH_INFO == '/syrup/'">
         <a href="/syrup">Start Over</a>  -
     </span>
     Syrup is a subproject of <a href="http://conifer.mcmaster.ca/">Project Conifer</a> &copy; 2008