diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6f7019077..eefcea6ca 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -95,6 +95,20 @@ module ApplicationHelper end end + #重载上面方法,增加样式显示 + def link_to_user_header user,canShowRealName=false,options={} + if user.is_a?(User) + if canShowRealName + name = h(user.realname(options[:format])) + else + name = h(user.name(options[:format])) + end + link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => options[:class] + else + h(user.to_s) + end + end + # Displays a link to +issue+ with its subject. # Examples: # diff --git a/app/views/layouts/_new_header.html.erb b/app/views/layouts/_new_header.html.erb index 24df22c81..a430a8e8f 100644 --- a/app/views/layouts/_new_header.html.erb +++ b/app/views/layouts/_new_header.html.erb @@ -12,24 +12,17 @@