|
|
|
@ -248,7 +248,7 @@ class BidsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# added by bai
|
|
|
|
|
# added by bai 增加了参与者和竞赛设置
|
|
|
|
|
def show_participator
|
|
|
|
|
render :layout => 'base_contest'
|
|
|
|
|
|
|
|
|
@ -608,6 +608,28 @@ class BidsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update_contest
|
|
|
|
|
@bid = Bid.find(params[:id])
|
|
|
|
|
@bid.name = params[:bid][:name]
|
|
|
|
|
@bid.description = params[:bid][:description]
|
|
|
|
|
@bid.reward_type = 2
|
|
|
|
|
@bid.budget = params[:bid][:budget]
|
|
|
|
|
@bid.deadline = params[:bid][:deadline]
|
|
|
|
|
@bid.password = params[:bid][:password]
|
|
|
|
|
@bid.author_id = User.current.id
|
|
|
|
|
@bid.commit = 0
|
|
|
|
|
if @bid.save
|
|
|
|
|
unless @bid.watched_by?(User.current)
|
|
|
|
|
if @bid.add_watcher(User.current)
|
|
|
|
|
flash[:notice] = l(:label_bid_succeed)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
redirect_to respond_path(@bid)
|
|
|
|
|
else
|
|
|
|
|
@bid.safe_attributes = params[:bid]
|
|
|
|
|
render :action => 'new_bid'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
#huang
|
|
|
|
|
def new_contest
|
|
|
|
|
@bid = Bid.new
|
|
|
|
|