diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 673d033..18cf0b8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -117,20 +117,13 @@ module ApplicationHelper ( link_to_homepage( _('My account') )), ( link_to_myprofile _('My Enterprises'), {:controller => 'membership_editor'} ), ( link_to(_('Admin'), { :controller => 'admin_panel' }) if current_user.person.is_admin?), - ( link_to_document (about_document), _('About') if about_document ), ].join("\n") content_tag('span', links, :id => 'user_links') end - def about_document - Article.find_all_by_slug(_('about')).select do |a| - a.full_path.split(/\//).shift == 'noosfero' - end[0] - end - def shortcut_header_links if logged_in? - [ accessibility_link, + [ ( link_to_homepage( content_tag('span', _('My account')),nil, { :id => 'icon_go_home'} ) ), # MUDAR, O ID acima deve ser no Link 'account', :action => 'logout', :method => 'post'}, :id => 'icon_logout'), ] else - [ accessibility_link, + [ ( link_to content_tag('span', _('Login')), { :controller => 'account', :action => 'login' }, :id => 'icon_login' ), ] end.join(" ") end - def header - login_or_register_or_logout - end - def login_or_register_or_logout if logged_in? user_links + " " + logout_box @@ -217,12 +206,6 @@ module ApplicationHelper ] end - def about_links - links = [ - [(link_to _('Report bug'), 'http://www.colivre.coop.br/Noosfero/BugItem')], - ] - end - def design_links links = [ [(link_to _('Change template'), :controller => 'profile_editor', :action => 'design_editor_change_template')], @@ -231,46 +214,6 @@ module ApplicationHelper ] end - #FIXME: about_links should be shown even if the user isn't logged in - def user_options - return [] unless logged_in? - profile = Profile.find_by_identifier(params[:profile]) - case params[:controller] - when 'admin_panel' - admin_links - when 'membership_editor' - membership_links - when 'profile_editor' - if profile.kind_of?(Enterprise) && params[:action] == 'index' - enterprise_links - elsif profile.kind_of?(Person) && params[:action] == 'index' - myprofile_links - elsif params[:action] == 'design_editor' - design_links - else - [] - end - when 'content_viewer' - if params[:profile] == 'noosfero' && params[:page][0] == 'about' - about_links - else - person_links - end - else - [] - end.map{|l| link_if_permitted(l[0], l[1], l[2]) } - end - -# def user_options -# end - - def accessibility_link - doc = Article.find_all_by_slug(_('accessibility')).select do |a| - a.full_path.split(/\//).shift == 'noosfero' - end[0] - link_to_document doc, _('Accessibility'), :id => 'icon_accessibility' if doc - end - def search_box [form_tag( :controller => 'search', :action => 'index'), submit_tag(_('Search'), :id => 'button_search'), diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index 5b1c959..34647a2 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -2,20 +2,19 @@ - <% if @category %> - Noosfero → <%= @category.full_name %> - <% else %> - Noosfero - <% end %> + <% if @category %> + Noosfero → <%= @category.full_name %> + <% else %> + Noosfero + <% end %> - - + + <%= design_all_header_tags %> <%= stylesheet_link_tag 'common' %> <%= stylesheet_link_tag 'help' %> <%= stylesheet_link_tag 'menu' %> <%= javascript_include_tag 'menu' %> - <%# cms stuff %> <% if params[:controller] == 'cms' %> <%= javascript_include_tag 'cms' %> @@ -34,22 +33,21 @@ <%= image_tag 'loading.gif', :id => 'spinner', :style => "display:none; float:right;", :alt => _('Image for Loading...') %>
+
- <%= _('Go Content') %> - <%= shortcut_header_links %> + <%= _('Go to content') %> + <%= shortcut_header_links %>
-
-
- <% if @category %> - <%= @category.full_name %> - <% else @category %> -
- <%= user_options.join(' ') %> -
- <% end %> + +
+
+ <% if @category %> + <%= @category.full_name %> + <% end %> +
-
+ @@ -61,35 +59,35 @@ - -
-
- -
- - -
-
- <% if params[:controller] == 'cms' %> -
- <%= yield %> +
+ +
+ + +
- <% else %> - <%= design_display(yield) %> - <% end %> -
- -
+ + <% if params[:controller] == 'cms' %> +
+ <%= yield %> +
+ <% else %> + <%= design_display(yield) %> + <% end %> +
+ +
- + diff --git a/app/views/shared/categories_menu.rhtml b/app/views/shared/categories_menu.rhtml index 42b3adf..19e8229 100644 --- a/app/views/shared/categories_menu.rhtml +++ b/app/views/shared/categories_menu.rhtml @@ -1,10 +1,4 @@