From 47b3c55b40267853fc2df8d37e93feac48d3590a Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Mon, 12 May 2014 15:46:22 +0800 Subject: [PATCH 01/45] =?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 e32d375d0..29b825f40 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/45] =?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 7741333a8..12935d85f 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 8a00f12ae..062776a08 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/45] =?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 4bd6871a0..ff2516ccf 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/45] =?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 ff2516ccf..80060e5d0 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/45] =?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 062776a08..b6ef0ed40 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/45] =?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 b6ef0ed40..40f9420bd 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 774d1fbfb..c3c27ec09 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/45] 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 80060e5d0..dcbc45f14 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/45] =?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 12935d85f..719195cb3 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 40f9420bd..834019c8a 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 dcbc45f14..1dfbf0154 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/45] =?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 9ede52489..6860bfa6a 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 93aea2658..37ba198b8 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 834019c8a..d1c81316a 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/45] =?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 6782b2436..3911424e9 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 d1c81316a..06ef0533f 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 1dfbf0154..3f7e689a8 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 c3c27ec09..18f05763f 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 000000000..dd01cdab5 --- /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 fe23a1caa..c96659ab9 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/45] =?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 06ef0533f..5aff8d1e0 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/45] 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 3f7e689a8..09eb18ae7 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 c96659ab9..fb241ac03 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 d22feb9fc..3d3565430 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/45] 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 a64acb2c6..62d773077 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 3d3565430..d22feb9fc 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/45] =?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 719195cb3..debda938f 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 36f2351cb..fff2f785a 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 37ba198b8..f880818d9 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 d6d8c4f9f..c0de3e2ef 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 000000000..a8cf0d486 --- /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 5aff8d1e0..c556a6e59 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 62d773077..a858b204a 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/45] =?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 c556a6e59..04ba3a61b 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 18f05763f..fb6e10f5a 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/45] =?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 04ba3a61b..f3f788c64 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/45] 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 f3f788c64..df6b81944 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/45] 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 df6b81944..3a50c3a79 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 cea01b4df5795da45bcf43a5e0a0e4823fe6c496 Mon Sep 17 00:00:00 2001 From: nwb Date: Wed, 14 May 2014 18:33:27 +0800 Subject: [PATCH 19/45] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/index.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 0d9a3a21f..08052f11e 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -296,7 +296,7 @@ if (textStatus == 'success') { eval(xhr.responseText); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } }); } @@ -312,7 +312,7 @@ if (textStatus == 'success') { eval(xhr.responseText); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } ; }); @@ -331,7 +331,7 @@ if (textStatus == 'success') { eval(xhr.responseText); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } ; }); @@ -350,7 +350,7 @@ type: "POST" }); } else if (textStatus == 'error') { - alert('error'); + alert('An error has occurred'); } }); } From 6086b25db7bd37f587b041357207ed5db91ffdee Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 09:19:59 +0800 Subject: [PATCH 20/45] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E5=80=92=E5=BA=8F=E5=8E=BB=E6=8E=89=E6=A5=BC=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- app/views/memos/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 20f0b45c4..b4de06fb6 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -94,7 +94,7 @@ class MemosController < ApplicationController @reply_pages = Paginator.new @reply_count, pre_count, page @replies = @memo.children. includes(:author, :attachments). - reorder("#{Memo.table_name}.created_at ASC"). + reorder("#{Memo.table_name}.created_at DESC"). limit(@reply_pages.per_page). offset(@reply_pages.offset). all diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 6ea5b17bc..a40ee631a 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -65,7 +65,7 @@ <% pages_count = @reply_pages.offset %> <% @replies.each do |reply| %>
"> -

<%= pages_count += 1 %>楼 :

+

<%= pages_count += 1 %>楼 :

