%# Params: # - page (Page Node) # - level (integer indicating current tree depth) # Called From: # - index # Description: # This partial is used recursively. Render it with the root node, and it will recurse # down all of the child nodes to build a list with proper indentation to indicate # tree depth. %> <% # Create the page-level links... links = [] links << link_to(pluralize(page.versions.length, 'revision', 'revisions'), :action=>'versions', :id=>page) if page.versions.length > 0 links << link_to('add child page', {:action=>'new', :parent=>page}, :title=>"Add a child to '#{page.title}'", :class=>'add-page') links << link_to_function('reorder children', "ComatoseList.toggle_reorder('page_list_#{page.id}',this,#{page.id})", :title=>"Reorder children of '#{page.title}'", :class=>'reorder-children', :href=>url_for(:action=>'reorder', :id=>page)) if !page.children.empty? and page.children.length > 1 links << link_to('delete', {:action=>'delete', :id=>page}, :confirm=>'This will delete this page, and any children. Are you sure?', :title=>"Delete page '#{page.title}' and all it's children", :class=>'delete-page', :method=>'post', :onmouseover=>"ComatoseList.item_hover('page_#{page.id}', 'over', true)", :onmouseout=>"ComatoseList.item_hover('page_#{page.id}', 'out', true)") unless @root_pages.include? page # Level check, one, two, three... collapse_children = (level >= Comatose.config.default_tree_level) %>
| <% if !page.children.empty? %> <%= image_tag( ((collapse_children) ? 'comatose/collapsed.gif' : 'comatose/expanded.gif'), :title=>'Expand/Collapse', :onclick=>"ComatoseList.toggle_tree_nodes(this,#{page.id});", :class=>'tree-controller', :size=>'12x12', :id=>"page_controller_#{page.id}" ) %> <% else %> <%= image_tag 'comatose/no-children.gif', :size=>'12x12', :class=>'tree-controller' %> <% end %> | <%= image_tag 'comatose/page.gif', :size=>'25x31', :align=>"absmiddle" %> DRAG | <%= link_to page.title, {:action=>'edit', :id=>page}, :title=>"Path:#{page.full_path}", :class=>'page' %> |
| Updated <%= time_ago_in_words page.updated_on, true %> ago<%= " by #{page.author}" unless page.author.nil? or page.author.empty? %>, <%= links.join(', ') %>. |