- <% if !course_endTime_timeout?(course) %>
+
<%end%>
<% end; reset_cycle %>
diff --git a/db/schema.rb b/db/schema.rb
index 72e6ccba9..7643adb4b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -177,6 +177,58 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
+ create_table "code_review_assignments", :force => true do |t|
+ t.integer "issue_id"
+ t.integer "change_id"
+ t.integer "attachment_id"
+ t.string "file_path"
+ t.string "rev"
+ t.string "rev_to"
+ t.string "action_type"
+ t.integer "changeset_id"
+ end
+
+ create_table "code_review_project_settings", :force => true do |t|
+ t.integer "project_id"
+ t.integer "tracker_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "updated_by"
+ t.boolean "hide_code_review_tab", :default => false
+ t.integer "auto_relation", :default => 1
+ t.integer "assignment_tracker_id"
+ t.text "auto_assign"
+ t.integer "lock_version", :default => 0, :null => false
+ t.boolean "tracker_in_review_dialog", :default => false
+ end
+
+ create_table "code_review_user_settings", :force => true do |t|
+ t.integer "user_id", :default => 0, :null => false
+ t.integer "mail_notification", :default => 0, :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "code_reviews", :force => true do |t|
+ t.integer "project_id"
+ t.integer "change_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "line"
+ t.integer "updated_by_id"
+ t.integer "lock_version", :default => 0, :null => false
+ t.integer "status_changed_from"
+ t.integer "status_changed_to"
+ t.integer "issue_id"
+ t.string "action_type"
+ t.string "file_path"
+ t.string "rev"
+ t.string "rev_to"
+ t.integer "attachment_id"
+ t.integer "file_count", :default => 0, :null => false
+ t.boolean "diff_all"
+ end
+
create_table "comments", :force => true do |t|
t.string "commented_type", :limit => 30, :default => "", :null => false
t.integer "commented_id", :default => 0, :null => false
@@ -367,9 +419,9 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
t.string "web_title"
t.string "title"
t.text "description"
- t.string "page_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
+ t.string "page_type"
t.integer "sort_type"
t.integer "image_width", :default => 107
t.integer "image_height", :default => 63
@@ -795,18 +847,18 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
+ t.string "subject", :null => false
+ t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
- t.integer "replies_count", :default => 0
+ 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.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"
t.string "username"
t.string "userhomeurl"
@@ -830,6 +882,19 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
+ create_table "rich_rich_files", :force => true do |t|
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "rich_file_file_name"
+ t.string "rich_file_content_type"
+ t.integer "rich_file_file_size"
+ t.datetime "rich_file_updated_at"
+ t.string "owner_type"
+ t.integer "owner_id"
+ t.text "uri_cache"
+ t.string "simplified_type", :default => "file"
+ end
+
create_table "roles", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.integer "position", :default => 1
@@ -880,10 +945,11 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
t.string "url"
t.string "title"
t.integer "share_type"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.integer "project_id"
t.integer "user_id"
+ t.string "description"
end
create_table "softapplications", :force => true do |t|
@@ -989,8 +1055,8 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
t.integer "zip_code"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
- t.integer "identity"
t.string "technical_title"
+ t.integer "identity"
t.string "student_id"
t.string "teacher_realname"
t.string "student_realname"
@@ -1048,9 +1114,6 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
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|
From 9e5f7e6fc625f0678805968906242c8ddaba0ede Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 1 Aug 2014 14:36:41 +0800
Subject: [PATCH 02/27] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/softapplications_controller.rb | 4 ++--
app/models/softapplication.rb | 2 +-
db/schema.rb | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb
index f2b0a0c83..067465b40 100644
--- a/app/controllers/softapplications_controller.rb
+++ b/app/controllers/softapplications_controller.rb
@@ -156,8 +156,8 @@ class SoftapplicationsController < ApplicationController
format.html { redirect_to show_attendingcontest_contest_path(:id => params[:contest_id]), notice: l(:notice_attendingcontest_work_successfully_created) }
# format.json { render json: @softapplication, status: :created, location: @softapplication }
else
- format.js { render status: 406 }
- format.html { render action: "new" }
+ #format.js { render status: 406 }
+ format.html { render action: "contests/show_attendingcontest" }
# format.json { render json: @softapplication.errors, status: :unprocessable_entity }
end
end
diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb
index a572a22ba..0234bc118 100644
--- a/app/models/softapplication.rb
+++ b/app/models/softapplication.rb
@@ -11,7 +11,7 @@ class Softapplication < ActiveRecord::Base
belongs_to :project
has_many :contests, :through => :contesting_softapplications
- validates_length_of :name, :maximum => 125
+ validates_length_of :name, :maximum => 25
validates_length_of :application_developers, :maximum => 125
validates_length_of :android_min_version_available, :maximum => 125
diff --git a/db/schema.rb b/db/schema.rb
index 7643adb4b..9407794f4 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 => 20140730024419) do
+ActiveRecord::Schema.define(:version => 20140801034242) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
From aa0caff0778e0b208996312c8b3b0672dec0dcdd Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 1 Aug 2014 14:37:44 +0800
Subject: [PATCH 03/27] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=E6=8F=8F=E8=BF=B0?=
=?UTF-8?q?=E4=BB=8D=E4=B8=BA=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA=E5=8C=BA?=
=?UTF-8?q?=E7=9A=84=E6=8F=8F=E8=BF=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20140801034242_change_boards_name.rb | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 db/migrate/20140801034242_change_boards_name.rb
diff --git a/db/migrate/20140801034242_change_boards_name.rb b/db/migrate/20140801034242_change_boards_name.rb
new file mode 100644
index 000000000..3f4593710
--- /dev/null
+++ b/db/migrate/20140801034242_change_boards_name.rb
@@ -0,0 +1,20 @@
+# -*coding:utf-8 -*-
+class ChangeBoardsName < ActiveRecord::Migration
+ def up
+ boards = Board.where("project_id <> -1 and name like '%课程讨论区%'")
+ boards.each do |board|
+ board.name = "项目讨论区"
+ board.description = "项目讨论区"
+ board.save(:validate => false)
+ end
+ end
+
+ def down
+ boards = Board.where("project_id <> -1 and name like '%项目讨论区%'")
+ boards.each do |board|
+ board.name = " 课程讨论区"
+ board.description = " 课程讨论区"
+ board.save(:validate => false)
+ end
+ end
+end
From 63cfa9b35aacaad44ea8c5a7fe3b2f8656cd683d Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 1 Aug 2014 16:14:00 +0800
Subject: [PATCH 04/27] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=89=93=E5=8C=85?=
=?UTF-8?q?=E4=B8=8B=E8=BD=BD=E7=9A=84ajax?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_homework_list.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index 2009d1252..fee568b90 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -8,7 +8,7 @@
<%= l(:label_task_plural)%>(<%= @homework_list.count%>)
- <%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %>
+ <%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %>
|
@@ -106,7 +106,7 @@
|
提交文件:
<% if is_evaluation || is_teacher%>
- <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework, :remote => true%>
+ <%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
<% else %>
未开启互评功能作业不允许下载
<% end %>
From 69f7f97bf88e391c9abc2a1557d937abfa99f6e8 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Sat, 2 Aug 2014 17:05:56 +0800
Subject: [PATCH 05/27] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=BB=E9=A1=B5=E7=BC=BA=E9=99=B7=E6=8F=8F?=
=?UTF-8?q?=E8=BF=B0=E8=B6=85=E5=87=BA=E9=A1=B5=E9=9D=A2=E7=9A=84BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/show.html.erb | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index c4e0ef98d..a12627792 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -278,12 +278,15 @@
<% end %>
|
-
-
+ |
+
+ <%= textilizable act, :description %>
|
From 9cb026ed39289051c548d142c522394e568956dc Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 4 Aug 2014 15:01:39 +0800
Subject: [PATCH 06/27] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=84=E8=AE=BA=E7=9A=84=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../notificationcomments_controller.rb | 13 +++++++++++--
app/models/notificationcomment.rb | 1 +
app/views/contestnotifications/show.html.erb | 16 +++++++++++++++-
config/routes.rb | 8 +++++++-
4 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/app/controllers/notificationcomments_controller.rb b/app/controllers/notificationcomments_controller.rb
index 80500ab10..43cad6cbb 100644
--- a/app/controllers/notificationcomments_controller.rb
+++ b/app/controllers/notificationcomments_controller.rb
@@ -1,4 +1,7 @@
class NotificationcommentsController < ApplicationController
+ def show
+
+ end
# default_search_scope :contestnotifications
# model_object Contestnotifications
# before_filter :authorize
@@ -20,8 +23,14 @@ class NotificationcommentsController < ApplicationController
end
def destroy
- @contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
- redirect_to contest_contestnotification_path(@contestnotifications)
+ @contest = Contest.find(params[:contest_id])
+ @contestnotification = Contestnotification.find(params[:contestnotification_id])
+ notificaioncomments = Notificationcomment.find(params[:id])
+ notificaioncomments.destroy if notificaioncomments
+ #@contestnotifications = notificaioncomments.Contestnotification
+ #@contest = @contestnotifications.contest
+ #@contestnotifications.notificaioncomments.find(params[:notificaioncomment_id]).destroy
+ redirect_to contest_contestnotification_path(@contest,@contestnotification)
end
end
diff --git a/app/models/notificationcomment.rb b/app/models/notificationcomment.rb
index 9cc658f22..ce4227a00 100644
--- a/app/models/notificationcomment.rb
+++ b/app/models/notificationcomment.rb
@@ -4,6 +4,7 @@ class Notificationcomment < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :notificationcommented, :polymorphic => true#, :counter_cache => true
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
+ belongs_to :Contestnotification
validates_presence_of :notificationcommented, :author, :notificationcomments
diff --git a/app/views/contestnotifications/show.html.erb b/app/views/contestnotifications/show.html.erb
index eea4cc204..b6ac88008 100644
--- a/app/views/contestnotifications/show.html.erb
+++ b/app/views/contestnotifications/show.html.erb
@@ -69,7 +69,21 @@
- <%= link_to_user(notificationcomment.author) if notificationcomment.respond_to?(:author) %> <%= l(:label_project_newadd) %><%= l(:label_comment_plural) %> |
+
+
+ <%= link_to_user(notificationcomment.author) if notificationcomment.respond_to?(:author) %>
+
+
+ <%= l(:label_project_newadd) %>
+
+ <%= l(:label_comment_plural) %>
+ |
+
+ <% if notificationcomment.author==User.current|| User.current.admin? %>
+ <%= link_to(l(:label_bid_respond_delete), contest_contestnotification_notificationcomment_path(@contest, @contestnotification,notificationcomment),
+ :method => :delete,:confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
+ <% end %>
+ |
diff --git a/config/routes.rb b/config/routes.rb
index af70b76da..1e75ac23a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -83,6 +83,10 @@ RedmineApp::Application.routes.draw do
end
end
+ #resources :notificationcomments do
+ #
+ #end
+
#resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy]
# match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post
# match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete
@@ -91,7 +95,9 @@ RedmineApp::Application.routes.draw do
resources :contests, only: [:index] do
resources :contestnotifications do
# get 'preview', on: :collection
- resources :notificationcomments
+ resources :notificationcomments do
+
+ end
end
collection do
From 8b3b1bdcfa2ab1de2e42667eb004b92890930489 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 4 Aug 2014 15:36:19 +0800
Subject: [PATCH 07/27] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E5=8F=82=E8=B5=9B=E4=BD=9C=E5=93=81=E6=97=B6=E6=B3=A8=E6=84=8F?=
=?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/softapplications/_form.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/softapplications/_form.html.erb b/app/views/softapplications/_form.html.erb
index 17cb20598..4e38981f8 100644
--- a/app/views/softapplications/_form.html.erb
+++ b/app/views/softapplications/_form.html.erb
@@ -113,7 +113,7 @@
<%= render :partial => 'attachments/form' %>
1、<%=l(:label_upload_softapplication_packets_mustpacketed)%> 2、<%=l(:label_upload_softapplication_photo_condition)%>
- <%=l(:label_updated_caution)%>
+
From 94f6e871b1d5eeca7e10d611e90014bafb1162c1 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 4 Aug 2014 15:49:23 +0800
Subject: [PATCH 08/27] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E5=BB=BA?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E6=97=B6=E4=BC=81=E4=B8=9A=E5=90=8D=E4=B8=8D?=
=?UTF-8?q?=E6=98=AF=E8=8B=B1=E6=96=87=E4=B8=94=E6=8F=90=E7=A4=BA=E9=94=99?=
=?UTF-8?q?=E8=AF=AF=E7=9A=84BUG=20#1130?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/my/account.html.erb | 2 +-
config/locales/en.yml | 4 +++-
config/locales/zh.yml | 1 +
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index 3ed947cbf..6a937b376 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -82,7 +82,7 @@
- 企业名<%= text_field_tag :enterprise_name, @user.firstname %>
+ <%= l(:label_company_name)%><%= text_field_tag :enterprise_name, @user.firstname %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index e1b93f649..9012dab4d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -229,7 +229,7 @@ en:
field_description: Description
field_summary: Summary
field_is_required: Required
- field_firstname: First name
+ field_firstname: Name
field_lastname: Last name
field_mail: Email
field_job_category: Job category # added by bai
@@ -1799,3 +1799,5 @@ en:
# ajax异步验证
modal_valid_passing: can be used.
+
+ label_company_name: Company Name
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index d6756474f..bc4809c91 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2016,6 +2016,7 @@ zh:
label_contest_work_list: 参赛作品列表
label_attending_contest: 我要参赛
label_contest_notification: 竞赛通知
+ label_company_name: 企业名
label_coursefile_sharingarea: 课程资源共享区
label_sort_by_activity: 按动态数排序
From 5f3ab0322b1d7975f6254eca2441e35ebb9aaf53 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 4 Aug 2014 16:04:36 +0800
Subject: [PATCH 09/27] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E6=8F=90=E7=A4=BA=20#1127?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/locales/en.yml | 2 +-
config/locales/zh.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 9012dab4d..d8ebfb9f1 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1707,7 +1707,7 @@ en:
label_upload_softapplication_packets: Upload-apppacket
label_upload_softapplication_photo: Upload-appphoto
label_upload_softapplication_packets_mustpacketed: Works code and ralated-document must be packaged before upload.
- label_upload_softapplication_photo_condition: Need upload 0~4 works screenshot, each is less than 5M, photo format such as gif,jpg,png etc.
+ label_upload_softapplication_photo_condition: The best works. 0~4 (redundant pictures would not show page), each is less than 5M, photo format such as gif,jpg,png etc.
label_updated_caution: Note:if you edit the work, the uploaded screenshot and package will be deleted, please re-load!
label_softapplication_name: App-name
label_work_name: Work name
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index bc4809c91..174f47193 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -1975,7 +1975,7 @@ zh:
label_upload_softapplication_packets: 上传应用软件包
label_upload_softapplication_photo: 上传产品截图
label_upload_softapplication_packets_mustpacketed: 作品相关代码及相关说明文件必须打包后以压缩包的形式上传,便于上传和下载 ;
- label_upload_softapplication_photo_condition: 作品截图需上传0~4张;格式为gif/jpg/png, 每张小于5M
+ label_upload_softapplication_photo_condition: 作品截图最好0~4张(多余图片不会再展示页面上显示);格式为gif/jpg/png, 每张小于5M
label_updated_caution: 注意:若编辑参赛作品,则之前上传的软件包和截图都将被删除,请重新上传!
label_softapplication_name: 应用名称
label_work_name: 作品名称
From 8c8127c8d97a694699c01167f51910ed18adf421 Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Mon, 4 Aug 2014 17:36:04 +0800
Subject: [PATCH 10/27] =?UTF-8?q?1016=20=E4=BF=AE=E5=A4=8D=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E6=98=BE=E7=A4=BA=E7=95=8C=E9=9D=A2=E7=A9=BA=E8=A1=8C?=
=?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/course.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 46a6d03a1..63fdfc078 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -92,15 +92,15 @@
-
<% if User.current.logged? %>
+
该学校未开设任何课程,您可以查看其他学校课程
+
<% end %>
-
<% find_all_new_hot_course(9, @school_id).map do |course| %>
- /,"") %>>
From 37e5bdee22ee0caf350e63fd4cf8cc3e93d02a21 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 4 Aug 2014 17:36:07 +0800
Subject: [PATCH 11/27] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E5=86=85=E5=AE=B9=E4=B8=BA?=
=?UTF-8?q?=E7=A9=BA=E7=9A=84BUG=20#1128?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/show.html.erb | 559 +++++++++++++++++-----------------
config/locales/en.yml | 1 +
2 files changed, 282 insertions(+), 278 deletions(-)
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index a12627792..20f64dc3f 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -43,292 +43,295 @@
<% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
<% act = e.act %>
<% unless act.nil? %>
-
-
- <%= image_tag(url_to_avatar(e.user), :class => "avatar") %> |
-
-
- <% case e.act_type %>
- <% when 'JournalsForMessage' %>
- <% if User.current.login == e.user.try(:login) %>
- <%# if e.user_id == act.jour.id %>
-
-
- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %>
- <%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
- |
-
- <%# else %>
-
- <%# end %>
- <% else %>
+ <% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%>
+
-
- <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%=
- link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
- |
-
- <% end %>
-
-
- <%= textilizable act.notes %>
+ | <%= image_tag(url_to_avatar(e.user), :class => "avatar") %> |
+
+
+ <% case e.act_type %>
+ <% when 'JournalsForMessage' %>
+ <% if User.current.login == e.user.try(:login) %>
+ <%# if e.user_id == act.jour.id %>
+
+
+ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %>
+ <%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
+ |
+
+ <%# else %>
+
+ <%# end %>
+ <% else %>
+
+
+ <%= link_to("#{e.user.name}", user_path(e.user_id)) %> <%= l(:label_have_feedback) %><%=
+ link_to("#{e.act.user.name}", user_path(e.act.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)) %>
-
- |
-
+ <%= 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 %>
-
-
- |
-
- <% when 'Bid' %>
-
- <% if act.reward_type == 3 && @show_course == 1%>
- <% 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_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+
+
+ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
+
+
+ |
+
+ <% when 'Bid' %>
+
+ <% if act.reward_type == 3 && @show_course == 1%>
+ <% 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_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+ <% else %>
+
+ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+ <% end %>
+ <% else %>
+ <% 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_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+ <% else %>
+
+ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+ <% end %>
+ <% end %>
+
+
+
+ <%= act.description.html_safe %> |
+
+
+
+
+ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
+
+
+ |
+
+ <% when 'Journal' %>
+
+ <% if e.user == User.current %>
+
+ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
+ |
+ <% else %>
+
+ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
+ |
+ <% end %>
+
+
+ <% if act.notes.nil? %>
+ <% desStr = '' %>
+ <% else %>
+ <% desStr=act.notes.html_safe %>
+ <% end %>
+ <%= desStr %>
+ |
+
+
+
+
+ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
+
+
+ |
+
+ <% when 'Changeset' %>
+
+ <% 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(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %>
+ |
+ <% else %>
+
+ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %>
+ |
+ <% end %>
+
+
+
+ <%= act.long_comments.html_safe %> |
+
+
+
+
+ <%= format_time(e.act.committed_on) %>
+
+
|
- <% else %>
-
- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+ <% when 'Message' %>
+
+ <% 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("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
+ |
+ <% else %>
+
+ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
+ |
+ <% end %>
+
+
+
+ <%= h act.content.truncate(240, omission: '...') %>
|
- <% end %>
- <% else %>
- <% 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_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+
+
+
+ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
+
+
|
- <% else %>
-
- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
+ |
+ <% when 'Principal' %>
+
+ <% if e.user == User.current %>
+
+ <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_new_user) %>
+ |
+ <% else %>
+
+ <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_user) %>
+ |
+ <% end %>
+
+
+ |
+
+
+
+
+ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
+
+
|
- <% end %>
- <% end %>
-
-
-
- <%= act.description.html_safe %> |
-
-
-
-
- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
-
-
- |
-
- <% when 'Journal' %>
-
- <% if e.user == User.current %>
-
- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_i_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
- |
- <% else %>
-
- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
- |
- <% end %>
-
-
- <% if act.notes.nil? %>
- <% desStr = '' %>
- <% else %>
- <% desStr=act.notes.html_safe %>
- <% end %>
- <%= desStr %>
- |
-
-
-
-
- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
-
-
- |
-
- <% when 'Changeset' %>
-
- <% 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(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %>
- |
- <% else %>
-
- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %>
- |
- <% end %>
-
-
-
- <%= act.long_comments.html_safe %> |
-
-
-
-
- <%= format_time(e.act.committed_on) %>
-
-
- |
-
- <% when 'Message' %>
-
- <% 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("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
- |
- <% else %>
-
- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
- |
- <% end %>
-
-
-
- <%= h act.content.truncate(240, omission: '...') %>
- |
-
-
-
-
- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
-
-
- |
-
- <% when 'Principal' %>
-
- <% if e.user == User.current %>
-
- <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %> <%= l(:label_new_user) %>
- |
- <% else %>
-
- <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_user) %>
- |
- <% end %>
-
-
- |
-
-
-
-
- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
-
-
- |
-
- <% when 'News' %>
-
- <% 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_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :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_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
- |
- <% end %>
-
-
-
- <%= act.description.html_safe %> |
-
-
-
-
- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
-
-
- |
-
- <% when 'Issue' %>
-
- <% 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("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %>
- |
- <% else %>
-
-
- <%= link_to(h(e.user), user_path(e.user_id)) %>
-
-
- <%= l(:label_new_activity) %>
-
- <%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %>
- |
- <% end %>
-
-
-
-
- <%= textilizable act, :description %>
-
- |
-
-
-
-
- <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
-
-
- |
-
- <% when 'Contest' %>
-
- <% if e.user == User.current && @show_contest == 1%>
-
- <%= 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 %>
-
- |
-
-
+
+
+ -->
+ <%= textilizable act, :description %>
+
+
+
+
+
+
+ <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
+
+
+ |
+
+ <% when 'Contest' %>
+
+ <% if e.user == User.current && @show_contest == 1%>
+
+ <%= 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 %>
+
+ |
+
+
+
+ <% end %>
<% end %>
<% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index d8ebfb9f1..8e3b8d0f0 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1801,3 +1801,4 @@ en:
modal_valid_passing: can be used.
label_company_name: Company Name
+ notice_account_invalid_creditentials_new: You have not to the mailbox activation
From 2c77d1b4cf5df9a214d1ca9b249fd74bfd14dc7a Mon Sep 17 00:00:00 2001
From: z9hang
Date: Tue, 5 Aug 2014 11:10:41 +0800
Subject: [PATCH 12/27] =?UTF-8?q?=E8=AE=BF=E9=97=AE=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E5=BA=93=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 14 +++++++++++++-
app/helpers/project_score_helper.rb | 5 +++++
app/models/attachment.rb | 2 +-
.../files/_course_show_all_attachment.html.erb | 2 +-
4 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index a8ba3d426..e619ef843 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -40,7 +40,19 @@ class FilesController < ApplicationController
render :layout => !request.xhr?
elsif params[:course_id]
@isproject = false
- @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
+
+ if params[:sort]
+ @oder = params[:sort].split(",")[0]
+ @order_by = @oder.split(":")[0]
+ @order_tyoe = @oder.split(":")[1]
+ if @order_by == "size"
+ @order_by = "filesize"
+ end
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@order_by} #{@order_tyoe}").find(@course.id)]
+ else
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
+ end
+
render :layout => 'base_courses'
end
end
diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb
index 3df2e05b5..fe7c8307e 100644
--- a/app/helpers/project_score_helper.rb
+++ b/app/helpers/project_score_helper.rb
@@ -2,7 +2,12 @@
class ProjectScoreHelper
#缺陷数量
def issue_num project
+ project.issues.count
+ end
+ #缺陷留言数量
+ def issue_journal_num project
+ project
end
end
\ No newline at end of file
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 85f36fc5f..67e46eb5e 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -193,7 +193,7 @@ class Attachment < ActiveRecord::Base
def show_suffix_type
suffix = 'other'
temp = self.suffix_type.downcase
- if self.attachmentstype.suffixArr.include?(temp)
+ if self.attachmentstype && self.attachmentstype.suffixArr.include?(temp)
suffix = temp
end
suffix
diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb
index f94ddc20b..abece1ae1 100644
--- a/app/views/files/_course_show_all_attachment.html.erb
+++ b/app/views/files/_course_show_all_attachment.html.erb
@@ -43,7 +43,7 @@
<%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %>
+ <%= file.attachmentstype.typeName unless file.attachmentstype.nil? %>
<%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
From 8b217735c3f736709a6f54ba3b9fa81b43c01436 Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Tue, 5 Aug 2014 12:00:39 +0800
Subject: [PATCH 13/27] =?UTF-8?q?1029=20=E4=BF=AE=E5=A4=8D=E9=83=A8?=
=?UTF-8?q?=E5=88=86=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E6=8E=92=E5=BA=8F?=
=?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=94=A8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index a8ba3d426..a2d791017 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -40,7 +40,19 @@ class FilesController < ApplicationController
render :layout => !request.xhr?
elsif params[:course_id]
@isproject = false
- @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
+ @order = params[:sort].split(",")[0];
+ @orderBy = @order.split(":")[0];
+ @orderType = @order.split(":")[1];
+ if @orderBy=="size"
+ @orderBy="filesize"
+ elsif @orderBy=="field_file_dense"
+ @orderBy="is_public"
+ elsif @orderBy=="attach_type"
+ @orderBy="attachtype"
+ elsif @orderBy=="content_type"
+ @orderBy="attachtype"
+ end
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
render :layout => 'base_courses'
end
end
From fbe3e535b4c4af1759c1cfab6d08cbd8fe96b51f Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Tue, 5 Aug 2014 15:23:01 +0800
Subject: [PATCH 14/27] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8E=92=E5=BA=8Fbug=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E6=97=B6=E9=97=B4=E6=AE=B5?=
=?UTF-8?q?=E7=BA=A6=E6=9D=9Fbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 4 +++-
app/controllers/files_controller.rb | 21 +++++++++++++++++----
app/views/courses/show.html.erb | 2 +-
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 85dfba8cf..6989b0b4f 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -624,7 +624,9 @@ class CoursesController < ApplicationController
"show_course_journals_for_messages" => true
}
@date_to ||= Date.today + 1
- @date_from = @date_to - @days-1.years
+ #
+ @date_from = (@date_to - @days) > @course.created_at.to_date ? (@date_to - @days) : @course.created_at.to_date
+ #@date_from = @date_to - @days-1.years
@author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id]))
# 决定显示所用用户或单个用户活动
@activity = Redmine::Activity::Fetcher.new(User.current, :course => @course,
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index a2d791017..9e41f467b 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -40,9 +40,17 @@ class FilesController < ApplicationController
render :layout => !request.xhr?
elsif params[:course_id]
@isproject = false
- @order = params[:sort].split(",")[0];
- @orderBy = @order.split(":")[0];
- @orderType = @order.split(":")[1];
+
+ if params[:sort]
+ if params[:sort].include?":"
+ @orderBy = params[:sort].split(":")[0];
+ @orderType = params[:sort].split(":")[1].split(",")[0];
+ else
+ @orderBy = params[:sort].split(",")[0];
+ @orderType = "asc";
+ end
+ end
+
if @orderBy=="size"
@orderBy="filesize"
elsif @orderBy=="field_file_dense"
@@ -52,7 +60,12 @@ class FilesController < ApplicationController
elsif @orderBy=="content_type"
@orderBy="attachtype"
end
- @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
+
+ if @orderBy
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
+ else
+ @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on desc").find(@course.id)]
+ end
render :layout => 'base_courses'
end
end
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index 8b713476e..deb590d1f 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -2,7 +2,7 @@
- <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
+ <%= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
<% @events_by_day.keys.sort.reverse.each do |day| %>
From 7907edf168a3b999c24e87775dba49d388cf3e8e Mon Sep 17 00:00:00 2001
From: z9hang
Date: Tue, 5 Aug 2014 16:39:33 +0800
Subject: [PATCH 15/27] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=BE=97=E5=88=86=E8=A7=84=E5=88=99=20=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ReadMe.txt | 5 ++
app/controllers/projects_controller.rb | 1 +
app/controllers/welcome_controller.rb | 2 +-
app/helpers/project_score_helper.rb | 64 ++++++++++++++++++-
app/views/bids/_homework_list.html.erb | 2 +-
app/views/layouts/base_projects.html.erb | 29 +--------
.../_code_submit_score_index.html.erb | 7 +-
app/views/projects/_file_score_index.html.erb | 7 +-
.../projects/_issue_score_index.html.erb | 13 ++--
app/views/projects/_news_score_index.html.erb | 8 +--
app/views/projects/_project.html.erb | 46 +++----------
.../projects/_project_score_index.html.erb | 34 ++--------
.../_projects_topic_score_index.html.erb | 10 +--
.../projects/_show_projects_score.html.erb | 40 ++----------
.../projects/show_projects_score.html.erb | 39 ++---------
app/views/welcome/index.html.erb | 28 +-------
.../stylesheets/application.css | 6 +-
17 files changed, 116 insertions(+), 225 deletions(-)
diff --git a/ReadMe.txt b/ReadMe.txt
index 722b4cd37..b5822682b 100644
--- a/ReadMe.txt
+++ b/ReadMe.txt
@@ -70,3 +70,8 @@ kw:
undefined image_width
bundle exec rake db:migrate:down version=20140725062302
bundle exec rake db:migrate:up version=20140725062302
+
+=================================[2014-07-19]=====================================
+kw: Mysql2::Error,洢,CALL sp_project_status_cursor();
+bundle exec rake db:migrate:down version=20130828004955
+bundle exec rake db:migrate:up version=20130828004955
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 9b2481c1b..76be5d51f 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -75,6 +75,7 @@ class ProjectsController < ApplicationController
helper :watchers
# helper :watcherlist
helper :words
+ helper :project_score
### added by william
include ActsAsTaggableOn::TagsHelper
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb
index c7cbf217d..4a0586c95 100644
--- a/app/controllers/welcome_controller.rb
+++ b/app/controllers/welcome_controller.rb
@@ -18,7 +18,7 @@
class WelcomeController < ApplicationController
include ApplicationHelper
include WelcomeHelper
-
+ helper :project_score
caches_action :robots
# before_filter :fake, :only => [:index, :course]
before_filter :entry_select, :only => [:index]
diff --git a/app/helpers/project_score_helper.rb b/app/helpers/project_score_helper.rb
index fe7c8307e..923a3da72 100644
--- a/app/helpers/project_score_helper.rb
+++ b/app/helpers/project_score_helper.rb
@@ -1,5 +1,5 @@
# encoding: utf-8
-class ProjectScoreHelper
+module ProjectScoreHelper
#缺陷数量
def issue_num project
project.issues.count
@@ -7,7 +7,67 @@ class ProjectScoreHelper
#缺陷留言数量
def issue_journal_num project
- project
+ project.issue_changes.count
+ end
+
+ #新闻数量
+ def news_num project
+ project.news.count
+ end
+
+ #文档数量
+ def document_num project
+ project.documents.count
+ end
+
+ #代码提交数量
+ def changesets_num project
+ project.changesets.count
+ end
+
+ #讨论区帖子数量
+ def board_message_num project
+ board_message_count = 0
+ project.boards.each do |board|
+ board_message_count += board.messages_count
+ end
+ board_message_count
+ end
+
+ #缺陷得分
+ def issue_score project
+ i_num = issue_num project
+ i_j_num = issue_journal_num project
+ i_num * 4 + i_j_num
+ end
+
+ # 新闻得分
+ def news_score project
+ n_num = news_num project
+ n_num
+ end
+
+ #文档得分
+ def document_score project
+ d_num = document_num project
+ d_num * 4
+ end
+
+ #代码提交得分
+ def changesets_score project
+ c_num = changesets_num project
+ c_num * 4
+ end
+
+ #讨论区帖子得分
+ def board_message_score project
+ b_m_num = board_message_num project
+ b_m_num * 2
+ end
+
+ #项目得分
+ def project_scores project
+ (issue_score project) + (news_score project) + (document_score project) + (changesets_score project) + (board_message_score project)
end
end
\ No newline at end of file
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index 2009d1252..9e8aceaff 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -96,7 +96,7 @@
项目得分:
;">
- <%= homework.project.nil? ? "N/A" : project_score(homework.project) %>
+ <%= homework.project.nil? ? "N/A" : project_scores(homework.project) %>
|
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index fa20bdff6..b8bede1fb 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -62,37 +62,10 @@
<%= link_to @project.name, project_path(@project)%>
-
- <% issue_count = @project.issues.count %>
- <% issue_journal_count = @project.issue_changes.count %>
- <% issue_score = issue_count * 0.2 %>
- <% issue_journal_score = issue_journal_count * 0.1 %>
- <% finall_issue_score = issue_score + issue_journal_score %>
-
- <% new_count = @project.news.count %>
- <% new_score = new_count * 0.1 %>
- <% finall_new_score = new_score %>
-
- <% document_count = @project.documents.count %>
- <% file_score = document_count * 0.1 %>
- <% finall_file_score = file_score %>
-
- <% changeset_count = @project.changesets.count %>
- <% code_submit_score = changeset_count * 0.3 %>
- <% finall_code_submit_score = code_submit_score %>
-
- <% board_message_count = 0 %>
- <% @project.boards.each do |board| %>
- <% board_message_count += board.messages_count %>
- <% end %>
- <% topic_score = board_message_count * 0.1 %>
- <% finall_topic_score = topic_score %>
-
- <% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
<% if @project.project_type == 0 %>
<%= l(:label_project_grade)%> :
- <%= link_to(format("%.2f" , finall_project_score ).to_f, {:controller => 'projects',
+ <%= link_to(format("%.2f" , project_scores(@project) ).to_i, {:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id
diff --git a/app/views/projects/_code_submit_score_index.html.erb b/app/views/projects/_code_submit_score_index.html.erb
index 238993afe..802779967 100644
--- a/app/views/projects/_code_submit_score_index.html.erb
+++ b/app/views/projects/_code_submit_score_index.html.erb
@@ -1,7 +1,4 @@
-<% changeset_count = @project.changesets.count %>
-<% code_submit_score = changeset_count * 0.3 %>
-<% finall_code_submit_score = code_submit_score %>
- <%= l(:label_code_submit_number) %> * 0.3 = <%= changeset_count %> * 0.3 = <%= format("%.2f" , code_submit_score).to_f %>
- <%= l(:label_code_submit_score) %> = <%= format("%.2f" , finall_code_submit_score).to_f %>
+ <%= l(:label_code_submit_number) %> * 4 = <%= changesets_num(@project) %> * 4 = <%= format("%.2f" , changesets_score(@project)).to_i %>
+ <%= l(:label_code_submit_score) %> = <%= format("%.2f" , changesets_score(@project)).to_i %>
\ No newline at end of file
diff --git a/app/views/projects/_file_score_index.html.erb b/app/views/projects/_file_score_index.html.erb
index 3b4810f65..ce80ddbd2 100644
--- a/app/views/projects/_file_score_index.html.erb
+++ b/app/views/projects/_file_score_index.html.erb
@@ -1,7 +1,4 @@
-<% document_count = @project.documents.count %>
-<% file_score = document_count * 0.1 %>
-<% finall_file_score = file_score %>
- <%= l(:label_file_number) %> * 0.1 = <%= document_count %> * 0.1 = <%= format("%.2f" , file_score).to_f %>
- <%= l(:label_file_score) %> = <%= format("%.2f" , finall_file_score).to_f %>
+ <%= l(:label_file_number) %> * 4 = <%= document_num(@project) %> * 4 = <%= format("%.2f" , document_score(@project)).to_i %>
+ <%= l(:label_file_score) %> = <%= format("%.2f" , document_score(@project)).to_i %>
\ No newline at end of file
diff --git a/app/views/projects/_issue_score_index.html.erb b/app/views/projects/_issue_score_index.html.erb
index 8ca3d240c..7353ce5a3 100644
--- a/app/views/projects/_issue_score_index.html.erb
+++ b/app/views/projects/_issue_score_index.html.erb
@@ -1,11 +1,6 @@
-<% issue_count = @project.issues.count %>
-<% issue_journal_count = @project.issue_changes.count %>
-<% issue_score = issue_count * 0.2 %>
-<% issue_journal_score = issue_journal_count * 0.1 %>
-<% finall_issue_score = issue_score + issue_journal_score %>
- <%= l(:label_issue_number) %> * 0.2 = <%= issue_count %> * 0.2 = <%= format("%.2f" , issue_score).to_f %>
- <%= l(:label_issue_journal_number) %> * 0.1 = <%= issue_journal_count %> * 0.1 = <%= format("%.2f" , issue_journal_score).to_f %>
- <%= l(:label_issue_score) %> = <%= format("%.2f" , issue_score).to_f %> + <%= format("%.2f" , issue_journal_score).to_f %>
- = <%= format("%.2f" , finall_issue_score).to_f %>
+ <%= l(:label_issue_number) %> * 4 = <%= issue_num(@project) %> * 4 = <%= format("%.2f" , issue_num(@project) * 4).to_i %>
+ <%= l(:label_issue_journal_number) %> * 1 = <%= issue_journal_num(@project) %> * 1 = <%= format("%.2f" , issue_journal_num(@project)).to_i %>
+ <%= l(:label_issue_score) %> = <%= format("%.2f" , issue_num(@project) * 4).to_i %> + <%= format("%.2f" , issue_journal_num(@project)).to_i %>
+ = <%= format("%.2f" , issue_score(@project)).to_i %>
\ No newline at end of file
diff --git a/app/views/projects/_news_score_index.html.erb b/app/views/projects/_news_score_index.html.erb
index 0f374b871..b3d66efeb 100644
--- a/app/views/projects/_news_score_index.html.erb
+++ b/app/views/projects/_news_score_index.html.erb
@@ -1,7 +1,5 @@
-<% new_count = @project.news.count %>
-<% new_score = new_count * 0.1 %>
-<% finall_new_score = new_score %>
- <%= l(:label_new_number) %> * 0.1 = <%= new_count %> * 0.1 = <%= format("%.2f" , new_score).to_f %>
- <%= l(:label_news_score) %> = <%= format("%.2f" , finall_new_score).to_f %>
+
+ <%= l(:label_new_number) %> * 1 = <%= news_num(@project) %> * 1 = <%= format("%.2f" , news_score(@project)).to_i %>
+ <%= l(:label_news_score) %> = <%= format("%.2f" , news_score(@project)).to_i %>
\ No newline at end of file
diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb
index 41ad2a62c..e9a733ece 100644
--- a/app/views/projects/_project.html.erb
+++ b/app/views/projects/_project.html.erb
@@ -18,37 +18,37 @@
| | |