[open-ils-commits] r189 - in servres/trunk/conifer: syrup templates/admin (artunit)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 16 18:48:10 EDT 2009
Author: artunit
Date: 2009-03-16 18:48:09 -0400 (Mon, 16 Mar 2009)
New Revision: 189
Modified:
servres/trunk/conifer/syrup/urls.py
servres/trunk/conifer/syrup/views.py
servres/trunk/conifer/templates/admin/index.xhtml
Log:
simple decorator add copy to work through courses and items
Modified: servres/trunk/conifer/syrup/urls.py
===================================================================
--- servres/trunk/conifer/syrup/urls.py 2009-03-16 14:35:05 UTC (rev 188)
+++ servres/trunk/conifer/syrup/urls.py 2009-03-16 22:48:09 UTC (rev 189)
@@ -35,6 +35,8 @@
(ITEM_PREFIX + r'add/$', 'item_add'), # for adding sub-things
(r'^admin/$', 'admin_index'),
(r'^admin/terms/' + GENERIC_REGEX, 'admin_terms'),
+ (r'^admin/courses/' + GENERIC_REGEX, 'admin_courses'),
+ (r'^admin/items/' + GENERIC_REGEX, 'admin_items'),
(r'^admin/depts/' + GENERIC_REGEX, 'admin_depts'),
(r'^admin/news/' + GENERIC_REGEX, 'admin_news'),
# (r'^admin/terms/(?P<term_id>\d+)/$', 'admin_term_edit'),
Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py 2009-03-16 14:35:05 UTC (rev 188)
+++ servres/trunk/conifer/syrup/views.py 2009-03-16 22:48:09 UTC (rev 189)
@@ -851,7 +851,41 @@
admin_depts = generic_handler(DeptForm, decorator=admin_only)
+###
+# graham - zap this if it messes anything up :-)
+###
+class CourseForm(ModelForm):
+ class Meta:
+ model = models.Course
+ class Index:
+ title = _('Courses')
+ all = models.Course.objects.order_by('code').all
+ cols = ['code', 'title']
+ links = [0,1]
+
+ clean_code = strip_and_nonblank('code')
+ clean_title = strip_and_nonblank('title')
+
+admin_courses = generic_handler(CourseForm, decorator=admin_only)
+
+class ItemForm(ModelForm):
+ class Meta:
+ model = models.Item
+
+ class Index:
+ title = _('Items')
+ all = models.Item.objects.order_by('title').all
+ cols = ['title', 'author']
+ links = [0,1]
+
+ clean_title = strip_and_nonblank('title')
+ clean_author = strip_and_nonblank('author')
+
+admin_items = generic_handler(ItemForm, decorator=admin_only)
+###
+
+
class NewsForm(ModelForm):
class Meta:
model = models.NewsItem
Modified: servres/trunk/conifer/templates/admin/index.xhtml
===================================================================
--- servres/trunk/conifer/templates/admin/index.xhtml 2009-03-16 14:35:05 UTC (rev 188)
+++ servres/trunk/conifer/templates/admin/index.xhtml 2009-03-16 22:48:09 UTC (rev 189)
@@ -13,6 +13,8 @@
<ul>
<li><a href="depts/">Departments</a></li>
<li><a href="terms/">Terms</a></li>
+ <li><a href="courses/">Courses</a></li>
+ <li><a href="items/">Items</a></li>
<li><a href="news/">News Items</a></li>
</ul>
</body>
More information about the open-ils-commits
mailing list