#1307修复作业列表真实姓名只显示名不显示姓的BUG

This commit is contained in:
sw 2014-08-21 11:16:40 +08:00
parent e112bb2803
commit 50e1f41345
2 changed files with 6 additions and 4 deletions

View File

@ -441,7 +441,7 @@ module CoursesHelper
def homework_user_of_homework homework,is_teacher
homework_users = ""
homework.users.each do |user|
homework_users = homework_users + (is_teacher ? user.realname : user.name)
homework_users = homework_users + (is_teacher ? (user.firstname + user.lastname) : user.login)
if user != homework.users.last
homework_users = homework_users + ""
end

View File

@ -28,13 +28,15 @@
<tr>
<td style="vertical-align: top;width: 70px" >
<table style="text-align: center;width: 100%;table-layout: fixed">
<% user_name = is_teacher ? (homework.user.firstname + homework.user.lastname) : homework.user.login %>
<tr>
<td title="<%= homework.user.name %>"><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
<td title="<%= user_name %>"><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
</tr>
<tr>
<td title="<%= homework.user.name %>">
<td title="<%= user_name %>">
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><strong>
<%= link_to (is_teacher ? homework.user.realname : homework.user ), user_path(homework.user),{:style => "color:#727272"} %>
<%= link_to user_name, user_path(homework.user),{:style => "color:#727272"} %>
</strong></p>
</td>
</tr>