修改作业显示真实名字不正确的问题

This commit is contained in:
sw 2014-08-22 11:24:25 +08:00
parent 273c932acf
commit f41d3f8b6a
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -28,7 +28,7 @@
<tr> <tr>
<td style="vertical-align: top;width: 70px" > <td style="vertical-align: top;width: 70px" >
<table style="text-align: center;width: 100%;table-layout: fixed"> <table style="text-align: center;width: 100%;table-layout: fixed">
<% user_name = is_teacher ? (homework.user.firstname + homework.user.lastname) : homework.user.login %> <% user_name = is_teacher ? (homework.user.lastname + homework.user.firstname) : homework.user.login %>
<tr> <tr>
<td title="<%= 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>