只有班级创建者才能归档和恢复

This commit is contained in:
cxt 2016-11-18 17:32:45 +08:00
parent 6bb4e650c4
commit 149ecc0b99
1 changed files with 2 additions and 2 deletions

View File

@ -67,11 +67,11 @@
<% else %>
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "hw_btn_green fr mt5",:method => "post"%>
<% end %>
<% if User.current.allowed_to?(:as_teacher, course) || User.current.admin? %>
<% if User.current == course.teacher || User.current.admin? %>
<a href="javascript:void(0)" onclick="archive_course(<%=course.id %>, 0);" class="btn_grey_big fr mt5 mr5" style="width: 56px;">归档</a>
<% end %>
<% else %>
<% if User.current.allowed_to?(:as_teacher, course) || User.current.admin? %>
<% if User.current == course.teacher || User.current.admin? %>
<a href="javascript:void(0)" onclick="archive_course(<%=course.id %>, 1);" class="btn_grey_big fr mt5" style="width: 56px;">恢复</a>
<% end %>
<% end %>