From 918168ea686697cb5e05b99573ff3075187c0b76 Mon Sep 17 00:00:00 2001 From: artunit Date: Mon, 5 Jan 2009 02:52:07 +0000 Subject: [PATCH] git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@93 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/syrup/views.py | 23 +++++++++++++++++++++++ conifer/templates/master.xhtml | 13 ++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index 6db0546..5f6571b 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -66,6 +66,29 @@ def join_course(request): return g.render('join_course.xhtml') def browse_courses(request, browse_option=''): + page_num = int(request.GET.get('page', 1)) + count = int(request.GET.get('count', 5)) + + if browse_option == 'instructors': + paginator = Paginator(models.UserProfile.active_instructors(), count) + + return g.render('instructors.xhtml', paginator=paginator, + page_num=page_num, + count=count) + + elif browse_option == 'departments': + paginator = Paginator(models.UserProfile.active_instructors(), count) + + return g.render('instructors.xhtml', paginator=paginator, + page_num=page_num, + count=count) + elif browse_option == 'courses': + paginator = Paginator(models.UserProfile.active_instructors(), count) + + return g.render('instructors.xhtml', paginator=paginator, + page_num=page_num, + count=count) + return g.render('browse_courses.xhtml') @login_required diff --git a/conifer/templates/master.xhtml b/conifer/templates/master.xhtml index b6f6046..fecc1e1 100644 --- a/conifer/templates/master.xhtml +++ b/conifer/templates/master.xhtml @@ -52,7 +52,18 @@ app_name = 'Syrup E-Reserve System' ${select('*|text()')} -- 2.11.0