From f2dbbc48fcff8cb17f981a241fc75a78663f64f4 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 8 May 2014 15:06:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E5=93=81=E5=92=8C?= =?UTF-8?q?=E5=85=B3=E8=81=94=E4=BD=9C=E5=93=81=E9=83=BD=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=94=A8=E4=BA=86=EF=BC=8C=E5=8F=82=E8=B5=9B=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E5=8F=96=E5=87=BA=E6=9D=A5=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E6=8E=A5=E4=B8=8B=E6=9D=A5=E9=80=9A=E8=BF=87=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=9D=A5=E5=8E=BB=E5=8F=82=E8=B5=9B=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=92=8C=E5=8F=82=E8=B5=9B=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 19 ++- .../contests/show_attendingcontest.html.erb | 141 ++++++++++++++++++ lib/redmine.rb | 3 +- 3 files changed, 152 insertions(+), 11 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 75778631a..bb5b85a1a 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -292,17 +292,16 @@ class ContestsController < ApplicationController ###我要参赛 def show_attendingcontest - - - - + @softapplication = Softapplication.all + @contesting_softapplication = @contest.contesting_softapplications + @contesting_softapplication = paginateHelper @contesting_softapplication, 10 ##引用base_newcontest整体样式 - respond_to do |format| - format.html { - render :layout => 'base_newcontest' - } - format.api - + @contest = Contest.find_by_id(params[:id]) + respond_to do |format| + format.html { + render :layout => 'base_newcontest' + } + format.api end end diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index e69de29bb..993c63f28 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -0,0 +1,141 @@ + + + + + +
温馨提示:如果您希望在我们平台托管参赛数据和代码,请按下面参赛步骤参赛!
+<% if User.current.logged? %> + +
+
参赛步骤:
+
+ 步骤1: + <%= link_to '新建参赛作品', new_softapplication_path(:target=>'_blank'), :target=>'_blank' %> + (先点击“新建参赛作品”, 然后返回本页继续步骤2即可。) +
+
+ 步骤1: + <%= link_to '关联参赛作品', "javascript:void(0);", onclick: "$('#put-bid-form').toggle();" %> +
+
+ + + + +<% end %> + + + + +<% @contesting_softapplication.each do |c_softapplication|%> + <% if c_softapplication.softapplication %> +
+
+ + 应用软件: + + <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication), :target => '_blank') %> + +
+
+
+ + 简介: + + <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %> + +
+
+
+ + 发布时间: + + <%=format_time c_softapplication.created_at %> + + + +
+
+ <% end %> +
+<% end %> + + + + diff --git a/lib/redmine.rb b/lib/redmine.rb index 583497841..3d3565430 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -281,7 +281,8 @@ Redmine::MenuManager.map :contest_menu do |menu| menu.push :respond, :show_contest_contest_path, :caption => :label_user_response menu.push :project, :show_project_contest_path, :caption => :label_contest_project menu.push :application, :show_softapplication_contest_path, :caption => :label_contest_application - menu.push :attendingcontest, :show_attendingcontest_contest_path, :caption => :label_attending_contest + menu.push :attendingcontest, {:controller => 'contests', :action => 'show_attendingcontest'}, :caption => :label_attending_contest + # menu.push :attendingcontest, :show_attendingcontest_contest_path, :caption => :label_attendin,g_contest # menu.push :result, { :controller => 'bids', :action => 'show_results' }, # :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p } end