diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 94b0b2c6e..feb825e6b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -345,7 +345,11 @@ module ApplicationHelper def link_to_isuue_user(user, options={}) if user.is_a?(User) - name = h(user.name(options[:format])) + if options[:format] + name = h(user.name(options[:format])) + else + name = h(user.show_name) + end link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => "pro_info_p" else h(user.to_s) @@ -978,7 +982,7 @@ module ApplicationHelper groups = '' collection.sort.each do |element| selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) - (element.is_a?(Group) ? groups : s) << %() + (element.is_a?(Group) ? groups : s) << %() end unless groups.empty? s << %(#{groups}) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index b161e29e9..5a124849f 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -111,9 +111,9 @@ module IssuesHelper def principals_options_for_isuue_list(project) if User.current.member_of?(project) - project.members.includes(:user).order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0]) + project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0]) else - project.members.includes(:user).order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给", 0]) + project.members.includes(:user).order("lower(users.login)").map{|c| [User.find(c.user_id).show_name, c.user_id]}.unshift(["指派给", 0]) end end diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb index b37c80dad..b4c45b44c 100644 --- a/app/views/attachments/_activity_attach.html.erb +++ b/app/views/attachments/_activity_attach.html.erb @@ -9,8 +9,9 @@ ( <%= number_to_human_size attachment.filesize %>) - - <%= link_to h(truncate(attachment.author.name, length: 15, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, + <% user_name = attachment.author.show_name.empty? ? attachment.author : attachment.author.show_name %> + + <%= link_to h(truncate(user_name, length: 15, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, <%= format_time(attachment.created_on) %> diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index ec9f4f7de..9a52fb410 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -11,7 +11,8 @@ <%#= link_to forum.name.gsub(/(\r\n|\s+)/,'
'), forum_path(forum),:class=>"f16 linkBlue" %>
<%= textAreailizable forum.description%>
-
创建者:<%= forum.creator.name %>
+ <% user_name = forum.creator.show_name.empty? ? forum.creator.name : forum.creator.show_name %> +
创建者:<%= user_name %>
创建时间:<%= format_date(forum.created_at) %>
diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index 11b1403cd..c3b8b4dbe 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -27,7 +27,7 @@
<% author = topic.last_reply.try(:author)%> <% if author%> -
最后回复:<%= author.name%>
+
最后回复:<%= author.show_name%>
<%= format_date(topic.last_reply.created_at)%>
<% end%> 更新时间:<%= format_date(topic.updated_at)%> diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index ac912a71c..9ae3dfc43 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -20,7 +20,7 @@ <%= get_issue_priority(@issue.priority_id)[1] %>


- 由<%=link_to @issue.author, user_path(@issue.author), :class => "link-blue" %>添加于 <%= format_time(@issue.created_on).html_safe %> + 由<%=link_to @issue.author.show_name, user_path(@issue.author), :class => "link-blue" %>添加于 <%= format_time(@issue.created_on).html_safe %> diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index 021b281d9..b57feb5bd 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -187,7 +187,8 @@
<%= @forum.name%>
- + <% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> +
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 95059e21d..7015d17e5 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -58,7 +58,7 @@
- <%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
+ <%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
<%= format_date( @memo.created_at)%>
diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb index 95e297f49..321ba663a 100644 --- a/app/views/users/_project_issue_detail.html.erb +++ b/app/views/users/_project_issue_detail.html.erb @@ -62,7 +62,7 @@
  •  指派  : 

    - <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:100px; display:inline-block;" %> + <%= link_to activity.try(:assigned_to).show_name, user_path(activity.assigned_to_id), :class => "linkBlue hidden", :style => "max-width:100px; display:inline-block;" %> <%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project), { :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0}, diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb index 3dc8332da..86177f2e4 100644 --- a/app/views/users/user_organizations.html.erb +++ b/app/views/users/user_organizations.html.erb @@ -25,7 +25,8 @@ <%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %>
  • <%= org.description %>
    -
    创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %>
    + <% user_name = User.find(org.creator_id).show_name.empty? ? User.find(org.creator_id) : User.find(org.creator_id).show_name %> +
    创建者:<%= link_to user_name, user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %>
    创建时间:<%= format_activity_day(org.created_at) %> <%= format_time(org.created_at, false) %>
    您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %>