已拒绝的私有作业不可引用

This commit is contained in:
cxt 2016-05-03 10:15:09 +08:00
parent 389b75f7ab
commit 39c2365338
2 changed files with 4 additions and 2 deletions

View File

@ -477,8 +477,8 @@ class UsersController < ApplicationController
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i)
if ah.empty?
@status = 2
elsif ah.first.status == 1
@status = 1
elsif ah.first.status != 2
@status = ah.first.status
end
end
if !params[:search].nil?

View File

@ -2,6 +2,8 @@
alert("您的申请尚未通过审核,暂时不可发送至课程");
<% elsif @status == 2 %>
alert("该作业是私有的,请先提交申请并通过审核后再发送");
<% elsif @status == 3 %>
alert("您的申请已被拒绝,不可发送至课程");
<% else %>
<% if params[:is_observe].nil? %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>');