You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

contests_controller.rb 19 kB

12 years ago
​
​
​
​
12 years ago
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
12 years ago
​
​
​
12 years ago
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
12 years ago
​
​
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. # fq
  2. # class BidsController < ApplicationController
  3. class ContestsController < ApplicationController
  4. menu_item :respond
  5. menu_item :project, :only => :show_project
  6. menu_item :application, :only => :show_softapplication
  7. menu_item :attendingcontests, :only => :show_attendingcontest
  8. menu_item :contestnotifications, :only => :index
  9. before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :index, :set_reward_project, :set_reward_softapplication, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward,
  10. :show_contest_project, :show_contest_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings]
  11. # added by fq
  12. before_filter :require_login, :only => [:join_in_contest, :unjoin_in_contest]
  13. # end
  14. before_filter :require_login,:only => [:set_reward, :destroy, :add, :new, ]
  15. helper :watchers
  16. helper :attachments
  17. include AttachmentsHelper
  18. include ApplicationHelper
  19. helper :projects
  20. helper :words
  21. def index
  22. # @contests = Contest.visible
  23. # @contests ||= []
  24. @offset, @limit = api_offset_and_limit({:limit => 10})
  25. @contests = Contest.visible
  26. @contests = @contests.like(params[:name]) if params[:name].present?
  27. @contest_count = @contests.count
  28. @contest_pages = Paginator.new @contest_count, @limit, params['page']
  29. @offset ||= @contest_pages.reverse_offset
  30. if params[:contest_sort_type].present?
  31. case params[:contest_sort_type]
  32. when '0'
  33. unless @offset == 0
  34. @contests = @contests.reorder('contests.commit').offset(@offset).limit(@limit).all.reverse
  35. else
  36. limit = @contest_count % @limit
  37. limit = @limit if limit == 0
  38. @contests = @contests.reorder('contests.commit').offset(@offset).limit(limit).all.reverse
  39. end
  40. @s_state = 0
  41. when '1'
  42. unless @offset == 0
  43. @contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
  44. else
  45. limit = @contest_count % @limit
  46. limit = @limit if limit == 0
  47. @contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
  48. end
  49. @s_state = 1
  50. when '2'
  51. unless @offset == 0
  52. @contests = @contests.offset(@offset).limit(@limit).all.reverse
  53. else
  54. limit = @contest_count % @limit
  55. limit = @limit if limit == 0
  56. @contests = @contests.offset(@offset).limit(@limit).all.reverse
  57. end
  58. @s_state = 0
  59. end
  60. else
  61. unless @offset == 0
  62. @contests = @contests.reorder('contests.created_on').offset(@offset).limit(@limit).all.reverse
  63. else
  64. limit = @contest_count % @limit
  65. limit = @limit if limit == 0
  66. @contests = @contests.reorder('contests.created_on').offset(@offset).limit(limit).all.reverse
  67. end
  68. @s_state = 1
  69. end
  70. end
  71. def homework
  72. @offset, @limit = api_offset_and_limit({:limit => 10})
  73. @bids = @course.homeworks.order('deadline DESC')
  74. @bids = @bids.like(params[:name]) if params[:name].present?
  75. @bid_count = @bids.count
  76. @bid_pages = Paginator.new @bid_count, @limit, params['page']
  77. @offset ||= @bid_pages.reverse_offset
  78. unless @offset == 0
  79. @bids = @bids.offset(@offset).limit(@limit).all.reverse
  80. else
  81. limit = @bid_count % @limit
  82. @bids = @bids.offset(@offset).limit(limit).all.reverse
  83. end
  84. render :layout => 'base_courses'
  85. end
  86. def show_contest
  87. @user = @contest.author
  88. @jours = @contest.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
  89. @limit = 10
  90. @feedback_count = @jours.count
  91. @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
  92. @offset ||= @feedback_pages.offset
  93. @jour = @jours[@offset, @limit]
  94. @state = false
  95. respond_to do |format|
  96. layout_file = 'base_newcontest'
  97. format.html {
  98. render :layout => layout_file
  99. }
  100. format.api
  101. end
  102. end
  103. def join_in_contest
  104. if params[:contest_password] == @contest.password
  105. JoinInCompetition.create(:user_id => User.current.id, :competition_id => @contest.id)
  106. @state = 0
  107. else
  108. @state = 1
  109. end
  110. respond_to do |format|
  111. format.js { render :partial => 'set_join', :locals => {:user => User.current, :object_id => params[:id]} }
  112. end
  113. end
  114. def unjoin_in_contest
  115. joined = JoinInCompetition.where('competition_id = ? and user_id = ?', @contest.id, User.current.id)
  116. joined.each do |join|
  117. join.delete
  118. end
  119. respond_to do |format|
  120. format.js { render :partial => 'set_join', :locals => {:user => User.current, :object_id => params[:id]} }
  121. end
  122. end
  123. def new_join
  124. end
  125. def show_participator
  126. render :layout => 'base_newcontest'
  127. end
  128. def settings
  129. if @contest.author.id == User.current.id
  130. @contest = Contest.find(params[:id])
  131. render :layout => 'base_newcontest'
  132. else
  133. render_403 :message => :notice_not_contest_setting_authorized
  134. end
  135. end
  136. # Added by Longjun
  137. def destroy_contest
  138. @contest = Contest.find(params[:id])
  139. if @contest.author_id == User.current.id
  140. @contest.destroy
  141. redirect_to action: 'index'
  142. else
  143. render_403 :message => :notice_not_contest_delete_authorized
  144. end
  145. end
  146. # end
  147. def show_contest_project
  148. contests = Contest.where('parent_id = ?', @contest.id)
  149. @projects = []
  150. for contest in contests
  151. @projects += contest.contesting_projects
  152. end
  153. respond_to do |format|
  154. format.html {
  155. render :layout => 'base_newcontest'
  156. }
  157. format.api
  158. end
  159. end
  160. def show_contest_softapplication
  161. contests = Contest.where('parent_id = ?', @contest.id)
  162. @softapplications = []
  163. for contest in contests
  164. @softapplications += contest.contesting_softapplications
  165. end
  166. respond_to do |format|
  167. format.html {
  168. render :layout => 'base_newcontest'
  169. }
  170. format.api
  171. end
  172. end
  173. def show_contest_user
  174. contests = Contest.find(:all)
  175. @users = []
  176. for contest in contests
  177. for project in contest.projects
  178. @users += project.users
  179. end
  180. end
  181. respond_to do |format|
  182. format.html {
  183. render :layout => 'base_newcontest'
  184. }
  185. format.api
  186. end
  187. end
  188. #显示参赛的项目
  189. def show_project
  190. @membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
  191. @option = []
  192. # @contesting_project_count = @contesting_project_all.count
  193. # @contesting_project_pages = Paginator.new @contesting_project_count, per_page_option, params['page']
  194. @membership.each do |membership|
  195. unless(membership.project.project_type==1)
  196. #membership.member_roles.each{|role|
  197. # if(role.role_id == 3)
  198. # @option << membership.project
  199. # end
  200. #}
  201. if User.current.allowed_to?({:controller => "projects", :action => "edit"}, membership.project, :global => false)
  202. @option << membership.project
  203. end
  204. end
  205. end
  206. @user = @contest.author
  207. @contesting_project = @contest.contesting_projects.all
  208. if params[:student_id].present?
  209. @temp = []
  210. @contesting_project.each do |pro|
  211. if pro.project && pro.project.project_status
  212. if /#{params[:student_id]}/ =~ pro.user.user_extensions.student_id
  213. @temp << pro
  214. end
  215. end
  216. @temp
  217. end
  218. @contesting_project = @temp
  219. else
  220. @temp = []
  221. @contesting_project.each do |pro|
  222. if pro.project && pro.project.project_status
  223. @temp << pro
  224. end
  225. @temp
  226. end
  227. if @temp.size > 0
  228. @contesting_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
  229. end
  230. end
  231. @contesting_project = paginateHelper @contesting_project
  232. respond_to do |format|
  233. format.html {
  234. render :layout => 'base_newcontest'
  235. }
  236. format.api
  237. end
  238. end
  239. ############
  240. ##显示参赛的应用
  241. def show_softapplication
  242. # @membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
  243. # @option = []
  244. # @user = @contest.user
  245. @softapplication = Softapplication.all
  246. @contesting_softapplication = @contest.contesting_softapplications
  247. @contesting_softapplication = paginateHelper @contesting_softapplication, 10
  248. # @temp = []
  249. # @softapplicationt.each do |pro|
  250. # if pro.project && pro.project.project_status
  251. # @temp << pro
  252. # end
  253. # @temp
  254. # if @temp.size > 0
  255. # @contesting_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
  256. # end
  257. # end
  258. # respond_to do |format|
  259. # format.html {
  260. # render :layout => 'base_newcontest'
  261. # }
  262. # format.api
  263. # end
  264. ##########################
  265. @contest = Contest.find_by_id(params[:id])
  266. respond_to do |format|
  267. format.html {
  268. render :layout => 'base_newcontest'
  269. }
  270. format.api
  271. end
  272. end
  273. ###我要参赛
  274. def show_attendingcontest
  275. ##取出参赛项目--项目列表
  276. @membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
  277. @option = []
  278. # @contesting_project_count = @contesting_project_all.count
  279. # @contesting_project_pages = Paginator.new @contesting_project_count, per_page_option, params['page']
  280. @membership.each do |membership|
  281. unless(membership.project.project_type==1)
  282. #membership.member_roles.each{|role|
  283. #if(role.role_id == 3)
  284. #@option << membership.project
  285. #end
  286. #}
  287. #拥有编辑项目权限的可将该项目参赛
  288. if User.current.allowed_to?({:controller => "projects", :action => "edit"}, membership.project, :global => false)
  289. @option << membership.project
  290. end
  291. end
  292. end
  293. @user = @contest.author
  294. @contesting_project = @contest.contesting_projects.all
  295. if params[:student_id].present?
  296. @temp = []
  297. @contesting_project.each do |pro|
  298. if pro.project && pro.project.project_status
  299. if /#{params[:student_id]}/ =~ pro.user.user_extensions.student_id
  300. @temp << pro
  301. end
  302. end
  303. @temp
  304. end
  305. @contesting_project = @temp
  306. else
  307. @temp = []
  308. @contesting_project.each do |pro|
  309. if pro.project && pro.project.project_status
  310. @temp << pro
  311. end
  312. @temp
  313. end
  314. if @temp.size > 0
  315. @contesting_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
  316. end
  317. end
  318. ##取出参赛应用 --应用列表
  319. @softapplication = Softapplication.all
  320. @contesting_softapplication = @contest.contesting_softapplications.
  321. joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id").
  322. joins("LEFT JOIN (
  323. SELECT * FROM seems_rateable_cached_ratings WHERE cacheable_type='Softapplication' AND DIMENSION = 'quality') AS cached
  324. ON cached.cacheable_id=softapplications.id").
  325. order("cached.avg").reverse_order
  326. @contesting_softapplication = paginateHelper @contesting_softapplication, 10
  327. ##引用base_newcontest整体样式
  328. @contest = Contest.find_by_id(params[:id])
  329. respond_to do |format|
  330. format.html {
  331. render :layout => 'base_newcontest'
  332. }
  333. format.api
  334. end
  335. end
  336. ###end
  337. def show_notification
  338. @contest = Contest.find_by_id(params[:id])
  339. respond_to do |format|
  340. format.html {
  341. render :layout => 'base_newcontest'
  342. }
  343. format.api
  344. end
  345. end
  346. def set_reward_project
  347. @c_p = nil
  348. @contesting_project_id = nil
  349. if params[:set_reward_project][:reward]&&((User.current.id==@contest.author_id)||User.current.admin)
  350. # @bid_id = params[:id]
  351. @contesting_project_id = params[:set_reward_project][:c_id]
  352. @c_p = ContestingProject.find_by_id(@contesting_project_id)
  353. # 把字段存进表中
  354. @c_p.update_reward(params[:set_reward_project][:reward].to_s)
  355. end
  356. respond_to do |format|
  357. format.js
  358. end
  359. end
  360. def set_reward_softapplication
  361. @c_sa = nil
  362. @contesting_softapplication_id = nil
  363. if params[:set_reward_softapplication][:reward]&&((User.current.id==@contest.author_id)||User.current.admin)
  364. # @bid_id = params[:id]
  365. @contesting_softapplication_id = params[:set_reward_softapplication][:c_id]
  366. @c_sa = ContestingSoftapplication.find_by_id(@contesting_softapplication_id)
  367. # 把字段存进表中
  368. @c_sa.update_reward(params[:set_reward_softapplication][:reward].to_s)
  369. end
  370. respond_to do |format|
  371. format.js
  372. end
  373. end
  374. ###添加已创建的参赛项目
  375. def add
  376. project = Project.find(params[:contest])
  377. contest_message = params[:contest_for_save][:contest_message]
  378. if ContestingProject.where("project_id = ? and contest_id = ?", project.id, @contest.id).size == 0
  379. if ContestingProject.cerate_contesting(@contest.id, project.id, contest_message)
  380. flash.now[:notice] = l(:label_bidding_contest_succeed)
  381. end
  382. else
  383. flash.now[:error] = l(:label_bidding_fail)
  384. end
  385. @contesting_project = paginateHelper @contest.contesting_projects
  386. respond_to do |format|
  387. format.html { redirect_to :back }
  388. format.js
  389. end
  390. end
  391. ###添加已发布的参赛应用
  392. def add_softapplication
  393. softapplication = Softapplication.find(params[:contest])
  394. contest_message = params[:contest_for_save][:contest_message]
  395. if ContestingSoftapplication.where("softapplication_id = ? and contest_id = ?", softapplication.id, @contest.id).size == 0
  396. if ContestingSoftapplication.create_softapplication_contesting(@contest.id, softapplication.id, contest_message)
  397. flash.now[:notice] = l(:label_release_add_contest_succeed)
  398. end
  399. else
  400. flash.now[:error] = l(:label_add_contest_succeed_fail)
  401. end
  402. @contesting_softapplication = paginateHelper @contest.contesting_softapplications
  403. respond_to do |format|
  404. format.html { redirect_to :back }
  405. format.js
  406. end
  407. end
  408. ## 新建留言
  409. def create
  410. if params[:contest_message][:message].size>0
  411. if params[:reference_content]
  412. message = params[:contest_message][:message] + "\n" + params[:reference_content]
  413. else
  414. message = params[:contest_message][:message]
  415. end
  416. refer_user_id = params[:contest_message][:reference_user_id].to_i
  417. @contest.add_jour(User.current, message, refer_user_id)
  418. end
  419. @user = @contest.author
  420. @jours = @contest.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
  421. @limit = 10
  422. @feedback_count = @jours.count
  423. @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
  424. @offset ||= @feedback_pages.offset
  425. @jour = @jours[@offset, @limit]
  426. @contest.set_commit(@feedback_count)
  427. respond_to do |format|
  428. format.js
  429. end
  430. end
  431. ##删除留言
  432. def destroy
  433. @user = @contest.author
  434. if User.current.admin? || User.current.id == @user.id
  435. JournalsForMessage.delete_message(params[:object_id])
  436. end
  437. @jours = @contest.journals_for_messages.reverse
  438. @limit = 10
  439. @feedback_count = @jours.count
  440. @feedback_pages = Paginator.new @feedback_count, @limit, params['page']
  441. @offset ||= @feedback_pages.offset
  442. @jour = @jours[@offset, @limit]
  443. @contest.set_commit(@feedback_count)
  444. respond_to do |format|
  445. format.js
  446. end
  447. end
  448. ##引用留言
  449. def new
  450. @jour = JournalsForMessage.find(params[:journal_id]) if params[:journal_id]
  451. if @jour
  452. user = @jour.user
  453. text = @jour.notes
  454. else
  455. user = @contest.author
  456. text = @contest.description
  457. end
  458. text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
  459. @content = "> #{ll(User.current.language, :text_user_wrote, user)}\n> "
  460. @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
  461. @id = user.id
  462. rescue ActiveRecord::RecordNotFound
  463. render_404
  464. end
  465. ##新建竞赛
  466. def new_contest
  467. @contest = Contest.new
  468. @contest.safe_attributes = params[:contest]
  469. end
  470. ##提交创建的竞赛
  471. def create_contest
  472. @contest = Contest.new
  473. @contest.name = params[:contest][:name]
  474. @contest.description = params[:contest][:description]
  475. @contest.budget = params[:contest][:budget]
  476. @contest.deadline = params[:contest][:deadline]
  477. @contest.password = params[:contest][:password]
  478. @contest.author_id = User.current.id
  479. @contest.commit = 0
  480. if @contest.save
  481. unless @contest.watched_by?(User.current)
  482. if @contest.add_watcher(User.current)
  483. flash[:notice] = l(:label_contesting_created_succeed)
  484. end
  485. end
  486. redirect_to show_contest_contest_path(@contest)
  487. else
  488. @contest.safe_attributes = params[:contest]
  489. render :action => 'new_contest'
  490. end
  491. end
  492. ##更新竞赛配置信息
  493. def update_contest
  494. @contest = Contest.find(params[:id])
  495. @contest.name = params[:contest][:name]
  496. @contest.description = params[:contest][:description]
  497. @contest.budget = params[:contest][:budget]
  498. @contest.deadline = params[:contest][:deadline]
  499. @contest.password = params[:contest][:password]
  500. @contest.author_id = User.current.id
  501. @contest.commit = 0
  502. if @contest.save
  503. unless @contest.watched_by?(User.current)
  504. if @contest.add_watcher(User.current)
  505. flash[:notice] = l(:label_contesting_updated_succeed)
  506. end
  507. end
  508. redirect_to show_contest_contest_path(@contest)
  509. else
  510. @contest.safe_attributes = params[:contest]
  511. render :action => 'new_contest'
  512. end
  513. end
  514. def more
  515. @jour = @contest.journals_for_messages
  516. @jour.each_with_index {|j,i| j.indice = i+1}
  517. @state = true
  518. respond_to do |format|
  519. format.html { redirect_to :back }
  520. format.js
  521. #format.api { render_api_ok }
  522. end
  523. end
  524. def back
  525. @jour = @contest.journals_for_messages
  526. @jour.each_with_index {|j,i| j.indice = i+1}
  527. @state = false
  528. respond_to do |format|
  529. format.html { redirect_to :back }
  530. format.js
  531. #format.api { render_api_ok }
  532. end
  533. end
  534. def set_reward
  535. @b_p = nil
  536. @contesting_project_id = nil
  537. if params[:set_reward][:reward]&&((User.current.id==@contest.author_id)||User.current.admin)
  538. # @contest_id = params[:id]
  539. @contesting_project_id = params[:set_reward][:b_id] #[:b_id]???
  540. @b_p = ContestingProject.find_by_id(@contesting_project_id)
  541. # 把字段存进表中
  542. @b_p.update_reward(params[:set_reward][:reward].to_s)
  543. end
  544. respond_to do |format|
  545. format.js
  546. end
  547. end
  548. def manage
  549. end
  550. private
  551. def find_contest
  552. if params[:id]
  553. @contest = Contest.find(params[:id])
  554. @user = @contest.author
  555. end
  556. rescue
  557. render_404
  558. end
  559. end

软件技术创新是当今国家整体创新能力的重要基础和发展引擎。近年来,大众参与的软件创新与创业活动已经成为网络时代软件开发和应用的新形态,正在快速改变着全球软件创新模式和软件产业格局。 ...