diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 7a25154..f919da3 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -2,7 +2,7 @@ # available in all controllers. class ApplicationController < ActionController::Base -# helper :all + helper :document design :holder => 'virtual_community' diff --git a/app/helpers/document_helper.rb b/app/helpers/document_helper.rb index 212cdb9..3085430 100644 --- a/app/helpers/document_helper.rb +++ b/app/helpers/document_helper.rb @@ -1,7 +1,22 @@ module DocumentHelper + # displays an icon corresponding to the document passed in +doc+. + # + # The class of the document can define its icon by providing an +icon+ + # method (i.e. +doc.class.icon+ will be called) def icon_for_document(doc) - design_display_icon(doc.class.icon) + icon = + case doc + when Comatose::Page + 'text-x-generic' + else + if doc.class.respond_to?(:icon) + doc.class.icon + else + 'none' + end + end + design_display_icon(icon) end end diff --git a/app/views/comatose_admin/_page_list_item.rhtml b/app/views/comatose_admin/_page_list_item.rhtml index a83b899..cf83114 100644 --- a/app/views/comatose_admin/_page_list_item.rhtml +++ b/app/views/comatose_admin/_page_list_item.rhtml @@ -23,24 +23,21 @@ 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" %> + | + <%= icon_for_document(page) %> 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(', ') %>. |