diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7f412e730..2c6a1ba49 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -31,6 +31,14 @@ module ApplicationHelper def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference) link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action]) end + + def link_to_signin + link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => 'signin' + end + + def link_to_signout + link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => 'logout' + end # Display a link to user's account page def link_to_user(user) diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index c98f2b45b..5f85c78f8 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -23,9 +23,9 @@ <% if User.current.logged? %> <%=l(:label_logged_as)%> <%= User.current.login %> - <%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => 'myaccount' %> - <%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => 'logout' %> + <%= link_to_signout %> <% else %> - <%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => 'signin' %> + <%= link_to_signin %> <%= link_to(l(:label_register), { :controller => 'account',:action => 'register' }, :class => 'register') if Setting.self_registration? %> <% end %>