Commit 07025bff403eb57e050b6174976409cd971a7e82

Authored by MoisesMachado
1 parent 77bc8e2c

ActionItem114: fixed the links of the shortcuts in the top

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@815 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -128,6 +128,20 @@ module ApplicationHelper
128 128 end[0]
129 129 end
130 130  
  131 + def shortcut_header_links
  132 + if logged_in?
  133 + [ accessibility_link,
  134 + ( link_to_homepage( content_tag('span', _('My account')) ) ),
  135 + ( link_to( _('Admin'), { :controller => 'admin_panel' }) if current_user.person.is_admin?),
  136 + ( link_to content_tag('span', _('Logout')), :controller => 'account', :action => 'logout', :method => 'post'),
  137 + ]
  138 + else
  139 + [ accessibility_link,
  140 + ( link_to content_tag('span', _('Login')), :controller => 'account', :action => 'login'),
  141 + ]
  142 + end
  143 + end
  144 +
131 145 def header
132 146 login_or_register_or_logout
133 147 end
... ...
app/views/layouts/application.rhtml
... ... @@ -33,17 +33,7 @@
33 33 <div id='top_bar' class='category<%= category_color %>'>
34 34 <div id='accessibility_menu'>
35 35 <a href='#content'><span><%= _('Go Content') %></span></a>
36   - <%=
37   - if logged_in?
38   - ( accessibility_link ) + " " +
39   - ( link_to_homepage((content_tag('span', _('My account'))))) + " " +
40   - ( link_to(_('Admin'), { :controller => 'admin_panel' }) if current_user.person.is_admin?) + " " +
41   - (link_to (content_tag('span', _('Logout'))), { :controller => 'account', :action => 'logout'}, :method => 'post')
42   - else
43   - ( accessibility_link ) + " " +
44   - (link_to (content_tag('span', _('Login'))), :controller => 'account', :action => 'login')
45   - end
46   - %>
  36 + <%= shortcut_header_links %>
47 37 </div><!-- accessibility_menu -->
48 38 <div id='path_category'>
49 39 <% if @category %>
... ...