[open-ils-commits] r94 - in servres/trunk/conifer: syrup templates

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 5 22:09:46 EST 2009


Author: artunit
Date: 2009-01-05 22:09:44 -0500 (Mon, 05 Jan 2009)
New Revision: 94

Modified:
   servres/trunk/conifer/syrup/views.py
   servres/trunk/conifer/templates/master.xhtml
Log:


Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2009-01-05 02:52:07 UTC (rev 93)
+++ servres/trunk/conifer/syrup/views.py	2009-01-06 03:09:44 UTC (rev 94)
@@ -66,6 +66,7 @@
     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 @@
             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 @@
     """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):

Modified: servres/trunk/conifer/templates/master.xhtml
===================================================================
--- servres/trunk/conifer/templates/master.xhtml	2009-01-05 02:52:07 UTC (rev 93)
+++ servres/trunk/conifer/templates/master.xhtml	2009-01-06 03:09:44 UTC (rev 94)
@@ -59,7 +59,7 @@
         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



More information about the open-ils-commits mailing list