From 47b3c55b40267853fc2df8d37e93feac48d3590a Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 15:46:22 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E4=B8=AD=E7=9A=84app=E4=B8=BA=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/contest.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index e32d375d..29b825f4 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -153,9 +153,9 @@ <%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %> <% if contest.id == 2 or contest.id == 3 or contest.id == 6 %> - (<%= link_to("含#{contest.projects.where('is_public=1').count}个app", show_attendingcontest_contest_path(contest), :target => "_blank") %>) + (<%= link_to("含#{contest.projects.where('is_public=1').count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %>) <% else %> - (<%= link_to("含#{contest.contesting_softapplications.count}个app", show_attendingcontest_contest_path(contest), :target => "_blank") %>) + (<%= link_to("含#{contest.contesting_softapplications.count}个作品", show_attendingcontest_contest_path(contest), :target => "_blank") %>) <% end %> From dcc4167e06a58803c8686bc1f23a152e1a68a7a5 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 18:31:04 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E5=B0=86=E7=AB=9E=E8=B5=9B=E4=B8=AD?= =?UTF-8?q?=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E6=96=B9=E5=BC=8F=E6=94=B9=E4=B8=BA=E6=8C=89?= =?UTF-8?q?=E6=89=93=E5=88=86=E9=AB=98=E4=BD=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 7 ++++++- app/views/contests/show_attendingcontest.html.erb | 14 +++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 7741333a..12935d85 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -335,7 +335,12 @@ class ContestsController < ApplicationController end ##取出参赛应用 @softapplication = Softapplication.all - @contesting_softapplication = @contest.contesting_softapplications.reverse + @contesting_softapplication = @contest.contesting_softapplications. + joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id"). + joins("LEFT JOIN seems_rateable_cached_ratings ON seems_rateable_cached_ratings.cacheable_id=softapplications.id"). + where("seems_rateable_cached_ratings.cacheable_type='Softapplication'"). + where("seems_rateable_cached_ratings.dimension = 'quality'"). + order("seems_rateable_cached_ratings.avg").reverse_order @contesting_softapplication = paginateHelper @contesting_softapplication, 10 diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 8a00f12a..062776a0 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -61,13 +61,13 @@ -
+
温馨提示:如果您希望在我们平台托管参赛数据和代码,请按下面参赛步骤参赛!
<% if User.current.logged? %>
-
+
参赛步骤:
@@ -90,7 +90,7 @@ <%= l(:label_softapplication_name) %> * : <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -98,7 +98,7 @@ <%= l(:label_softapplication_version_available) %> * : <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -107,7 +107,7 @@ * : <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -115,7 +115,7 @@ <%= l(:label_softapplication_description) %> * : <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> - +


@@ -123,7 +123,7 @@ <%= l(:label_softapplication_developers) %> * : <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %> - +


From 121b6389d514729f70d5650c2b7c0ebc0bc2b970 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 19:39:58 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E6=9C=80=E7=BB=88=E5=BE=97?= =?UTF-8?q?=E5=88=86=E7=9A=84=E5=88=86=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 4bd6871a..ff2516cc 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -82,6 +82,7 @@
最终得分
+
<%= @softapplication.average(:quality).avg%> 分
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
From 73a82662af73cbcec5b400a3ea8f90a4943de99c Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 19:52:22 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E5=BE=97=E5=88=86=E6=95=B0=E5=80=BC=E4=BF=9D=E7=95=99=E4=B8=A4?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index ff2516cc..80060e5d 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -82,7 +82,7 @@
最终得分
-
<%= @softapplication.average(:quality).avg%> 分
+
<%= @softapplication.average(:quality).avg.round(2)%> 分
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
From 62c81ad8841545b3693393680783398a5c2c758d Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 20:09:13 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E7=BB=99=E7=AB=9E=E8=B5=9B=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9C=80=E7=BB=88=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/show_attendingcontest.html.erb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 062776a0..b6ef0ed4 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -228,11 +228,10 @@
- - 发布时间: - <%= format_time c_softapplication.created_at %> + 发布时间:<%= format_time c_softapplication.created_at %> + 最终得分:<%= c_softapplication.softapplication.average(:quality).avg.round(2)%>分 - +
<% end %> From 81c3659a892c6501e5cfca1bb17249f27306c754 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 20:21:54 +0800 Subject: [PATCH 06/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/show_attendingcontest.html.erb | 10 +++++----- config/locales/zh.yml | 10 +++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index b6ef0ed4..40f9420b 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -88,14 +88,14 @@
- <%= l(:label_softapplication_name) %> + <%= l(:label_work_name) %> * : <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %>


- <%= l(:label_softapplication_version_available) %> + <%= l(:label_running_platform) %> * : <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %>
@@ -103,7 +103,7 @@
- <%= l(:label_softapplication_type) %> + <%= l(:label_work_type) %> * : <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> @@ -112,7 +112,7 @@
- <%= l(:label_softapplication_description) %> + <%= l(:label_work_description) %> * : <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %>
@@ -129,7 +129,7 @@
- 上传应用软件包和应用截图 + 上传作品软件包和作品截图 <%= render_flash_messages %>

diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 774d1fbf..c3c27ec0 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1850,13 +1850,17 @@ zh: label_release_softapplication: 发布应用 label_upload_softapplication_packets: 上传应用软件包 label_upload_softapplication_photo: 上传产品截图 - label_upload_softapplication_packets_mustpacketed: 应用软件作品必须打包后以压缩包的形式上传,便于上传和下载 ; - label_upload_softapplication_photo_condition: 应用软件截图需上传4张;格式为gif/jpg/png, 尺寸480*800, 每张小于2M - label_updated_caution: 注意:若修改应用,则之前上传的软件包和截图都将被删除,请重新上传! + label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载 ; + label_upload_softapplication_photo_condition: 作品截图需上传0~4张;格式为gif/jpg/png, 每张小于5M + label_updated_caution: 注意:若参赛作品,则之前上传的软件包和截图都将被删除,请重新上传! label_softapplication_name: 应用名称 + label_work_name: 作品名称 label_softapplication_description: 应用简介 + label_work_description: 作品简介 label_softapplication_type: 应用分类 + label_work_type: 作品分类 label_softapplication_version_available: 适配版本 + label_running_platform: 运行平台 label_softapplication_developer: 上传人员 label_softapplication_developers: 开发人员 label_softapplication_name_condition: 25个汉字以内(50个字符) From da48b5ba367bda2aa67995a7ea88e2b9647fec57 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 20:56:03 +0800 Subject: [PATCH 07/28] swd --- app/views/softapplications/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 80060e5d..dcbc45f1 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -82,7 +82,7 @@

最终得分
-
<%= @softapplication.average(:quality).avg.round(2)%> 分
+
<%=@softapplication.average(:quality).avg.round(2)%>
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
From cf18b94326898e8d180d171091c40bd96a198292 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Tue, 13 May 2014 08:38:48 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E4=B8=AD=E7=9A=84=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8C=89=E5=BE=97=E5=88=86=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=EF=BC=9B=20=E5=A2=9E=E5=8A=A0=E5=8F=82=E8=B5=9B=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E9=A1=B5=E9=9D=A2=E5=92=8C=E7=AB=9E=E8=B5=9B=E4=B8=AD?= =?UTF-8?q?=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 10 +++++----- app/views/contests/show_attendingcontest.html.erb | 2 +- app/views/softapplications/show.html.erb | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 12935d85..719195cb 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -336,11 +336,11 @@ class ContestsController < ApplicationController ##取出参赛应用 @softapplication = Softapplication.all @contesting_softapplication = @contest.contesting_softapplications. - joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id"). - joins("LEFT JOIN seems_rateable_cached_ratings ON seems_rateable_cached_ratings.cacheable_id=softapplications.id"). - where("seems_rateable_cached_ratings.cacheable_type='Softapplication'"). - where("seems_rateable_cached_ratings.dimension = 'quality'"). - order("seems_rateable_cached_ratings.avg").reverse_order + joins("LEFT JOIN softapplications ON contesting_softapplications.softapplication_id=softapplications.id"). + joins("LEFT JOIN ( + SELECT * FROM seems_rateable_cached_ratings WHERE cacheable_type='Softapplication' AND DIMENSION = 'quality') AS cached + ON cached.cacheable_id=softapplications.id"). + order("cached.avg").reverse_order @contesting_softapplication = paginateHelper @contesting_softapplication, 10 diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 40f9420b..834019c8 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -229,7 +229,7 @@
发布时间:<%= format_time c_softapplication.created_at %> - 最终得分:<%= c_softapplication.softapplication.average(:quality).avg.round(2)%>分 + 最终得分:<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分
diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index dcbc45f1..1dfbf015 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -82,7 +82,7 @@
最终得分
-
<%=@softapplication.average(:quality).avg.round(2)%>
+
<%=@softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
From fc2f35f2477babe01d81242aa9099f6cfa8697e6 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Tue, 13 May 2014 11:44:29 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E5=B0=86=E5=85=B3=E8=81=94=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=95=B4=E5=90=88=E5=88=B0=E6=96=B0=E5=BB=BA=E5=8F=82?= =?UTF-8?q?=E8=B5=9B=E4=BD=9C=E5=93=81=E4=B8=AD=EF=BC=8C=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=85=B3=E8=81=94=E5=88=B0=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../softapplications_controller.rb | 29 +++++++++++++- app/models/contesting_softapplication.rb | 5 +++ .../contests/show_attendingcontest.html.erb | 40 ++++--------------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 9ede5248..6860bfa6 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -100,14 +100,34 @@ class SoftapplicationsController < ApplicationController # POST /softapplications # POST /softapplications.json + # def create + # @softapplication = Softapplication.new(params[:softapplication]) + # @softapplication.user = User.current + # @softapplication.save_attachments(params[:attachments]) + # respond_to do |format| + # if @softapplication.save + # format.js + # format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' } + # # format.json { render json: @softapplication, status: :created, location: @softapplication } + # else + # format.js { render status: 406 } + # format.html { render action: "new" } + # # format.json { render json: @softapplication.errors, status: :unprocessable_entity } + # end + # end + # end + + +#new changed created function def create @softapplication = Softapplication.new(params[:softapplication]) @softapplication.user = User.current @softapplication.save_attachments(params[:attachments]) respond_to do |format| if @softapplication.save + ContestingSoftapplication.create(:contest_id => params[:contest_id], :softapplication_id => @softapplication.id) format.js - format.html { redirect_to @softapplication, notice: 'Softapplication was successfully created.' } + format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]) } # format.json { render json: @softapplication, status: :created, location: @softapplication } else format.js { render status: 406 } @@ -115,8 +135,13 @@ class SoftapplicationsController < ApplicationController # format.json { render json: @softapplication.errors, status: :unprocessable_entity } end end + #关联新建的参赛作品 + + # @contesting_softapplication = paginateHelper @contest.contesting_softapplications + + + end - # PUT /softapplications/1 # PUT /softapplications/1.json def update diff --git a/app/models/contesting_softapplication.rb b/app/models/contesting_softapplication.rb index 93aea265..37ba198b 100644 --- a/app/models/contesting_softapplication.rb +++ b/app/models/contesting_softapplication.rb @@ -11,5 +11,10 @@ class ContestingSoftapplication < ActiveRecord::Base self.create(:user_id => User.current.id, :contest_id => contest_id, :softapplication_id => softapplication_id, :description => description) end + + def self.create_work_contesting(contest_id, softapplication_id) + self.create(:user_id => User.current.id, :contest_id => contest_id, + :softapplication_id => softapplication_id) + end end diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 834019c8..d1c81316 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -76,17 +76,14 @@ <%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %> (先点击“新建参赛作品”,然后刷新页面,再继续步骤2。)
-
- 步骤2: - <%= link_to '关联参赛作品', "javascript:void(0);", onclick: "$('#put-bid-form').toggle();" %> -
+ - + - - <% end %> From bbd293272da641a5fe074ed4503a37f4245d3219 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Tue, 13 May 2014 16:49:23 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E8=B5=9B?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=89=80=E5=B1=9E=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E7=BD=91=E5=9D=80=EF=BC=9B=20=E5=8F=82=E8=B5=9B=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BD=91=E5=9D=80=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/softapplication.rb | 2 +- .../contests/show_attendingcontest.html.erb | 8 ++ app/views/softapplications/show.html.erb | 3 + config/locales/zh.yml | 1 + ...deposit_project_url_to_softapplications.rb | 5 ++ db/schema.rb | 76 ++++++++++++++----- 6 files changed, 77 insertions(+), 18 deletions(-) create mode 100644 db/migrate/20140513073801_add_deposit_project_url_to_softapplications.rb diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb index 6782b243..3911424e 100644 --- a/app/models/softapplication.rb +++ b/app/models/softapplication.rb @@ -1,5 +1,5 @@ class Softapplication < ActiveRecord::Base - attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers + attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url acts_as_attachable seems_rateable :allow_update => true, :dimensions => :quality diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index d1c81316..06ef0533 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -124,6 +124,14 @@

+ + <%= l(:label_work_deposit_project_url) %>: + <%= f.text_field :deposit_project_url, :required => true, :size => 60, :style => "width:378px;" %> + +
+
+
+
上传作品软件包和作品截图 diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 1dfbf015..3f7e689a 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -47,6 +47,9 @@ 平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %> 发布时间:<%=format_time @softapplication.created_at %> + + 托管项目网址:<%=@softapplication.deposit_project_url%>> + diff --git a/config/locales/zh.yml b/config/locales/zh.yml index c3c27ec0..18f05763 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1863,6 +1863,7 @@ zh: label_running_platform: 运行平台 label_softapplication_developer: 上传人员 label_softapplication_developers: 开发人员 + label_work_deposit_project_url: 托管项目网址 label_softapplication_name_condition: 25个汉字以内(50个字符) label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。 label_contest_description_no: 暂无描述。 diff --git a/db/migrate/20140513073801_add_deposit_project_url_to_softapplications.rb b/db/migrate/20140513073801_add_deposit_project_url_to_softapplications.rb new file mode 100644 index 00000000..dd01cdab --- /dev/null +++ b/db/migrate/20140513073801_add_deposit_project_url_to_softapplications.rb @@ -0,0 +1,5 @@ +class AddDepositProjectUrlToSoftapplications < ActiveRecord::Migration + def change + add_column :softapplications, :deposit_project_url, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index fe23a1ca..c96659ab 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140428013546) do +ActiveRecord::Schema.define(:version => 20140513073801) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -23,6 +23,15 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 @@ -518,6 +527,14 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "news", ["created_on"], :name => "index_news_on_created_on" add_index "news", ["project_id"], :name => "news_project_id" + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "open_id_authentication_associations", :force => true do |t| t.integer "issued" t.integer "lifetime" @@ -533,6 +550,19 @@ ActiveRecord::Schema.define(:version => 20140428013546) do t.string "salt", :null => false end + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "praise_tread_caches", :force => true do |t| t.integer "object_id", :null => false t.string "object_type" @@ -612,6 +642,24 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "queries", ["project_id"], :name => "index_queries_on_project_id" add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + create_table "relative_memos", :force => true do |t| + t.integer "osp_id", :null => false + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + end + create_table "repositories", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "url", :default => "", :null => false @@ -698,6 +746,7 @@ ActiveRecord::Schema.define(:version => 20140428013546) do t.integer "softapplication_id" t.integer "is_public" t.string "application_developers" + t.string "deposit_project_url" end create_table "students_for_courses", :force => true do |t| @@ -755,11 +804,6 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "time_entries", ["project_id"], :name => "time_entries_project_id" add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - create_table "tmp", :force => true do |t| - t.string "name" - t.string "part_number" - end - create_table "tokens", :force => true do |t| t.integer "user_id", :default => 0, :null => false t.string "action", :limit => 30, :default => "", :null => false @@ -810,6 +854,13 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" + create_table "user_levels", :force => true do |t| + t.integer "user_id" + t.integer "level" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "user_preferences", :force => true do |t| t.integer "user_id", :default => 0, :null => false t.text "others" @@ -820,16 +871,13 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false + t.integer "user_id" t.integer "collaboration" t.integer "influence" t.integer "skill" - t.integer "active" + t.integer "activity" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "level" - t.integer "file" - t.integer "issue" end create_table "user_statuses", :force => true do |t| @@ -966,10 +1014,4 @@ ActiveRecord::Schema.define(:version => 20140428013546) do add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - create_table "yans", :force => true do |t| - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - end From 69c1ddad5c4f410f0784e95431e938fd2018d8be Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Tue, 13 May 2014 17:18:06 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=8F=82=E8=B5=9B?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=89=98=E7=AE=A1?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BD=91=E5=9D=80=E5=B9=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E7=9B=B8=E5=85=B3=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contests/show_attendingcontest.html.erb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 06ef0533..5aff8d1e 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -61,21 +61,22 @@ -
- 温馨提示:如果您希望在我们平台托管参赛数据和代码,请按下面参赛步骤参赛! +
+ 温馨提示:如果您准备参加竞赛,请点击下面的"新建参赛作品"!
<% if User.current.logged? %> -
-
- 参赛步骤: +
+
+ 参加竞赛: + <%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %>
-
+
@@ -131,6 +132,7 @@


+
From a8b58016fae84347dd19c74c344ceb911b84ffa0 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 14 May 2014 09:09:49 +0800 Subject: [PATCH 12/28] df --- app/views/softapplications/show.html.erb | 3 +-- db/schema.rb | 7 +++++-- lib/redmine.rb | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 3f7e689a..09eb18ae 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -10,7 +10,6 @@

<%= notice %>

-
@@ -48,7 +47,7 @@ 发布时间:<%=format_time @softapplication.created_at %> - 托管项目网址:<%=@softapplication.deposit_project_url%>> + 托管项目网址:<%=@softapplication.deposit_project_url%> diff --git a/db/schema.rb b/db/schema.rb index c96659ab..fb241ac0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -871,13 +871,16 @@ ActiveRecord::Schema.define(:version => 20140513073801) do add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" create_table "user_scores", :force => true do |t| - t.integer "user_id" + t.integer "user_id", :null => false t.integer "collaboration" t.integer "influence" t.integer "skill" - t.integer "activity" + t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "level" + t.integer "file" + t.integer "issue" end create_table "user_statuses", :force => true do |t| diff --git a/lib/redmine.rb b/lib/redmine.rb index d22feb9f..3d356543 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -279,8 +279,8 @@ end ###new add by linchun 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 :project, :show_project_contest_path, :caption => :label_contest_project + menu.push :application, :show_softapplication_contest_path, :caption => :label_contest_application 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' }, From 65340f604d5c2ced1bf670b5f8175898ff58049b Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 14 May 2014 09:23:04 +0800 Subject: [PATCH 13/28] sdf --- config/routes.rb | 1 + lib/redmine.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index a64acb2c..62d77307 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -127,6 +127,7 @@ RedmineApp::Application.routes.draw do match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register' match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password' match 'account/activate', :to => 'account#activate', :via => :get + match 'account/valid_ajax', :to => 'account#valid_ajax', :via => :get match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put] match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put] diff --git a/lib/redmine.rb b/lib/redmine.rb index 3d356543..d22feb9f 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -279,8 +279,8 @@ end ###new add by linchun 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 :project, :show_project_contest_path, :caption => :label_contest_project + #menu.push :application, :show_softapplication_contest_path, :caption => :label_contest_application 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' }, From 4ea861194260b4e9d1a5159ae459ccb2ae5a069e Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 14 May 2014 16:19:12 +0800 Subject: [PATCH 14/28] =?UTF-8?q?=E6=95=99=E5=B8=88=E8=AF=84=E5=A5=96?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 40 ++++++- app/helpers/contests_helper.rb | 4 + app/models/contesting_softapplication.rb | 8 ++ ...eward.js.erb => set_reward_project.js.erb} | 7 +- .../set_reward_softapplication.js.erb | 30 +++++ .../contests/show_attendingcontest.html.erb | 111 ++++++++++++++++++ config/routes.rb | 22 ++-- 7 files changed, 207 insertions(+), 15 deletions(-) rename app/views/contests/{set_reward.js.erb => set_reward_project.js.erb} (87%) create mode 100644 app/views/contests/set_reward_softapplication.js.erb diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 719195cb..debda938 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -5,7 +5,7 @@ class ContestsController < ApplicationController menu_item :project, :only => :show_project menu_item :application, :only => :show_softapplication menu_item :attendingcontest, :only => :show_attendingcontest - before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward, + before_filter :find_contest, :only => [:show_contest, :show_project, :show_softapplication, :show_attendingcontest, :set_reward_project, :set_reward_softapplication, :create,:destroy,:more,:back,:add,:add_softapplication,:new,:show_results, :set_reward, :show_contest_project, :show_contest_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings] # added by fq @@ -355,6 +355,44 @@ class ContestsController < ApplicationController end ###end + + def set_reward_project + @c_p = nil + @contesting_project_id = nil + + if params[:set_reward_project][:reward]&&((User.current.id==@contest.author_id)||User.current.admin) + # @bid_id = params[:id] + @contesting_project_id = params[:set_reward_project][:c_id] + @c_p = ContestingProject.find_by_id(@contesting_project_id) + + # 把字段存进表中 + @c_p.update_reward(params[:set_reward_project][:reward].to_s) + end + + respond_to do |format| + format.js + end + end + + def set_reward_softapplication + @c_sa = nil + @contesting_softapplication_id = nil + + if params[:set_reward_softapplication][:reward]&&((User.current.id==@contest.author_id)||User.current.admin) + # @bid_id = params[:id] + @contesting_softapplication_id = params[:set_reward_softapplication][:c_id] + @c_sa = ContestingSoftapplication.find_by_id(@contesting_softapplication_id) + + # 把字段存进表中 + @c_sa.update_reward(params[:set_reward_softapplication][:reward].to_s) + end + + respond_to do |format| + format.js + end + end + + ###添加已创建的参赛项目 def add project = Project.find(params[:contest]) diff --git a/app/helpers/contests_helper.rb b/app/helpers/contests_helper.rb index 36f2351c..fff2f785 100644 --- a/app/helpers/contests_helper.rb +++ b/app/helpers/contests_helper.rb @@ -91,6 +91,10 @@ module ContestsHelper def get_prize(c_project) c_project.get_reward end + + def get_prize(c_softapplication) + c_softapplication.get_reward + end def count_contest_project contests = Contest.find(:id) diff --git a/app/models/contesting_softapplication.rb b/app/models/contesting_softapplication.rb index 37ba198b..f880818d 100644 --- a/app/models/contesting_softapplication.rb +++ b/app/models/contesting_softapplication.rb @@ -16,5 +16,13 @@ class ContestingSoftapplication < ActiveRecord::Base self.create(:user_id => User.current.id, :contest_id => contest_id, :softapplication_id => softapplication_id) end + + def update_reward(which) + self.update_attribute(:reward,which) + end + + def get_reward + self.reward + end end diff --git a/app/views/contests/set_reward.js.erb b/app/views/contests/set_reward_project.js.erb similarity index 87% rename from app/views/contests/set_reward.js.erb rename to app/views/contests/set_reward_project.js.erb index d6d8c4f9..c0de3e2e 100644 --- a/app/views/contests/set_reward.js.erb +++ b/app/views/contests/set_reward_project.js.erb @@ -1,15 +1,14 @@ $('#reward_result_<%= @contesting_project_id %>').html('<%= j( -if get_prize(@b_p).nil? or get_prize(@b_p) == "" +if get_prize(@c_p).nil? or get_prize(@c_p) == "" if @contest.deadline < Date.today puts '未评奖' end else - case get_prize(@b_p) + case get_prize(@c_p) when '-1' image_tag("/images/bid/special_reward.png") - when '1' when '0' image_tag("/images/bid/first_reward.png") when '1' @@ -22,7 +21,7 @@ else image_tag("/images/bid/fifth_reward.png") when '5' image_tag("/images/bid/qualified.png") - end + end end ) diff --git a/app/views/contests/set_reward_softapplication.js.erb b/app/views/contests/set_reward_softapplication.js.erb new file mode 100644 index 00000000..a8cf0d48 --- /dev/null +++ b/app/views/contests/set_reward_softapplication.js.erb @@ -0,0 +1,30 @@ +$('#reward_result_<%= @contesting_softapplication_id %>').html('<%= j( + +if get_prize(@c_sa).nil? or get_prize(@c_sa) == "" + if @contest.deadline < Date.today + puts '未评奖' + end +else + + case get_prize(@c_sa) + when '-1' + image_tag("/images/bid/special_reward.png") + when '0' + image_tag("/images/bid/first_reward.png") + when '1' + image_tag("/images/bid/second_reward.png") + when '2' + image_tag("/images/bid/third_reward.png") + when '3' + image_tag("/images/bid/forth_reward.png") + when '4' + image_tag("/images/bid/fifth_reward.png") + when '5' + image_tag("/images/bid/qualified.png") + end + +end +) +%>') + +$('#<%= @contesting_softapplication_id %>').hide() diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 5aff8d1e..c556a6e5 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -193,6 +193,61 @@
+
+ + + + + <% if get_prize(c_project).nil? or get_prize(c_project) == "" %> + <% if @contest.deadline < Date.today %> + <%= l(:label_noawards)%> + <% end %> + <% else %> + <% case get_prize(c_project) %> + <% when '-1' %> + <%= image_tag("/images/bid/special_reward.png")%> + <% when '0' %> + <%= image_tag("/images/bid/first_reward.png")%> + <% when '1' %> + <%= image_tag("/images/bid/second_reward.png")%> + <% when '2' %> + <%= image_tag("/images/bid/third_reward.png")%> + <% when '3' %> + <%= image_tag("/images/bid/forth_reward.png")%> + <% when '4' %> + <%= image_tag("/images/bid/fifth_reward.png")%> + <% when '5' %> + <%= image_tag("/images/bid/qualified.png")%> + <% end %> + <% end %> + + + + + + <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> + + <%= toggle_link '评价', c_project.id.to_s %> + + + + <% end %> + + + +
<% end %>
@@ -219,6 +274,62 @@
+ +
+ + + + + <% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %> + <% if @contest.deadline < Date.today %> + <%= l(:label_noawards)%> + <% end %> + <% else %> + <% case get_prize(c_softapplication) %> + <% when '-1' %> + <%= image_tag("/images/bid/special_reward.png")%> + <% when '0' %> + <%= image_tag("/images/bid/first_reward.png")%> + <% when '1' %> + <%= image_tag("/images/bid/second_reward.png")%> + <% when '2' %> + <%= image_tag("/images/bid/third_reward.png")%> + <% when '3' %> + <%= image_tag("/images/bid/forth_reward.png")%> + <% when '4' %> + <%= image_tag("/images/bid/fifth_reward.png")%> + <% when '5' %> + <%= image_tag("/images/bid/qualified.png")%> + <% end %> + <% end %> + + + + + + <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> + + <%= toggle_link '评价', c_softapplication.id.to_s %> + + + + <% end %> + + + +
<% end %>
diff --git a/config/routes.rb b/config/routes.rb index 62d77307..a858b204 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -67,16 +67,18 @@ RedmineApp::Application.routes.draw do end member do match 'add_softapplication' - match 'update_contest' , via: [:put] - match 'show_contest' , via: :get - match 'show_project' , via: :get - match 'show_softapplication' , via: :get - match 'show_attendingcontest' , via: :get - match 'show_participator' , via: :get - match 'add' , via: [:get, :post] - match 'add_softapplication' , via: [:get, :post] - match 'create' , via: :post - match 'settings' , via: [:get, :post] + match 'update_contest' , via: [:put] + match 'show_contest' , via: :get + match 'show_project' , via: :get + match 'show_softapplication' , via: :get + match 'show_attendingcontest' , via: :get + match 'show_participator' , via: :get + match 'set_reward_project' , via: [:get, :post] + match 'set_reward_softapplication' , via: [:get, :post] + match 'add' , via: [:get, :post] + match 'add_softapplication' , via: [:get, :post] + match 'create' , via: :post + match 'settings' , via: [:get, :post] end end From d019a4d9ce5bdf40c63fd5d776ba1195b2faae7b Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 14 May 2014 16:29:46 +0800 Subject: [PATCH 15/28] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BA=86=EF=BC=9A=E8=AF=84=E5=A5=96=EF=BC=8C=E6=9A=82=E6=9C=AA?= =?UTF-8?q?=E8=AF=84=E5=A5=96=EF=BC=8C=E6=9C=AA=E8=AF=84=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/show_attendingcontest.html.erb | 4 ++++ config/locales/zh.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index c556a6e5..04ba3a61 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -201,6 +201,8 @@ <% if get_prize(c_project).nil? or get_prize(c_project) == "" %> <% if @contest.deadline < Date.today %> <%= l(:label_noawards)%> + <% else%> + <%= l(:label_noawards_current)%> <% end %> <% else %> <% case get_prize(c_project) %> @@ -283,6 +285,8 @@ <% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %> <% if @contest.deadline < Date.today %> <%= l(:label_noawards)%> + <% else%> + <%= l(:label_noawards_current)%> <% end %> <% else %> <% case get_prize(c_softapplication) %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 18f05763..fb6e10f5 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1893,6 +1893,7 @@ zh: label_relation_files: 关联已有资源 label_contest_settings: 配置竞赛 label_contest_delete: 删除竞赛 + label_noawards_current: 暂未评奖 # ajax异步验证 modal_valid_passing: 可以使用 From 75853bca014454f4a747a9b3154a1a35e2bd2f79 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 14 May 2014 17:15:19 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E4=B8=AD=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E5=90=84=E9=A1=B9?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contests/show_attendingcontest.html.erb | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 04ba3a61..f3f788c6 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -229,7 +229,7 @@ <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> - <%= toggle_link '评价', c_project.id.to_s %> + <%= toggle_link '评奖', c_project.id.to_s %>
+
- 简介: + 简介: <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %>
-
- 发布时间:<%= format_time c_softapplication.created_at %> - 最终得分:<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分 - - + +
+ 发布时间:<%= format_time c_softapplication.created_at %> + 发布人员:<%= c_softapplication.softapplication.user.name %>
+ -
- - +
+ 最终得分:<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分 + + - + <% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %> <% if @contest.deadline < Date.today %> - <%= l(:label_noawards)%> + <%= l(:label_noawards)%> <% else%> - <%= l(:label_noawards_current)%> + <%= l(:label_noawards_current)%> <% end %> <% else %> <% case get_prize(c_softapplication) %> @@ -313,7 +315,7 @@ <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> - <%= toggle_link '评价', c_softapplication.id.to_s %> + <%= toggle_link '评奖', c_softapplication.id.to_s %> <% end %> - - - +
<% end %> From fd87245251e49b8c7298a960fb4b61a0f4f2fbd1 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 14 May 2014 17:27:20 +0800 Subject: [PATCH 17/28] sdew --- app/views/contests/show_attendingcontest.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index f3f788c6..df6b8194 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -265,7 +265,7 @@
-
+
简介: <%= c_softapplication.softapplication.description.truncate(90, omission: '...') %> From cea41a7aab2de88ee9145d3366c2809b4c026fb0 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Wed, 14 May 2014 18:10:08 +0800 Subject: [PATCH 18/28] df --- app/views/contests/show_attendingcontest.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index df6b8194..3a50c3a7 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -273,12 +273,12 @@
- 发布时间:<%= format_time c_softapplication.created_at %> - 发布人员:<%= c_softapplication.softapplication.user.name %> + 参赛时间:<%= format_time c_softapplication.created_at %> + 参赛代表:<%= c_softapplication.softapplication.user.name %>
-
+
最终得分:<%= c_softapplication.softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分 From 1a7c82174c1f6a3b2da4c17543a30bc9de48074e Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Thu, 15 May 2014 10:05:05 +0800 Subject: [PATCH 19/28] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/open_source_projects_helper.rb | 4 ++++ db/migrate/20140515013449_add_author_to_relative_memo.rb | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 db/migrate/20140515013449_add_author_to_relative_memo.rb diff --git a/app/helpers/open_source_projects_helper.rb b/app/helpers/open_source_projects_helper.rb index f758580d..ce1593cf 100644 --- a/app/helpers/open_source_projects_helper.rb +++ b/app/helpers/open_source_projects_helper.rb @@ -34,4 +34,8 @@ module OpenSourceProjectsHelper def get_open_source_projects_by_tag(tag_name) OpenSourceProject.tagged_with(tag_name).order('created_at desc') end + + def show_origin(url) + + end end diff --git a/db/migrate/20140515013449_add_author_to_relative_memo.rb b/db/migrate/20140515013449_add_author_to_relative_memo.rb new file mode 100644 index 00000000..4a9ecd8d --- /dev/null +++ b/db/migrate/20140515013449_add_author_to_relative_memo.rb @@ -0,0 +1,6 @@ +class AddAuthorToRelativeMemo < ActiveRecord::Migration + def change + add_column :relative_memos, :username, :string + add_column :relative_memos, :userhomeurl, :string + end +end From f88322f2a1c374eb2cc1fd2b155e230f763cdb1b Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 10:06:51 +0800 Subject: [PATCH 20/28] =?UTF-8?q?=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=89=98=E7=AE=A1=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BD=91=E5=9D=80+=E8=B6=85=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 09eb18ae..4190330e 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -47,7 +47,8 @@ 发布时间:<%=format_time @softapplication.created_at %> - 托管项目网址:<%=@softapplication.deposit_project_url%> + <%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %> + From 65f1e2a8d132e4d196c5b2f312493686f9642931 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 10:25:24 +0800 Subject: [PATCH 21/28] =?UTF-8?q?=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=89=98=E7=AE=A1=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BD=91=E5=9D=80+=E8=B6=85=E9=93=BE=E6=8E=A5+?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E7=BD=91=E5=9D=80=E6=98=AF=E5=90=A6=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 4190330e..a0270067 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -43,12 +43,15 @@ 开发人员:<%= @softapplication.application_developers %> - 平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %> - 发布时间:<%=format_time @softapplication.created_at %> + 平均评分: <%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %> + 发布时间:<%=format_time @softapplication.created_at %> - <%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %> - + + <% unless @softapplication.deposit_project_url.nil? %> + <%= textilizable ("托管项目网址: " + @softapplication.deposit_project_url) %> + <% end %> + From 74169221a3dc8d671785862b909166bb0cb78b3b Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Thu, 15 May 2014 10:33:52 +0800 Subject: [PATCH 22/28] 1234 --- db/migrate/20140515013449_add_author_to_relative_memo.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/migrate/20140515013449_add_author_to_relative_memo.rb b/db/migrate/20140515013449_add_author_to_relative_memo.rb index 4a9ecd8d..ba097ac4 100644 --- a/db/migrate/20140515013449_add_author_to_relative_memo.rb +++ b/db/migrate/20140515013449_add_author_to_relative_memo.rb @@ -2,5 +2,6 @@ class AddAuthorToRelativeMemo < ActiveRecord::Migration def change add_column :relative_memos, :username, :string add_column :relative_memos, :userhomeurl, :string + add_column :relative_memos, :date_collected, :date end end From bb3536a7d5119d5c201ea3c1765c50298f5827ec Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 10:46:05 +0800 Subject: [PATCH 23/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86=E5=8F=82?= =?UTF-8?q?=E8=B5=9B=E4=BD=9C=E5=93=81=E9=A1=B5=E9=9D=A2=E4=B8=AD=E6=9C=80?= =?UTF-8?q?=E7=BB=88=E5=BE=97=E5=88=86=E5=92=8C=E6=89=93=E5=88=86=E6=80=BB?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E5=92=8C=E4=B8=8B=E9=9D=A2=E6=96=87=E5=AD=97?= =?UTF-8?q?=E7=9A=84=E5=89=A7=E4=B8=AD=E5=AF=B9=E5=85=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/softapplications/show.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index a0270067..c077bc82 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -86,14 +86,14 @@ <% end %>
-
-
最终得分
-
<%=@softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分
-
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
+
+
最终得分
+
<%=@softapplication.average(:quality).try(:avg).try(:round, 2).to_i.to_s%>分
+
<%= rating_for @softapplication, :static => true, dimension: :quality, class: 'rateable div_inline' %>
-
+
打分总人数
-
<%= @softapplication.raters(:quality).count%>
+
<%= @softapplication.raters(:quality).count%>
From a0a2d04bd748d64700aece476de64fe0567366c5 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 15:07:20 +0800 Subject: [PATCH 24/28] =?UTF-8?q?=E5=8F=82=E8=B5=9B=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8F=96=E5=87=BA=E6=8F=90=E4=BA=A4=E7=9A=84=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/show_attendingcontest.html.erb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 3a50c3a7..968ad758 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -187,12 +187,10 @@
- - 发布时间: - <%= format_time c_project.created_at%> - - + 参赛时间:<%= format_time c_project.created_at%> + 参赛代表:<%= c_project.user.name %>
+
From 44ec6eabf63903599e5b384948e264a74d7e859a Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 16:50:30 +0800 Subject: [PATCH 25/28] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E4=B8=AD=E5=8F=82=E8=B5=9B=E5=BA=94=E7=94=A8=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=98=BE=E7=A4=BA=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/show_attendingcontest.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 968ad758..fcf20450 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -312,8 +312,8 @@ <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> - - <%= toggle_link '评奖', c_softapplication.id.to_s %> +
+ <%= toggle_link '评奖', c_softapplication.id.to_s %> - +
<% end %>
From 9cdd101cc7d81e39764fd74f8fc4087e766458cd Mon Sep 17 00:00:00 2001 From: xianbo Date: Thu, 15 May 2014 17:10:02 +0800 Subject: [PATCH 26/28] fix --- app/views/repositories/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 09ab9738..d11fd256 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -36,7 +36,7 @@

git add .

git commit -m "first commit"

git config http.postBuffer 524288000 #设置本地post缓存为500MB

-

git push -u origin master:matser

+

git push -u origin master:master

从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:

@@ -45,7 +45,7 @@

git add .

git commit -m "first commit"

git config http.postBuffer 524288000 #设置本地post缓存为500MB

-

git push -u trustie master:matser

+

git push -u trustie master:master

<%= link_to "李海提供", user_path(646)%>

From 73175aa9b8156eb06c3ee78b5cba9d91a6343995 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 17:26:39 +0800 Subject: [PATCH 27/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A5=BD=E4=BA=86?= =?UTF-8?q?=E5=8F=82=E5=8A=A0=E7=AB=9E=E8=B5=9B=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contests/show_attendingcontest.html.erb | 119 +++++++++--------- 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index fcf20450..09390ffd 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -175,10 +175,63 @@ <% if c_project.project %>
- - 参赛作品: - <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> -
+
+
参赛作品: <%= link_to(c_project.project.name, project_path(c_project.project), :target => '_blank') %> +
+ + + + <% if get_prize(c_project).nil? or get_prize(c_project) == "" %> + <% if @contest.deadline < Date.today %> + <%= l(:label_noawards)%> + <% else%> + <%= l(:label_noawards_current)%> + <% end %> + <% else %> + <% case get_prize(c_project) %> + <% when '-1' %> + <%= image_tag("/images/bid/special_reward.png")%> + <% when '0' %> + <%= image_tag("/images/bid/first_reward.png")%> + <% when '1' %> + <%= image_tag("/images/bid/second_reward.png")%> + <% when '2' %> + <%= image_tag("/images/bid/third_reward.png")%> + <% when '3' %> + <%= image_tag("/images/bid/forth_reward.png")%> + <% when '4' %> + <%= image_tag("/images/bid/fifth_reward.png")%> + <% when '5' %> + <%= image_tag("/images/bid/qualified.png")%> + <% end %> + <% end %> + + + + + + <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> + + <%= toggle_link '评奖', c_project.id.to_s %> + + + + <% end %> +
+
+

@@ -192,61 +245,7 @@
- - - - - <% if get_prize(c_project).nil? or get_prize(c_project) == "" %> - <% if @contest.deadline < Date.today %> - <%= l(:label_noawards)%> - <% else%> - <%= l(:label_noawards_current)%> - <% end %> - <% else %> - <% case get_prize(c_project) %> - <% when '-1' %> - <%= image_tag("/images/bid/special_reward.png")%> - <% when '0' %> - <%= image_tag("/images/bid/first_reward.png")%> - <% when '1' %> - <%= image_tag("/images/bid/second_reward.png")%> - <% when '2' %> - <%= image_tag("/images/bid/third_reward.png")%> - <% when '3' %> - <%= image_tag("/images/bid/forth_reward.png")%> - <% when '4' %> - <%= image_tag("/images/bid/fifth_reward.png")%> - <% when '5' %> - <%= image_tag("/images/bid/qualified.png")%> - <% end %> - <% end %> - - - - - - <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> - - <%= toggle_link '评奖', c_project.id.to_s %> - - - - <% end %> - - - +
<% end %> @@ -284,7 +283,7 @@ <% if get_prize(c_softapplication).nil? or get_prize(c_softapplication) == "" %> <% if @contest.deadline < Date.today %> - <%= l(:label_noawards)%> + <%= l(:label_noawards)%> <% else%> <%= l(:label_noawards_current)%> <% end %> From 84ae8a1cde225ba73aad279be4d953d7bc3ec5f3 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Fri, 16 May 2014 16:22:59 +0800 Subject: [PATCH 28/28] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contests/show_attendingcontest.html.erb | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index 09390ffd..ad822222 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -81,11 +81,11 @@ -