renamed item-add, since it's heading-specific.
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sun, 11 Jan 2009 04:01:41 +0000 (04:01 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sun, 11 Jan 2009 04:01:41 +0000 (04:01 +0000)
Probably better to factor this template out. Real items have more in
common with each other.

git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@102 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/syrup/views.py
conifer/templates/item_add.xhtml [deleted file]
conifer/templates/item_add_heading.xhtml [new file with mode: 0644]

index 86f3b80..43a92a4 100644 (file)
@@ -171,7 +171,7 @@ def item_add(request, course_id, item_id):
     assert item_type == 'HEADING', 'Sorry, only HEADINGs can be added right now.'
 
     if request.method == 'GET':
-        return g.render('item_add.xhtml', **locals())
+        return g.render('item_add_heading.xhtml', **locals())
     else:
         title = request.POST.get('title', '').strip()
         if not title:
diff --git a/conifer/templates/item_add.xhtml b/conifer/templates/item_add.xhtml
deleted file mode 100644 (file)
index 847dee2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- 
-     fixme, this is heading-specific. Should accommodate other types of item too. 
--->
-<?python
-title = 'Add a new subheading'
-course_title = '%s: %s (%s)' % (course.code, course.title, course.term)
-?>
-<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"/>
-  <head>
-    <title>${title}</title>
-  </head>
-  <body>
-    <div class="courseident">
-      <div>${course.department}</div>
-      <h1><a href="${course_url(course)}">${course_title}</a></h1>
-      <h2>${title}</h2>
-      <form action=".?item_type=${item_type}" method="POST">
-       <table>
-         <tr><th>Heading</th><td><input type="text" name="title"/></td></tr>
-       </table>
-       <p><input type="submit" value="Create heading"/></p>
-      </form>
-    </div>
-</body>
-</html>
diff --git a/conifer/templates/item_add_heading.xhtml b/conifer/templates/item_add_heading.xhtml
new file mode 100644 (file)
index 0000000..bd50ea3
--- /dev/null
@@ -0,0 +1,27 @@
+<?python
+title = 'Add a new subheading'
+course_title = '%s: %s (%s)' % (course.code, course.title, course.term)
+?>
+<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="components/item.xhtml"/>
+  <head>
+    <title>${title}</title>
+  </head>
+  <body>
+    <div class="courseident">
+      <div>${course.department}</div>
+      <h1><a href="${course_url(course)}">${course_title}</a></h1>
+      <div py:if="parent_item">${nested_title(parent_item)}</div>
+      <h2>${title}</h2>
+      <form action=".?item_type=${item_type}" method="POST">
+       <table>
+         <tr><th>Heading</th><td><input type="text" name="title"/></td></tr>
+       </table>
+       <p><input type="submit" value="Create heading"/></p>
+      </form>
+    </div>
+</body>
+</html>