<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%> -温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~ + <%= watch_projects @state %> <% unless @memberships.empty? %>
diff --git a/app/views/users/watch_projects.html.erb b/app/views/users/watch_projects.html.erb index 7842e6d52..42047d4ea 100644 --- a/app/views/users/watch_projects.html.erb +++ b/app/views/users/watch_projects.html.erb @@ -1,5 +1,5 @@ <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => 0}, :class => 'icon icon-add') if(User.current.allowed_to?(:add_project, nil, :global => true) && @user == User.current)%> -温馨提示:项目可以是一次作业,也可以是别人或者自己创建的一项小工程~ + <%= watch_projects @state%> <% if @watch_projects.count > 0 %> <% for watch_project in @watch_projects %> From f88322f2a1c374eb2cc1fd2b155e230f763cdb1b Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 10:06:51 +0800 Subject: [PATCH 22/45] =?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 09eb18ae7..4190330e7 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 23/45] =?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 4190330e7..a02700675 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 bb3536a7d5119d5c201ea3c1765c50298f5827ec Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 10:46:05 +0800 Subject: [PATCH 24/45] =?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 a02700675..c077bc822 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 c48b850cf7a3a78752ed2642f28d80f9da8532e9 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 10:50:46 +0800 Subject: [PATCH 25/45] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=9E=8B=E4=BD=9C=E4=B8=9A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 11 ++++++++++- app/models/biding_project.rb | 2 +- app/views/bids/_list_projects.html.erb | 7 ++++++- config/routes.rb | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 0c0b71ffa..6a9fb5c29 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -7,7 +7,7 @@ class BidsController < ApplicationController menu_item :homework_respond, :only => :homework_respond menu_item :homework_statistics, :only => :homework_statistics #Ended by young - before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork, + before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:delete,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork, :show_course, :show_bid_project, :show_bid_user, :join_in_contest, :unjoin_in_contest, :new_join,:show_participator, :settings] # added by fq before_filter :require_login, :only => [:join_in_contest, :unjoin_in_contest] @@ -500,6 +500,15 @@ class BidsController < ApplicationController end end + #删除已提交的项目作业(不删项目) + def delete + binding_project = params[:binding_project] + if BidingProject.delete(binding_project) + redirect_to project_for_bid_path + else + redirect_to 403; + end + end ## 新建留言 def create diff --git a/app/models/biding_project.rb b/app/models/biding_project.rb index cc9c1fba2..0b7b3718e 100644 --- a/app/models/biding_project.rb +++ b/app/models/biding_project.rb @@ -19,7 +19,7 @@ class BidingProject < ActiveRecord::Base self.create(:user_id => User.current.id, :bid_id => bid_id, :project_id => project_id, :description => description) end - + # used to update the reward ,the value varies from 0,1,2,3,4,5 # added by william def update_reward(which) diff --git a/app/views/bids/_list_projects.html.erb b/app/views/bids/_list_projects.html.erb index ecbf5dfc3..e51314c48 100644 --- a/app/views/bids/_list_projects.html.erb +++ b/app/views/bids/_list_projects.html.erb @@ -153,7 +153,12 @@ 迟交 <% end %> - <%= link_to image_tag('delete.png') %> + + <% if b_project.user.id == User.current.id || User.current.id == b_project.bid.author.id + %> + <%= link_to image_tag('delete.png'),{ :action => "delete", :binding_project => b_project}, :confirm => "Are you sure?" %> + <% end %> + diff --git a/config/routes.rb b/config/routes.rb index 7d7cb2bbf..a856deaf1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -550,6 +550,7 @@ RedmineApp::Application.routes.draw do match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid' match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid_homework' # by huang match 'calls/:id/add', :controller => 'bids', :action => 'add' + match 'calls/:id/delete', :controller => 'bids', :action => 'delete' match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework', via: :post match 'calls/:id/new_submit_homework', to: 'bids#new_submit_homework', via: :get, as: 'new_submit_homework' match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond' From dcc2789aae9f9ffb8bc70f2e3746f3a275d2640c Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 11:14:44 +0800 Subject: [PATCH 26/45] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E5=9E=8B=E4=BD=9C=E4=B8=9A=E5=B7=B2=E6=8F=90=E4=BA=A4=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_bid_homework_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 9237b2aa8..3ef55c567 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -45,7 +45,7 @@ end %> <% if bid.homework_type == 1%> - <%= l(:label_x_homework_project, :count => @temp.count) %>(<%= link_to @temp.count, project_for_bid_path(bid.id) %>) + <%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %>) <% else %> <%= l(:label_x_homework_project, :count => @temp.count) %>(<%= link_to @temp.count, project_for_bid_path(bid.id) %>) <% end %> From 13a5aa988a69a86a7afb7ada41bd90b881fc41d6 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 11:45:49 +0800 Subject: [PATCH 27/45] issues#623 --- app/controllers/school_controller.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index fdcdb8e8a..f0f5dd70f 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -46,15 +46,17 @@ class SchoolController < ApplicationController @provinces.each do |p| options << "" end - @school = School.all - - + + # 查询已添加用户的学校 + schools_arr = UserExtensions.where("school_id IS NOT NULL").pluck(:school_id).uniq + # 取id取学校名 + school = School.where(id: schools_arr).select("id, name") + options_s = "" - - @school.each do |s| - #options << "" + school.each do |s| options_s << "
  • #{s.name}
  • " end + res = Hash.new res[:text] = options res[:text_s] = options_s From 8ef716b920caf1ad5c254761302b4d39e20bc8fb Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 13:37:24 +0800 Subject: [PATCH 28/45] =?UTF-8?q?1.=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=95=99=E8=A8=80=E6=98=BE=E7=A4=BA=E5=87=BA=E7=95=99=E8=A8=80?= =?UTF-8?q?=E4=BA=BA=202.=E7=95=99=E8=A8=80=E6=B7=BB=E5=8A=A0=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 9 ++++++--- config/locales/en.yml | 3 +++ config/locales/zh.yml | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index dd912cfe6..2774ea4d4 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -33,14 +33,17 @@ <% when 'JournalsForMessage' %> <% if User.current.login == @user.login %> <%# if e.user_id == act.jour.id %> - <%= link_to("#{e.user.name}", user_path(e.user_id)) %> 有了<%= link_to("#{e.act.user.name}", user_path(e.user.id))%>的留言 + <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= + link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <%# else %> <%# end %> <% else %> - <%= link_to("#{@user.name}", user_path(e.user_id)) %> 有了新的动态 + <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= + link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <% end %> -

    <%=textilizable act.notes %>

    +

    <%=textilizable act.notes %> + <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>

    <%=(l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 4f995d794..9e7e49013 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1306,6 +1306,7 @@ en: label_have_respond: had a respond label_welcome: Welcome + label_goto: Go to>> label_join: join Trustie! label_repository_new: link to existing SVN repository label_repository_path: path of repository @@ -1411,6 +1412,8 @@ en: label_user_activity_myself: About me label_user_all_respond: All replies label_layouts_feedback: Messages + label_have_feedback: Have + label_of_feedback: Of label_welcome_participate: participates #modify by men label_x_welcome_participate: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 6b4a925c8..c39bd7c2d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1495,6 +1495,7 @@ zh: label_issue_praise_over: 我刚才顶过了~ label_issue_tread_over: 我刚才踩过了~ #end + label_goto: 前往>> label_issue_appraise_over: 只能评价一次哦! label_welcome_my_respond: 请在此留下你的意见和建议! label_no_current_fans: 该用户暂无粉丝 @@ -1575,6 +1576,8 @@ zh: label_my_honework_no_homework: 暂无任何作业! label_user_all_respond: 所有反馈 label_layouts_feedback: 留言 + label_have_feedback: 有了 + label_of_feedback: 的 label_welcome_participate: 参与了 #modify by men label_x_welcome_participate: From 0c302c7aea1c122d7e54f54b6cbbcf3fcd16e48a Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 13:53:06 +0800 Subject: [PATCH 29/45] 1s ===> 0.005s --- app/controllers/school_controller.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index f0f5dd70f..ec14ba5c8 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -47,10 +47,14 @@ class SchoolController < ApplicationController options << "" end - # 查询已添加用户的学校 - schools_arr = UserExtensions.where("school_id IS NOT NULL").pluck(:school_id).uniq # 取id取学校名 - school = School.where(id: schools_arr).select("id, name") + # 连接子表: 查询已添加用户的学校 + school = School.select("id, name"). + joins("RIGHT JOIN ( + SELECT DISTINCT school_id + FROM #{UserExtensions.table_name} + WHERE school_id IS NOT NULL) AS sids ON schools.id = sids.school_id"). + where("#{School.table_name}.id IS NOT NULL") options_s = "" school.each do |s| From 4b064f3c2ad82be0add4f3d18e1761530d385e59 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 13:53:45 +0800 Subject: [PATCH 30/45] =?UTF-8?q?1.=E7=94=A8=E6=88=B7=E7=95=99=E8=A8=80?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=AB=9E=E8=B5=9B=E7=B1=BB=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=202.=E4=BC=98=E5=8C=96=E8=B7=B3=E8=BD=AC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 2774ea4d4..997ff1728 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -42,9 +42,15 @@ <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <% end %> -

    <%=textilizable act.notes %> - <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>

    - + +

    <%= textilizable act.notes %>

    +
    <%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %> +
    + + + + +
    <%=(l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
    @@ -174,9 +180,26 @@
    <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
    -
    <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.journals.count)%>
    +
    <%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.journals.count)%>
    +<% when 'Contest' %> + + <% if e.user == User.current%> + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> + <% else %> + <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %> + <% end %> + +

    <%= h act.description %>

    + + +
    + <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %> +
    + +<% else %> + <% f=1 %> <% end %> From be73a232e8bc1230c5737e28143bafa6a60a2f24 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 13:58:54 +0800 Subject: [PATCH 31/45] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e03f3e1df..d521d59f5 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -33,7 +33,7 @@ <% when 'JournalsForMessage' %> <% if User.current.login == @user.login %> <%# if e.user_id == act.jour.id %> - <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= + <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%= link_to("#{e.act.user.name}", user_path(e.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %> <%# else %> From f1b086ef90bdfb323e9988bfe5cb2de93fc72a0b Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 14:32:23 +0800 Subject: [PATCH 32/45] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9ppt=E6=96=87=E6=A1=A3=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/attachmentstype.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/attachmentstype.rb b/app/models/attachmentstype.rb index 6a37cc51f..fb774836f 100644 --- a/app/models/attachmentstype.rb +++ b/app/models/attachmentstype.rb @@ -3,7 +3,7 @@ class Attachmentstype < ActiveRecord::Base has_many :attachments, :foreign_key => "attachtype",:primary_key => "id" # 当前使用的文件内容分类列表 - @@SuffixArr = ['pdf','zip','doc','docx','rar','txt','jpg','bmp','xls','xlsx'] + @@SuffixArr = ['pdf','zip','doc','docx','ppt','pptx','rar','txt','jpg','bmp','xls','xlsx'] def suffixArr @@SuffixArr From a0a2d04bd748d64700aece476de64fe0567366c5 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 15:07:20 +0800 Subject: [PATCH 33/45] =?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 3a50c3a79..968ad7588 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 4db228f88e26ed957e9827d07dba2aa07b1f66c9 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 15:52:25 +0800 Subject: [PATCH 34/45] =?UTF-8?q?=E8=B0=83=E6=95=B4tag=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA=E5=95=A5=E8=A6=81=E4=BF=AE=E6=94=B9=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=9C=B0=E6=96=B9=E6=88=91=E8=87=AA=E5=B7=B1=E4=B9=9F=E5=BF=98?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E6=94=B9=E5=A4=A9=E5=86=8D=E8=AF=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/index.html.erb | 2 +- public/stylesheets/nyan.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 02268746d..a4f63e4b2 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -82,7 +82,7 @@ var $tags = $td_tags_area.find('#tags') var $icona = $td_tags_area.find('.tags_icona') - var slideHeight = 5; //px + var slideHeight = 13; //px var defHeight = $tags.height(); var curHeight = $tags_area.height(); diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 24fffd20f..e1088c8c0 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -950,7 +950,7 @@ div.issue { /* project 文件列表 资源库 *******************************************************************************/ .tags_area { - height: 5px; + height: 13px; } #ver-zebra, .file_table_des { From a794d612afe07a4332a1e5e76b3e9667b0cd6454 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 15:53:28 +0800 Subject: [PATCH 35/45] =?UTF-8?q?=E4=BB=8E=E4=B8=BB=E9=A1=B5=E7=99=BB?= =?UTF-8?q?=E9=99=86=E6=97=B6=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 769214d65..039080dad 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - rescue AuthSourceException => e - logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - render_error :message => e.message + #rescue AuthSourceException => e + # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + # render_error :message => e.message end # Log out current user and redirect to welcome page @@ -261,9 +261,18 @@ class AccountController < ApplicationController end call_hook(:controller_account_success_authentication_after, {:user => user }) #by young -# redirect_back_or_default my_page_path - redirect_back_or_default User.current -# redirect_to User.current + code = // + #根据home_url生产正则表达式 + class_eval("code = " + "/" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index)?\/") + if code.match(params[:back_url]) + redirect_to user_activities_path(user) + else + #redirect_back_or_default my_page_path + redirect_back_or_default User.current + #redirect_to User.current + end + + end def set_autologin_cookie(user) From 06706b577da09742f49ae552242512fab9617dca Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 16:27:56 +0800 Subject: [PATCH 36/45] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E3=80=81=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=E5=9B=9E=E5=A4=8D=E7=9A=84=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 4 ++-- app/views/messages/show.html.erb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index a40ee631a..642d71649 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -65,7 +65,7 @@ <% pages_count = @reply_pages.offset %> <% @replies.each do |reply| %>
    "> -

    <%= pages_count += 1 %>楼 :

    +

    + <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %>
    <%= link_to( @@ -150,7 +151,7 @@
    - <%= link_to image_tag(url_to_avatar(message.author), :class => "avatar"), user_path(message.author) %> +
    <%= textilizable message, :content, :attachments => message.attachments %> From 44ec6eabf63903599e5b384948e264a74d7e859a Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Thu, 15 May 2014 16:50:30 +0800 Subject: [PATCH 37/45] =?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 968ad7588..fcf204500 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 f218b873382bfb6853a305016368f745c742c5dd Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 16:59:15 +0800 Subject: [PATCH 38/45] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E7=BC=BA=E9=99=B7=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 7 ++++++- app/models/journal.rb | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index b69ac246c..d2332350a 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -57,7 +57,7 @@ class Issue < ActiveRecord::Base :include => [:project, :visible_journals], # sort by id so that limited eager loading doesn't break with postgresql :order_column => "#{table_name}.id" - acts_as_event :title => Proc.new {|o| + acts_as_event :title => Proc.new {|o| #"#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}" "#{o.tracker.name} #{o.source_from} (#{o.status}): #{o.subject}" }, @@ -991,6 +991,11 @@ class Issue < ActiveRecord::Base "#{tracker} ##{id}: #{subject}" end + # 缺陷在项目中的序号 + def inProjectIndex + (self.project.issues.index(self).to_i + 1).to_s + end + # Returns a string of css classes that apply to the issue def css_classes s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}" diff --git a/app/models/journal.rb b/app/models/journal.rb index 02d313731..0997640d8 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -29,8 +29,8 @@ class Journal < ActiveRecord::Base # end attr_accessor :indice - acts_as_event :title => Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.id}#{status}: #{o.issue.subject}" }, - :description => :notes, + acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.inProjectIndex}#{status}: #{o.issue.subject}" }, + :description =>:notes, :author => :user, :group => :issue, :type => Proc.new {|o| (s = o.new_status) ? (s.is_closed? ? 'issue-closed' : 'issue-edit') : 'issue-note' }, From 9cdd101cc7d81e39764fd74f8fc4087e766458cd Mon Sep 17 00:00:00 2001 From: xianbo Date: Thu, 15 May 2014 17:10:02 +0800 Subject: [PATCH 39/45] 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 09ab9738f..d11fd2564 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 40/45] =?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 fcf204500..09390ffd2 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 03dbcb116879dcda1b8f51cfafa316534e4c3c98 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 15 May 2014 17:33:01 +0800 Subject: [PATCH 41/45] acount --- app/controllers/account_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 039080dad..5e9a0bc40 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - #rescue AuthSourceException => e - # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - # render_error :message => e.message + rescue AuthSourceException => e + logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + render_error :message => e.message end # Log out current user and redirect to welcome page From 4f7087f9aea3a9bcb7a1d46ddd101f2a37ad8ba5 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 15 May 2014 17:36:39 +0800 Subject: [PATCH 42/45] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=B8=BA=E5=8F=AA=E6=9C=89=E7=9A=84=E6=95=99=E5=B8=88=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E6=9F=A5=E7=9C=8B=E5=AD=A6=E7=94=9F=E5=AD=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 11 +++++++++++ app/views/projects/_member_list.html.erb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 01021cb57..116ccd5d7 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -812,6 +812,8 @@ class ProjectsController < ApplicationController @render_file = 'member_list' # 判断是否课程 if @project.project_type == Project::ProjectType_course + @teachers= searchTeacherAndAssistant(@project) + @canShowCode = isCourseTeacher(User.current.id) case params[:role] when '1' @subPage_title = l :label_teacher_list @@ -833,6 +835,15 @@ class ProjectsController < ApplicationController render :layout => 'base_courses' if @project.project_type == 1 end + #判断指定用户是否为课程教师 + def isCourseTeacher(id) + result = false + if @teachers.find_by_user_id(id) != nil + result = true + end + result + end + def sort_project_members project, members #userGrade = UserGrade.where(:project_id => project.id) users = UserGrade.where(:project_id => project.id). diff --git a/app/views/projects/_member_list.html.erb b/app/views/projects/_member_list.html.erb index ce5dfc694..6fe6b55f0 100644 --- a/app/views/projects/_member_list.html.erb +++ b/app/views/projects/_member_list.html.erb @@ -12,7 +12,7 @@ <% if @project.project_type == 1 %> <% unless member.user.user_extensions.identity ==0 %> - <% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil?) %> + <%if @canShowCode# if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil?) %> <%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %> <% end %> <% end %> From 53a9d2929241dfe4884af4ed6f295bcdfce1b4d6 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 17:41:45 +0800 Subject: [PATCH 43/45] Revert "acount" This reverts commit 03dbcb116879dcda1b8f51cfafa316534e4c3c98. --- app/controllers/account_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 38afb7a28..5f20ec912 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - rescue AuthSourceException => e - logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - render_error :message => e.message + #rescue AuthSourceException => e + # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + # render_error :message => e.message end # Log out current user and redirect to welcome page From be87e02e4c5c89d88e528a0c45236238ae2fb762 Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 15 May 2014 17:41:53 +0800 Subject: [PATCH 44/45] =?UTF-8?q?Revert=20"=E4=BB=8E=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=99=BB=E9=99=86=E6=97=B6=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=BB=E9=A1=B5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a794d612afe07a4332a1e5e76b3e9667b0cd6454. --- app/controllers/account_controller.rb | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 5f20ec912..cf39898fe 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -31,9 +31,9 @@ class AccountController < ApplicationController else authenticate_user end - #rescue AuthSourceException => e - # logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" - # render_error :message => e.message + rescue AuthSourceException => e + logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" + render_error :message => e.message end # Log out current user and redirect to welcome page @@ -277,18 +277,9 @@ class AccountController < ApplicationController end call_hook(:controller_account_success_authentication_after, {:user => user }) #by young - code = // - #根据home_url生产正则表达式 - class_eval("code = " + "/" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index)?\/") - if code.match(params[:back_url]) - redirect_to user_activities_path(user) - else - #redirect_back_or_default my_page_path - redirect_back_or_default User.current - #redirect_to User.current - end - - +# redirect_back_or_default my_page_path + redirect_back_or_default User.current +# redirect_to User.current end def set_autologin_cookie(user) From 84ae8a1cde225ba73aad279be4d953d7bc3ec5f3 Mon Sep 17 00:00:00 2001 From: wanglinchun Date: Fri, 16 May 2014 16:22:59 +0800 Subject: [PATCH 45/45] =?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 09390ffd2..ad8222224 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -81,11 +81,11 @@
    -