[open-ils-commits] r633 - in servres/trunk/conifer: syrup/views templates (artunit)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 24 22:59:34 EDT 2009
Author: artunit
Date: 2009-08-24 22:59:32 -0400 (Mon, 24 Aug 2009)
New Revision: 633
Added:
servres/trunk/conifer/templates/departments.xhtml
Modified:
servres/trunk/conifer/syrup/views/general.py
Log:
fixed department browse
Modified: servres/trunk/conifer/syrup/views/general.py
===================================================================
--- servres/trunk/conifer/syrup/views/general.py 2009-08-21 16:15:21 UTC (rev 632)
+++ servres/trunk/conifer/syrup/views/general.py 2009-08-25 02:59:32 UTC (rev 633)
@@ -150,11 +150,16 @@
def department_detail(request, department_id):
page_num = int(request.GET.get('page', 1))
count = int(request.GET.get('count', 5))
+
paginator = Paginator(models.Course.objects.
filter(department__id=department_id).
- filter(active=True).order_by('title'), count)
+ order_by('title'), count)
- return g.render('courses.xhtml', paginator=paginator,
+ department = models.Department.objects.get(pk=department_id)
+
+ return g.render('courses.xhtml',
+ custom_title=_('Courses with Materials in %s') % department.name,
+ paginator=paginator,
page_num=page_num,
count=count)
Added: servres/trunk/conifer/templates/departments.xhtml
===================================================================
--- servres/trunk/conifer/templates/departments.xhtml (rev 0)
+++ servres/trunk/conifer/templates/departments.xhtml 2009-08-25 02:59:32 UTC (rev 633)
@@ -0,0 +1,26 @@
+<?python
+title = defined('custom_title') and custom_title or _('Departments')
+?>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:py="http://genshi.edgewall.org/">
+<xi:include href="master.xhtml"/>
+<xi:include href="paginate.xhtml"/>
+<head>
+ <title>${title}</title>
+ <script type="text/javascript">
+ <!-- !This ought to be in paginate.xhtml, not here. how to do? -->
+ $(function() { $('.pagetable').tablesorter(); });
+ </script>
+</head>
+<body>
+ <h1>${title}</h1>
+ <tr py:def="pageheader()">
+ <th>Department</th>
+ </tr>
+ <span py:def="pagerow(department)">
+ <td><a href="${ROOT}${department_url(department)}">${department.name}</a></td>
+ </span>
+ ${pagetable(paginator, count, pagerow, pageheader)}
+</body>
+</html>
More information about the open-ils-commits
mailing list