parent
0381179536
commit
6a0d362241
|
@ -715,13 +715,20 @@ class BidsController < ApplicationController
|
|||
end
|
||||
|
||||
def add_homework
|
||||
# homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id)
|
||||
# homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
|
||||
@homework = HomeworkAttach.new
|
||||
@homework.bid_id = @bid.id
|
||||
@homework.user_id = User.current.id
|
||||
@homework.save_attachments(params[:attachments])
|
||||
@homework.save
|
||||
if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)
|
||||
# homework = HomeworkAttach.create(:bid_id => @bid.id, :user_id => User.current.id)
|
||||
# homework.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads]))
|
||||
@homework = HomeworkAttach.new
|
||||
@homework.bid_id = @bid.id
|
||||
@homework.user_id = User.current.id
|
||||
@homework.save_attachments(params[:attachments])
|
||||
@homework.save
|
||||
if @homework.attachments.empty?
|
||||
@homework.delete
|
||||
flash[:error] = l(:no_attachmens_allowed)
|
||||
# else
|
||||
end
|
||||
end
|
||||
@homework_list = @bid.homeworks
|
||||
|
||||
end
|
||||
|
|
|
@ -1311,6 +1311,8 @@ zh:
|
|||
button_bidding: 我要参加
|
||||
field_enterprise: '企业:'
|
||||
|
||||
no_attachmens_allowed: 提交作业不能为空
|
||||
|
||||
button_bidding_homework: 参加竞标 #huang
|
||||
field_homework_type: 提交形式 #bai
|
||||
label_homework_respond: 作业情况
|
||||
|
|
Loading…
Reference in New Issue