From 0ea3d150e127a1b69c67b31495d633a56edcbbfa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 7 Dec 2008 13:12:19 +0000 Subject: [PATCH] Makes logged-in username in topbar linking to (#2291). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2109 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 4 ++-- app/views/layouts/base.rhtml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0e02e5692..cb0233fd6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -47,8 +47,8 @@ module ApplicationHelper end # Display a link to user's account page - def link_to_user(user) - (user && !user.anonymous?) ? link_to(user, :controller => 'account', :action => 'show', :id => user) : 'Anonymous' + def link_to_user(user, options={}) + (user && !user.anonymous?) ? link_to(user.name(options[:format]), :controller => 'account', :action => 'show', :id => user) : 'Anonymous' end def link_to_issue(issue, options={}) diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 8cdfcb8e6..b146d615e 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -24,7 +24,7 @@
<%= render_menu :account_menu -%>
- <%= content_tag('div', "#{l(:label_logged_as)} #{User.current.login}", :id => 'loggedas') if User.current.logged? %> + <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}", :id => 'loggedas') if User.current.logged? %> <%= render_menu :top_menu -%> -- 2.39.5