fixed department browse
authorartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 25 Aug 2009 02:59:32 +0000 (02:59 +0000)
committerartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Tue, 25 Aug 2009 02:59:32 +0000 (02:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@633 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/syrup/views/general.py
conifer/templates/departments.xhtml [new file with mode: 0644]

index aa6fac4..633a536 100644 (file)
@@ -150,11 +150,16 @@ def instructor_detail(request, instructor_id):
 def department_detail(request, department_id):\r
     page_num = int(request.GET.get('page', 1))\r
     count = int(request.GET.get('count', 5))\r
+\r
     paginator = Paginator(models.Course.objects.\r
         filter(department__id=department_id).\r
-        filter(active=True).order_by('title'), count)\r
+        order_by('title'), count)\r
+\r
+    department = models.Department.objects.get(pk=department_id)\r
 \r
-    return g.render('courses.xhtml', paginator=paginator,\r
+    return g.render('courses.xhtml', \r
+            custom_title=_('Courses with Materials in %s') % department.name,\r
+            paginator=paginator,\r
             page_num=page_num,\r
             count=count)\r
 \r
diff --git a/conifer/templates/departments.xhtml b/conifer/templates/departments.xhtml
new file mode 100644 (file)
index 0000000..5a3673a
--- /dev/null
@@ -0,0 +1,26 @@
+<?python\r
+title = defined('custom_title') and custom_title or _('Departments')\r
+?>\r
+<html xmlns="http://www.w3.org/1999/xhtml"\r
+      xmlns:xi="http://www.w3.org/2001/XInclude"\r
+      xmlns:py="http://genshi.edgewall.org/">\r
+<xi:include href="master.xhtml"/>\r
+<xi:include href="paginate.xhtml"/>\r
+<head>\r
+  <title>${title}</title>\r
+  <script type="text/javascript">\r
+    <!-- !This ought to be in paginate.xhtml, not here. how to do? -->\r
+    $(function() { $('.pagetable').tablesorter(); });\r
+  </script>\r
+</head>\r
+<body>\r
+  <h1>${title}</h1>\r
+  <tr py:def="pageheader()">\r
+    <th>Department</th>\r
+  </tr>\r
+  <span py:def="pagerow(department)">\r
+    <td><a href="${ROOT}${department_url(department)}">${department.name}</a></td>\r
+  </span>\r
+  ${pagetable(paginator, count, pagerow, pageheader)}\r
+</body>\r
+</html>\r