班级-多重角色的显示错误:当一个成员的身份是:助教和学生时,角色切换按钮显示的是“学生身份”和“教师身份” 正确的应该是“学生身份”和“助教身份”

This commit is contained in:
cxt 2016-10-13 14:14:32 +08:00
parent b8296f3e7e
commit 39151c0e65
1 changed files with 3 additions and 1 deletions

View File

@ -79,8 +79,10 @@
<% is_TA = get_user_member_roles_course @course, User.current, 7 %>
<% is_TE = get_user_member_roles_course @course, User.current, 9 %>
<% is_ST = get_user_member_roles_course @course, User.current, 10 %>
<% if !is_teacher && (is_TA || is_TE) %>
<% if !is_teacher && is_TE %>
<%= link_to '教师身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => (is_TA ? 7 : 9)), :class => "sy_btn_orange mr10 fl", :title => "由学生身份切换至教师身份" %>
<% elsif !is_teacher && is_TA %>
<%= link_to '助教身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => (is_TA ? 7 : 9)), :class => "sy_btn_orange mr10 fl", :title => "由学生身份切换至教师身份" %>
<% elsif is_teacher && is_ST %>
<%= link_to '学生身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : 9), :tar_role => 10), :class => "sy_btn_orange mr10 fl", :title => "由教师身份切换至学生身份" %>
<% end %>