|
|
@ -13,6 +13,7 @@ class GraduationWorksController < ApplicationController
|
|
|
|
before_action :published_task, only: [:new, :create, :edit, :update, :search_member_list, :relate_project,
|
|
|
|
before_action :published_task, only: [:new, :create, :edit, :update, :search_member_list, :relate_project,
|
|
|
|
:cancel_relate_project, :revise_attachment]
|
|
|
|
:cancel_relate_project, :revise_attachment]
|
|
|
|
before_action :edit_duration, only: [:edit, :update]
|
|
|
|
before_action :edit_duration, only: [:edit, :update]
|
|
|
|
|
|
|
|
before_action :open_work, only: [:show, :supply_attachments, :comment_list]
|
|
|
|
|
|
|
|
|
|
|
|
def new
|
|
|
|
def new
|
|
|
|
if @task.task_type == 2 && @task.base_on_project
|
|
|
|
if @task.task_type == 2 && @task.base_on_project
|
|
|
@ -489,6 +490,11 @@ class GraduationWorksController < ApplicationController
|
|
|
|
tip_exception("已过了修改时间") if @task.end_time && @task.end_time < Time.now
|
|
|
|
tip_exception("已过了修改时间") if @task.end_time && @task.end_time < Time.now
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 作品是否公开
|
|
|
|
|
|
|
|
def open_work
|
|
|
|
|
|
|
|
tip_exception(403,"没有操作权限") unless (@user_course_identity < Course::STUDENT || current_user == @work.user || @task.open_work)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def update_check work
|
|
|
|
def update_check work
|
|
|
|
tip_exception("作品描述不能为空") if params[:description].blank?
|
|
|
|
tip_exception("作品描述不能为空") if params[:description].blank?
|
|
|
|
if @task.task_type == 2
|
|
|
|
if @task.task_type == 2
|
|
|
|