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">
<span class="editlinks" py:if="edit">
[<a href="${item_url(item)}edit/">edit</a>]
</span>
- ${show_tree(subs)}
+ ${show_tree(subs, edit)}
</li>
</ul>
<?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"
<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>