diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6c21404..dab64ba 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -99,10 +99,11 @@ module ApplicationHelper link_to text, { :profile => profile }.merge(url), options end - def link_to_document(doc) + def link_to_document(doc, text = nil) + text ||= doc.title path = doc.full_path.split(/\//) profile = path.shift - link_to doc.title, homepage_path(:profile => profile , :page => path) + link_to text, homepage_path(:profile => profile , :page => path) end # TODO: add the actual links diff --git a/app/views/account/index.rhtml b/app/views/account/index.rhtml index 8c28bfe..4e05685 100644 --- a/app/views/account/index.rhtml +++ b/app/views/account/index.rhtml @@ -5,13 +5,10 @@ <%= _('It is a good idea to change your password from times to times.') %>
-<%# FIXME: to be implemented %> -<%= link_to _('Logout.'), :action => 'logout' %> diff --git a/app/views/cms/_page_list_item.rhtml b/app/views/cms/_page_list_item.rhtml index bbec58b..fc43141 100644 --- a/app/views/cms/_page_list_item.rhtml +++ b/app/views/cms/_page_list_item.rhtml @@ -12,10 +12,10 @@ <% # 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 '%s'") % page.title, :class=>'add-page') -links << link_to_function('reorder children', "ComatoseList.toggle_reorder('page_list_#{page.id}',this,#{page.id}, '%s', '%s')" % [_('reorder children'), _('finished reordering')], :title=> _("Reorder children of '%s'") % 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 '%s' and all it's children") % page.title, :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 +links << link_to((page.versions.length == 1 ? _('%d revision') : _('%d revisions')) % page.versions.length, :action=>'versions', :id=>page) if page.versions.length > 0 +links << link_to(_('add child document'), {:action=>'new', :parent=>page}, :title=> _("Add a child to '%s'") % page.title, :class=>'add-page') +links << link_to_function(_('reorder children'), "ComatoseList.toggle_reorder('page_list_#{page.id}',this,#{page.id}, '%s', '%s')" % [_('reorder children'), _('finished reordering')], :title=> _("Reorder children of '%s'") % 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 '%s' and all it's children") % page.title, :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) %> diff --git a/app/views/cms/index.rhtml b/app/views/cms/index.rhtml index 826c4e3..567cba4 100644 --- a/app/views/cms/index.rhtml +++ b/app/views/cms/index.rhtml @@ -1,5 +1,5 @@