##// END OF EJS Templates
Moved login and logout links to ApplicationHelper methods for easier customization....
Jean-Philippe Lang -
r1017:97f0da0b1a6f
parent child
Show More
@@ -32,6 +32,14 module ApplicationHelper
32 link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action])
32 link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action])
33 end
33 end
34
34
35 def link_to_signin
36 link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => 'signin'
37 end
38
39 def link_to_signout
40 link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => 'logout'
41 end
42
35 # Display a link to user's account page
43 # Display a link to user's account page
36 def link_to_user(user)
44 def link_to_user(user)
37 user ? link_to(user, :controller => 'account', :action => 'show', :id => user) : 'Anonymous'
45 user ? link_to(user, :controller => 'account', :action => 'show', :id => user) : 'Anonymous'
@@ -23,9 +23,9
23 <% if User.current.logged? %>
23 <% if User.current.logged? %>
24 <%=l(:label_logged_as)%> <%= User.current.login %> -
24 <%=l(:label_logged_as)%> <%= User.current.login %> -
25 <%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => 'myaccount' %>
25 <%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => 'myaccount' %>
26 <%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => 'logout' %>
26 <%= link_to_signout %>
27 <% else %>
27 <% else %>
28 <%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => 'signin' %>
28 <%= link_to_signin %>
29 <%= link_to(l(:label_register), { :controller => 'account',:action => 'register' }, :class => 'register') if Setting.self_registration? %>
29 <%= link_to(l(:label_register), { :controller => 'account',:action => 'register' }, :class => 'register') if Setting.self_registration? %>
30 <% end %>
30 <% end %>
31 </div>
31 </div>
General Comments 0
You need to be logged in to leave comments. Login now