课程个人主页动态改为 昵称(真名) 形式显示(对该课程的老师助教)

作业里老师助教看到真名
president
z9hang 11 years ago
parent eb0e149ac7
commit 1c92007ac6

@ -140,7 +140,7 @@ module CoursesHelper
def is_course_teacher user,project def is_course_teacher user,project
is_teacher = false is_teacher = false
searchTeacherAndAssistant(project).each do |teacher| searchTeacherAndAssistant(project).each do |teacher|
if user == teacher if user == teacher.user
is_teacher = true is_teacher = true
break break
end end

@ -51,7 +51,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="1" valign="top" style="width: 300px">&nbsp; <td colspan="1" valign="top" style="width: 300px">&nbsp;
<strong>发布人:&nbsp; <%= link_to (display_id ? homework.user.realname : homework.user ), user_path(homework.user)%></strong> <strong>发布人:&nbsp; <%= link_to ( is_teacher ? homework.user.realname : homework.user ), user_path(homework.user)%></strong>
</td> </td>
<td> <td>
<strong>作业评分:</strong> <strong>作业评分:</strong>
@ -71,7 +71,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="2" valign="top">&nbsp; <td colspan="2" valign="top">&nbsp;
<% if display_id %> <% if display_id || is_teacher %>
<strong><%= l(:label_bidding_user_studentcode) %>&nbsp; &nbsp;<%= homework.user.user_extensions.student_id%></strong> <strong><%= l(:label_bidding_user_studentcode) %>&nbsp; &nbsp;<%= homework.user.user_extensions.student_id%></strong>
<% end %> <% end %>
</td> </td>

@ -18,7 +18,7 @@
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong> <strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
<span class="font_lighter"> <span class="font_lighter">
<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>)
<%= l(:label_new_activity) %> </span> <%= l(:label_new_activity) %> </span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %> <%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
@ -86,7 +86,7 @@
#判断是否显示真名 #判断是否显示真名
if @canShowRealName if @canShowRealName
%> %>
<%= link_to (h @user.try(:realname)), user_path(@user) if @user %> <%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>)
<% else %> <% else %>
<%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%= link_to (h @user.try(:name)), user_path(@user) if @user %>
<% end %> <% end %>

Loading…
Cancel
Save