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

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 24 15:05:49 EST 2008


Author: artunit
Date: 2008-11-24 15:05:45 -0500 (Mon, 24 Nov 2008)
New Revision: 41

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


Modified: servres/trunk/conifer/syrup/urls.py
===================================================================
--- servres/trunk/conifer/syrup/urls.py	2008-11-24 19:27:56 UTC (rev 40)
+++ servres/trunk/conifer/syrup/urls.py	2008-11-24 20:05:45 UTC (rev 41)
@@ -5,5 +5,6 @@
     (r'^course/$', 'my_courses'),
     (r'^opencourse/$', 'open_courses'),
     (r'^join/$', 'join_course'),
+    (r'^instructors/$', 'instructors'),
     (r'^course/(?P<course_id>\d+)/$', 'course_detail'),
 )

Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py	2008-11-24 19:27:56 UTC (rev 40)
+++ servres/trunk/conifer/syrup/views.py	2008-11-24 20:05:45 UTC (rev 41)
@@ -41,8 +41,25 @@
                     page_num=page_num,
                     count=count)
 
+#
+#
+def instructors(request):
+    page_num = int(request.GET.get('page', 1))
+    count = int(request.GET.get('count', 5))
+    action = request.GET.get('action', 'browse')
+    if action == 'join':
+        paginator = Paginator(models.Course.objects.filter(moderated=False), count)
+    elif action == 'drop':
+        paginator = Paginator(models.Course.objects.filter(moderated=False), count)
+    else:
+        paginator = Paginator(models.Course.objects.filter(moderated=False), count)
+        
+    return g.render('instructors.xhtml', paginator=paginator,
+                    page_num=page_num,
+                    count=count)
+
 def join_course(request):
-    return g.render('welcome.xhtml')
+    return g.render('join_course.xhtml')
 
 @login_required
 def my_courses(request):

Modified: servres/trunk/conifer/templates/tabbar.xhtml
===================================================================
--- servres/trunk/conifer/templates/tabbar.xhtml	2008-11-24 19:27:56 UTC (rev 40)
+++ servres/trunk/conifer/templates/tabbar.xhtml	2008-11-24 20:05:45 UTC (rev 41)
@@ -2,10 +2,15 @@
       xmlns:py="http://genshi.edgewall.org/"
       xmlns:xi="http://www.w3.org/2001/XInclude"
       py:strip="">
+<!--
+    eventually these should be customized based on user level
+    use one for now
+-->
 <ul id="tabbar">
   <li><a href="/syrup/">Home</a></li>
   <li class="active"><a href="/syrup/course/">My Courses</a></li>
   <li><a href="/syrup">Add a Reserve</a></li>
+  <li><a href="/syrup/join/">Join Course</a></li>
   <li><a href="/syrup">Manage Users</a></li>
   <li><a href="/syrup">Preferences</a></li>
 </ul>



More information about the open-ils-commits mailing list