[open-ils-commits] r109 - in servres/trunk/conifer/templates: . components
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jan 11 18:44:39 EST 2009
Author: gfawcett
Date: 2009-01-11 18:44:34 -0500 (Sun, 11 Jan 2009)
New Revision: 109
Modified:
servres/trunk/conifer/templates/components/item.xhtml
servres/trunk/conifer/templates/course_detail.xhtml
Log:
Fix for borked last commit (forgot the hide-edit-links code).
Modified: servres/trunk/conifer/templates/components/item.xhtml
===================================================================
--- servres/trunk/conifer/templates/components/item.xhtml 2009-01-11 23:44:27 UTC (rev 108)
+++ servres/trunk/conifer/templates/components/item.xhtml 2009-01-11 23:44:34 UTC (rev 109)
@@ -4,7 +4,7 @@
py:strip="">
<!-- !show_tree: display a tree of items in a hierarchical style. -->
- <ul py:def="show_tree(tree)" py:if="tree" class="itemtree">
+ <ul py:def="show_tree(tree, edit=False)" py:if="tree" class="itemtree">
<li py:for="item, subs in tree" class="item_${item.item_type}">
<a href="${item_url(item)}">${item}</a>
<span py:if="item.needs_meta_link()" class="metalink">
@@ -13,7 +13,7 @@
<span class="editlinks" py:if="edit">
[<a href="${item_url(item)}edit/">edit</a>]
</span>
- ${show_tree(subs)}
+ ${show_tree(subs, edit)}
</li>
</ul>
Modified: servres/trunk/conifer/templates/course_detail.xhtml
===================================================================
--- servres/trunk/conifer/templates/course_detail.xhtml 2009-01-11 23:44:27 UTC (rev 108)
+++ servres/trunk/conifer/templates/course_detail.xhtml 2009-01-11 23:44:34 UTC (rev 109)
@@ -1,6 +1,7 @@
<?python
title = '%s: %s (%s)' % (course.code, course.title, course.term)
item_tree = course.item_tree()
+is_editor = course.can_edit(request.user)
?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
@@ -16,7 +17,7 @@
<p py:if="not item_tree">
There are no items associated with this course yet.
</p>
- ${show_tree(course.item_tree())}
- ${add_subs()}
+ ${show_tree(item_tree, edit=is_editor)}
+ <div py:if="is_editor">${add_subs()}</div>
</body>
</html>
More information about the open-ils-commits
mailing list