Moved login and logout links to ApplicationHelper methods for easier customization.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1030 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9072753489
commit
97f0da0b1a
|
@ -32,6 +32,14 @@ module ApplicationHelper
|
|||
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)
|
||||
user ? link_to(user, :controller => 'account', :action => 'show', :id => user) : 'Anonymous'
|
||||
|
|
|
@ -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 %>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue