修复:项目动态附件,组织列表,贴吧列表交流,贴吧吧主,贴吧发帖人,贴吧最后回复,详情页面问题跟踪,项目动态的指派的地方的用户改为显示用户姓名

This commit is contained in:
daiao 2016-09-14 10:42:30 +08:00
parent f0d150ec47
commit 3e38b09219
10 changed files with 21 additions and 13 deletions

View File

@ -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) << %(<option value="#{element.id}"#{selected_attribute}>#{h element.name}</option>)
(element.is_a?(Group) ? groups : s) << %(<option value="#{element.id}"#{selected_attribute}>#{h element.show_name}</option>)
end
unless groups.empty?
s << %(<optgroup label="#{h(l(:label_group_plural))}">#{groups}</optgroup>)

View File

@ -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

View File

@ -9,8 +9,9 @@
<span class="postAttSize">(
<%= number_to_human_size attachment.filesize %>)
</span>
<span class="author" title="<%= attachment.author%>">
<%= 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 %>
<span class="author" title="<%= user_name %>">
<%= link_to h(truncate(user_name, length: 15, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
<%= format_time(attachment.created_on) %>
</span>
</div>

View File

@ -11,7 +11,8 @@
<%#= link_to forum.name.gsub(/(\r\n|\s+)/,'<br/>'), forum_path(forum),:class=>"f16 linkBlue" %>
</div>
<div class="postDes"><%= textAreailizable forum.description%></div>
<div class="postCreater">创建者:<a href="<%= user_path( forum.creator)%>" class="linkGrey2" target="_blank"><%= forum.creator.name %></a></div>
<% user_name = forum.creator.show_name.empty? ? forum.creator.name : forum.creator.show_name %>
<div class="postCreater">创建者:<a href="<%= user_path( forum.creator)%>" class="linkGrey2" target="_blank"><%= user_name %></a></div>
<div class="postDate">创建时间:<%= format_date(forum.created_at) %></div>
</div>
<div class="postStatics">

View File

@ -27,7 +27,7 @@
</div>
<% author = topic.last_reply.try(:author)%>
<% if author%>
<div class="postDetailCreater">最后回复:<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.name%></a></div>
<div class="postDetailCreater">最后回复:<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.show_name%></a></div>
<div class="postDetailDate"><%= format_date(topic.last_reply.created_at)%></div>
<% end%>
<span class=" fr " style="color: #888888; font-size: 12px;">更新时间:<%= format_date(topic.updated_at)%></span>

View File

@ -20,7 +20,7 @@
<span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p>
<br>
<div class="cl"></div>
由<%=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 %>
</div>
<!--talk_txt end-->

View File

@ -187,7 +187,8 @@
</div>
<div class="fl">
<div class="f16 fontBlue mb10" style="word-break: break-all; word-wrap:break-word;white-space:pre-wrap;"><%= @forum.name%></div>
<div class="fontGrey2 mb8">吧主:<a href="<%= user_path(@forum.creator)%>" class="linkBlue"><%= @forum.creator.name%></a></div>
<% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %>
<div class="fontGrey2 mb8">吧主:<a href="<%= user_path(@forum.creator)%>" class="linkBlue"><%= user_name %></a></div>
<div class="fontGrey3">回答:<a href="javascript:void(0);" class="linkOrange mr5" style="cursor: default"><%= @forum.memo_count %></a> 帖子:<a href="javascript:void(0);" class="linkOrange" style="cursor: default"><%=@forum.topic_count%></a></div>
</div>
<div class="cl"></div>

View File

@ -58,7 +58,7 @@
<div class="cl"></div>
<div class="postDetailCreater">
<%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content" id="activity_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >

View File

@ -62,7 +62,7 @@
<li>
<p class="label03">&nbsp;指派&nbsp;&nbsp;:&nbsp;</p>
<span class="pro_info_p" style="width:130px;">
<%= 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;" %>
<a href="javascript:void(0)" class="pic_edit2 ml5" style="vertical-align:top;"></a></span>
<%= select( :issue, :user_id, principals_options_for_isuue_list(activity.project),
{ :include_blank => false,:selected => @assign_to_id ? @assign_to_id : 0},

View File

@ -25,7 +25,8 @@
<%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %>
</div>
<div class="orgIntro"><%= org.description %></div>
<div class="postCreater">创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %></div>
<% user_name = User.find(org.creator_id).show_name.empty? ? User.find(org.creator_id) : User.find(org.creator_id).show_name %>
<div class="postCreater">创建者:<%= link_to user_name, user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %></div>
<div class="postDate fl mr40">创建时间:<%= format_activity_day(org.created_at) %> <%= format_time(org.created_at, false) %></div>
<div class="postCreater">您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %></div>
</div>