%# 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. %> <% 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 | <%- # TODO %> <%= link_to page.title, edit_comatose_page_path(page, :locale => 'en'), :class => 'page' %> |
Updated <%= time_ago_in_words page.updated_at, true %> ago <%= " by #{page.author}" unless page.author.blank? %>, <%= link_to_if(((page.versions.length > 0) rescue false), pluralize(page.versions.length, 'revision', 'revisions'), versions_comatose_page_path(page, :locale => 'en')) %> <%= link_to 'add child page', new_comatose_page_path(:parent => page, :title => "Add a child to '#{page.title}'", :locale => 'en'), :class => 'add-page' %> <% if !page.children.empty? and page.children.length > 1 %> <%= 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) %> <% end %> <%= link_to_unless @root_pages.include?(page), 'delete', comatose_page_path(page, :locale => 'en', :method => :destroy), :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)" %> |