From 226e10483c57ef4f22852c045fc738a6717f5c2d Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Wed, 12 Sep 2007 05:32:56 +0000 Subject: [PATCH] ActionItem8: updating templates and translation files --- app/helpers/application_helper.rb | 5 +++-- app/views/account/index.rhtml | 5 +---- app/views/cms/_page_list_item.rhtml | 8 ++++---- app/views/cms/index.rhtml | 2 +- app/views/content_viewer/view_page.rhtml | 13 +++++++++++++ po/pt_BR/noosfero.po | 13 +++++-------- 6 files changed, 27 insertions(+), 19 deletions(-) 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 @@

- <%= link_to 'Clear Page Cache', :controller=>controller.controller_name, :action=>'expire_page_cache' %> + <%= link_to _('Clear Page Cache'), :controller=>controller.controller_name, :action=>'expire_page_cache' %>

diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml index d37ca39..e4699d4 100644 --- a/app/views/content_viewer/view_page.rhtml +++ b/app/views/content_viewer/view_page.rhtml @@ -1,3 +1,16 @@

<%= @page.title %>

+<% if @page.parent %> + <%= link_to_document(@page.parent, _('Up')) %> +
+<% end %> + <%= @page.to_html %> + +<% unless @page.children.empty? %> +
+