From bb6be3ed8a75b12c58ec3206d6324fe73922f11c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 31 Jul 2014 11:35:16 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9html=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/issue_overdue.rb | 2 +-
app/views/contests/index.html.erb | 14 +++++------
.../contests/show_attendingcontest.html.erb | 2 +-
db/schema.rb | 24 +++++++++----------
4 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/app/models/issue_overdue.rb b/app/models/issue_overdue.rb
index 342790f55..5caec94c9 100644
--- a/app/models/issue_overdue.rb
+++ b/app/models/issue_overdue.rb
@@ -18,7 +18,7 @@ class IssueOverdue < ActiveRecord::Base
sleep 5
else
#发邮件
- puts "11" + issue.id.to_s
+ #puts "11" + issue.id.to_s
#Mailer.issue_expire(issue).deliver
Mailer.issue_add(issue).deliver
break
diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb
index 8c999f941..6f8430ca0 100644
--- a/app/views/contests/index.html.erb
+++ b/app/views/contests/index.html.erb
@@ -6,17 +6,17 @@
<%= l(:label_user_location) %> : |
<% if User.current.logged? %>
- <% unless User.current.user_extensions.identity == 1 %>
- <%= link_to(l(:label_newtype_contest), {:controller => 'contests', :action => 'new_contest'}, :class => 'icon icon-add', :target => "_blank") %>
- <% end %>
- <% end %>
+ <% unless User.current.user_extensions.identity == 1 %>
+ <%= link_to(l(:label_newtype_contest), {:controller => 'contests', :action => 'new_contest'}, :class => 'icon icon-add', :target => "_blank") %>
+ <% end %>
+ <% end %>
|
-
-
+
+
<%= text_field_tag 'name', params[:name], :size => 30 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
-
+
|
diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb
index 415897492..96fac7677 100644
--- a/app/views/contests/show_attendingcontest.html.erb
+++ b/app/views/contests/show_attendingcontest.html.erb
@@ -276,7 +276,7 @@
<% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %>
-
+
<%= toggle_link '评奖', c_softapplication.id.to_s %>
diff --git a/db/schema.rb b/db/schema.rb
index 0df71c97b..7643adb4b 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 => 20140730021521) do
+ActiveRecord::Schema.define(:version => 20140730024419) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -272,7 +272,7 @@ ActiveRecord::Schema.define(:version => 20140730021521) do
t.integer "contest_id"
t.string "title"
t.string "summary"
- t.string "description"
+ t.text "description"
t.integer "author_id"
t.integer "notificationcomments_count"
t.datetime "created_at", :null => false
@@ -847,18 +847,18 @@ ActiveRecord::Schema.define(:version => 20140730021521) 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"
From 5564ca063bcc7453f9a2fb9dc0de49701a76bdb5 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 31 Jul 2014 13:40:02 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E6=95=B4=E7=90=86=E8=BF=81=E7=A7=BB?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=BF=81=E7=A7=BB?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E8=BF=90=E8=A1=8C=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...40324015819_create_open_source_projects.rb | 2 +-
...description_type_to_open_source_project.rb | 9 --
db/migrate/20140505082635_drop_user_scores.rb | 5 -
.../20140505083430_create_user_scores.rb | 11 ---
db/migrate/20140606028512_add_course_roles.rb | 70 ++++++-------
.../20140710071720_create_first_pages.rb | 3 +-
...12924_add_contest_and_course_first_page.rb | 4 +-
db/migrate/20140714081030_set_web_title.rb | 2 +-
db/migrate/20140716021558_set_sort_type.rb | 2 +-
.../20140719080032_repair_first_page.rb | 12 +--
db/schema.rb | 97 ++++---------------
11 files changed, 65 insertions(+), 152 deletions(-)
delete mode 100644 db/migrate/20140411011700_change_description_type_to_open_source_project.rb
delete mode 100644 db/migrate/20140505082635_drop_user_scores.rb
delete mode 100644 db/migrate/20140505083430_create_user_scores.rb
diff --git a/db/migrate/20140324015819_create_open_source_projects.rb b/db/migrate/20140324015819_create_open_source_projects.rb
index 22034c3bb..e454b3473 100644
--- a/db/migrate/20140324015819_create_open_source_projects.rb
+++ b/db/migrate/20140324015819_create_open_source_projects.rb
@@ -2,7 +2,7 @@ class CreateOpenSourceProjects < ActiveRecord::Migration
def change
create_table :open_source_projects do |t|
t.column "name", :string, :default => nil, :null => true
- t.column "description", :string, :default => '', :null => true
+ t.column "description", :text, :null => true
t.column "commit_count", :integer, :default => 0
t.column "code_line", :integer, :default => 0
t.column "users_count",:integer, :default => 0
diff --git a/db/migrate/20140411011700_change_description_type_to_open_source_project.rb b/db/migrate/20140411011700_change_description_type_to_open_source_project.rb
deleted file mode 100644
index 8c8804d8a..000000000
--- a/db/migrate/20140411011700_change_description_type_to_open_source_project.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class ChangeDescriptionTypeToOpenSourceProject < ActiveRecord::Migration
- def up
- change_column :open_source_projects, :description, :text
- end
-
- def down
- raise ActiveRecord::IrreversibleMigration
- end
-end
diff --git a/db/migrate/20140505082635_drop_user_scores.rb b/db/migrate/20140505082635_drop_user_scores.rb
deleted file mode 100644
index fc65788f2..000000000
--- a/db/migrate/20140505082635_drop_user_scores.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class DropUserScores < ActiveRecord::Migration
- def change
- drop_table :user_scores
- end
-end
diff --git a/db/migrate/20140505083430_create_user_scores.rb b/db/migrate/20140505083430_create_user_scores.rb
deleted file mode 100644
index 6c63aa327..000000000
--- a/db/migrate/20140505083430_create_user_scores.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class CreateUserScores < ActiveRecord::Migration
- def change
- create_table :user_scores do |t|
- t.integer :user_id
- t.integer :collaboration
- t.integer :influence
- t.integer :skill
- t.integer :activity
- end
- end
-end
diff --git a/db/migrate/20140606028512_add_course_roles.rb b/db/migrate/20140606028512_add_course_roles.rb
index 3435dd25f..05c678c62 100644
--- a/db/migrate/20140606028512_add_course_roles.rb
+++ b/db/migrate/20140606028512_add_course_roles.rb
@@ -4,49 +4,49 @@ class AddCourseRoles < ActiveRecord::Migration
# 添加课程权限
Role.all.each do |role|
if role.name == 'Non member'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
- role.permissions.append(:add_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
+ role.add_permission!(:add_course )
elsif role.name == 'Anonymous'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
elsif role.name == 'Manager'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
- role.permissions.append(:add_course )
- role.permissions.append(:close_course )
- role.permissions.append(:select_course_modules )
- role.permissions.append(:edit_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
+ role.add_permission!(:add_course )
+ role.add_permission!(:close_course )
+ role.add_permission!(:select_course_modules )
+ role.add_permission!(:edit_course )
elsif role.name =='Developer'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
- role.permissions.append(:add_course )
- role.permissions.append(:close_course )
- role.permissions.append(:select_course_modules )
- role.permissions.append(:edit_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
+ role.add_permission!(:add_course )
+ role.add_permission!(:close_course )
+ role.add_permission!(:select_course_modules )
+ role.add_permission!(:edit_course )
elsif role.name == 'Reporter'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
elsif role.name == '助教'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
- role.permissions.append(:add_course )
- role.permissions.append(:select_course_modules )
- role.permissions.append(:edit_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
+ role.add_permission!(:add_course )
+ role.add_permission!(:select_course_modules )
+ role.add_permission!(:edit_course )
elsif role.name == '老师'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
- role.permissions.append(:add_course )
- role.permissions.append(:close_course )
- role.permissions.append(:select_course_modules )
- role.permissions.append(:edit_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
+ role.add_permission!(:add_course )
+ role.add_permission!(:close_course )
+ role.add_permission!(:select_course_modules )
+ role.add_permission!(:edit_course )
elsif role.name == '学生'
- role.permissions.append(:view_course )
- role.permissions.append(:search_course )
+ role.add_permission!(:view_course )
+ role.add_permission!(:search_course )
end
- role.permissions.append(:view_course_files )
- role.permissions.append(:view_course_journals_for_messages )
- role.permissions.append(:view_course_messages )
+ role.add_permission!(:view_course_files )
+ role.add_permission!(:view_course_journals_for_messages )
+ role.add_permission!(:view_course_messages )
role.save(:validate => false)
end
end
diff --git a/db/migrate/20140710071720_create_first_pages.rb b/db/migrate/20140710071720_create_first_pages.rb
index c33283a06..a6af63ca4 100644
--- a/db/migrate/20140710071720_create_first_pages.rb
+++ b/db/migrate/20140710071720_create_first_pages.rb
@@ -9,12 +9,13 @@ class CreateFirstPages < ActiveRecord::Migration
t.timestamps
end
+
fp = FirstPage.new
fp.web_title = "Trustie - 为大学生技术创新筑巢"
fp.title = "Trustie在线项目托管平台"
fp.description = "面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。"
fp.page_type = "project"
- fp.save
+ fp.save(:validate => false)
end
end
diff --git a/db/migrate/20140711012924_add_contest_and_course_first_page.rb b/db/migrate/20140711012924_add_contest_and_course_first_page.rb
index 801219bd5..8a7673b11 100644
--- a/db/migrate/20140711012924_add_contest_and_course_first_page.rb
+++ b/db/migrate/20140711012924_add_contest_and_course_first_page.rb
@@ -6,12 +6,12 @@ class AddContestAndCourseFirstPage < ActiveRecord::Migration
fp.title = "Trustie在线课程实践平台"
fp.description = "面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。"
fp.page_type = "course"
- fp.save
+ fp.save(:validate => false)
fp1 = FirstPage.new
fp1.web_title = ""
fp1.title = "Trustie在线竞赛实战平台"
fp1.description = "面向中国大学生与编程爱好者,提供社交化的竞赛管理、应用管理、代码托管、合作交流。"
fp1.page_type = "contest"
- fp1.save
+ fp1.save(:validate => false)
end
end
diff --git a/db/migrate/20140714081030_set_web_title.rb b/db/migrate/20140714081030_set_web_title.rb
index 51b1f6d89..73a536d1c 100644
--- a/db/migrate/20140714081030_set_web_title.rb
+++ b/db/migrate/20140714081030_set_web_title.rb
@@ -3,7 +3,7 @@ class SetWebTitle < ActiveRecord::Migration
def change
FirstPage.all.each do |fp|
fp.web_title = "Trustie - 为大学生技术创新筑巢"
- fp.save
+ fp.save(:validate => false)
end
end
end
diff --git a/db/migrate/20140716021558_set_sort_type.rb b/db/migrate/20140716021558_set_sort_type.rb
index 04511ca2b..0042749ba 100644
--- a/db/migrate/20140716021558_set_sort_type.rb
+++ b/db/migrate/20140716021558_set_sort_type.rb
@@ -2,7 +2,7 @@ class SetSortType < ActiveRecord::Migration
def change
FirstPage.all.each do |fp|
fp.sort_type = 1
- fp.save
+ fp.save(:validate => false)
end
end
end
diff --git a/db/migrate/20140719080032_repair_first_page.rb b/db/migrate/20140719080032_repair_first_page.rb
index a1faf7f90..60e429f04 100644
--- a/db/migrate/20140719080032_repair_first_page.rb
+++ b/db/migrate/20140719080032_repair_first_page.rb
@@ -9,7 +9,7 @@ class RepairFirstPage < ActiveRecord::Migration
fp.description = "面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。"
fp.page_type = "project"
fp.sort_type = 1
- fp.save
+ fp.save(:validate => false)
else
fp = pro_fps.first
fp.web_title = "Trustie - 为大学生技术创新筑巢"
@@ -17,7 +17,7 @@ class RepairFirstPage < ActiveRecord::Migration
fp.description = "面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。"
fp.page_type = "project"
fp.sort_type = 1
- fp.save
+ fp.save(:validate => false)
end
course_fps = FirstPage.where("page_type = 'course'")
if course_fps.nil? || course_fps.first.nil?
@@ -27,7 +27,7 @@ class RepairFirstPage < ActiveRecord::Migration
fp.description = "面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。"
fp.page_type = "course"
fp.sort_type = 1
- fp.save
+ fp.save(:validate => false)
else
fp = course_fps.first
fp.web_title = "Trustie - 为大学生技术创新筑巢"
@@ -35,7 +35,7 @@ class RepairFirstPage < ActiveRecord::Migration
fp.description = "面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。"
fp.page_type = "course"
fp.sort_type = 1
- fp.save
+ fp.save(:validate => false)
end
contest_fps = FirstPage.where("page_type = 'contest'")
if contest_fps.nil? || contest_fps.first.nil?
@@ -45,7 +45,7 @@ class RepairFirstPage < ActiveRecord::Migration
fp1.description = "面向中国大学生与编程爱好者,提供社交化的竞赛管理、应用管理、代码托管、合作交流。"
fp1.page_type = "contest"
fp1.sort_type = 1
- fp1.save
+ fp1.save(:validate => false)
else
fp1 = contest_fps.first
fp1.web_title = "Trustie - 为大学生技术创新筑巢"
@@ -53,7 +53,7 @@ class RepairFirstPage < ActiveRecord::Migration
fp1.description = "面向中国大学生与编程爱好者,提供社交化的竞赛管理、应用管理、代码托管、合作交流。"
fp1.page_type = "contest"
fp1.sort_type = 1
- fp1.save
+ fp1.save(:validate => false)
end
end
end
diff --git a/db/schema.rb b/db/schema.rb
index 7643adb4b..72e6ccba9 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -177,58 +177,6 @@ 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
@@ -419,9 +367,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
@@ -847,18 +795,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", :limit => 16777215, :null => false
+ t.string "subject", :null => false
+ t.text "content", :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"
@@ -882,19 +830,6 @@ 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
@@ -945,11 +880,10 @@ 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|
@@ -1055,8 +989,8 @@ ActiveRecord::Schema.define(:version => 20140730024419) do
t.integer "zip_code"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
- t.string "technical_title"
t.integer "identity"
+ t.string "technical_title"
t.string "student_id"
t.string "teacher_realname"
t.string "student_realname"
@@ -1114,6 +1048,9 @@ 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 7b32debb922b794ef0c43e224974e796ac7610cc Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 31 Jul 2014 13:55:22 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B0=B7=E6=AD=8C?=
=?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E7=BF=BB=E5=88=B0=E7=AC=AC5=E9=A1=B5=E5=90=8E=E8=A7=92?=
=?UTF-8?q?=E8=89=B2=E4=BF=A1=E6=81=AF=E5=92=8C=E7=BF=BB=E9=A1=B5=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E5=9C=A8=E5=90=8C=E4=B8=80=E8=A1=8C=E7=9A=84BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/settings/_members.html.erb | 1 +
app/views/projects/settings/_members.html.erb | 1 +
2 files changed, 2 insertions(+)
diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb
index b4e5004bf..d0c77ae83 100644
--- a/app/views/courses/settings/_members.html.erb
+++ b/app/views/courses/settings/_members.html.erb
@@ -78,6 +78,7 @@
<%= render_principals_for_new_course_members(@course) %>
+
<%= l(:label_role_plural) %>:
<% roles.each do |role| %>
diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb
index f69f9edff..ab046bcb6 100644
--- a/app/views/projects/settings/_members.html.erb
+++ b/app/views/projects/settings/_members.html.erb
@@ -92,6 +92,7 @@
<%= render_principals_for_applied_members(@project) %>
+
<%= l(:label_role_plural) %>:
<% roles.each do |role| %>
From 2c689b639989ddba9057bcba5f12ab4abc8b2dbc Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 31 Jul 2014 14:02:25 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E6=97=B6=E5=88=A0=E9=99=A4=E7=AB=9E=E8=B5=9B=E4=B8=8B=E6=89=80?=
=?UTF-8?q?=E6=9C=89=E4=BD=9C=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/contest.rb | 2 +-
app/models/contesting_softapplication.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/contest.rb b/app/models/contest.rb
index e1706b166..f1503f593 100644
--- a/app/models/contest.rb
+++ b/app/models/contest.rb
@@ -6,7 +6,7 @@ class Contest < ActiveRecord::Base
has_many :contesting_projects, :dependent => :destroy
has_many :projects, :through => :contesting_projects
has_many :contesting_softapplications, :dependent => :destroy
- has_many :softapplications, :through => :contesting_softapplications
+ has_many :softapplications, :through => :contesting_softapplications, :dependent => :destroy
has_many :projects_member, :class_name => 'User', :through => :projects
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
diff --git a/app/models/contesting_softapplication.rb b/app/models/contesting_softapplication.rb
index f880818d9..f91c16f69 100644
--- a/app/models/contesting_softapplication.rb
+++ b/app/models/contesting_softapplication.rb
@@ -3,7 +3,7 @@ class ContestingSoftapplication < ActiveRecord::Base
attr_accessible :contest_id, :description, :softapplication_id, :user_id
belongs_to :contest
- belongs_to :softapplication
+ belongs_to :softapplication, :dependent => :destroy
belongs_to :user
From 8b80d99a7093595f8e98006e7e37e6646d1cde41 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 31 Jul 2014 14:39:18 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E6=A0=87=E8=AE=B0=E6=90=9C=E7=B4=A2=E4=B8=8D=E6=AD=A3=E7=A1=AE?=
=?UTF-8?q?=E7=9A=84BUG=20issues#1089?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/tags_controller.rb | 23 ++++++++++++-----------
app/helpers/attachments_helper.rb | 3 ++-
app/views/tags/_show_attachments.html.erb | 2 +-
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index ba01aa990..1318e40a5 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -71,8 +71,8 @@ class TagsController < ApplicationController
@projects_results,
@issues_results,
@bids_results,
- @forums_results,
- attachments_results,
+ @forums_results,
+ @attachments_results,
@contests_results,
@courses_results,
@open_source_projects_results= refresh_results(@obj_id,@obj_flag,@selected_tags)
@@ -107,8 +107,8 @@ class TagsController < ApplicationController
@projects_results,
@issues_results,
@bids_results,
- @forums_results,
- attachments_results,
+ @forums_results,
+ @attachments_results,
@contests_results,
@courses_results,
@open_source_projects_results= refresh_results(@obj_id,@show_flag)
@@ -130,8 +130,8 @@ class TagsController < ApplicationController
@projects_results,
@issues_results,
@bids_results,
- @forums_results,
- attachments_results,
+ @forums_results,
+ @attachments_results,
@contests_results,
@courses_results,
@open_source_projects_results= refresh_results(@obj_id,@show_flag)
@@ -199,7 +199,7 @@ class TagsController < ApplicationController
@bids_results = nil
@contests_results = nil
@forums_results = nil
- attachments_results = nil
+ @attachments_results = nil
@open_source_projects_results = nil
@obj_pages = nil
@obj = nil
@@ -228,8 +228,9 @@ class TagsController < ApplicationController
# modifed by Long Jun
# this is used to find the attachments that came from the same project and tagged with the same tag.
- @result = get_attachments_by_project_tag(selected_tags, @obj)
- @obj_pages, attachments_results, @results_count = for_pagination(@result)
+ #@result = get_attachments_by_project_tag(selected_tags, @obj)
+ @result = get_attachments_by_tag(selected_tags)
+ @obj_pages, @attachments_results, @results_count = for_pagination(@result)
when '7'
@obj = Contest.find_by_id(obj_id)
@obj_pages,@contests_results,@results_count = for_pagination(get_contests_by_tag(selected_tags))
@@ -249,8 +250,8 @@ class TagsController < ApplicationController
@projects_results,
@issues_results,
@bids_results,
- @forums_results,
- attachments_results,
+ @forums_results,
+ @attachments_results,
@contests_results,
@courses_results,
@open_source_projects_results]
diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb
index b43eb22f1..ee9d2a70d 100644
--- a/app/helpers/attachments_helper.rb
+++ b/app/helpers/attachments_helper.rb
@@ -87,8 +87,9 @@ module AttachmentsHelper
@project_id = obj.container_id
end
- Attachment.tagged_with(tag_name).order('created_on desc').where("(container_id = :project_id and container_type = 'Project') or
+ attachments = Attachment.tagged_with(tag_name).order('created_on desc').where("(container_id = :project_id and container_type = 'Project') or
(container_id in (select id from versions where project_id =:project_id) and container_type = 'Version')", {:project_id => @project_id})
+ return attachments
end
diff --git a/app/views/tags/_show_attachments.html.erb b/app/views/tags/_show_attachments.html.erb
index 43ed76e02..8b0bb1f8b 100644
--- a/app/views/tags/_show_attachments.html.erb
+++ b/app/views/tags/_show_attachments.html.erb
@@ -1,5 +1,5 @@
-<% if attachments_results.try(:size).to_i < 0 %>
+<% if attachments_results.nil? || attachments_results.try(:size).to_i < 0 %>
<% else %>
<% attachments_results.each do |file| %>
From d5ac443f90b0991bdd4f493eb6312098202ea21f Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 31 Jul 2014 17:02:30 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AB=9E=E8=B5=9B?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E4=B8=8D?=
=?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=9A=84BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/contests_controller.rb | 5 +++--
app/views/repositories/_form_create.html.erb | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb
index f0597fafb..e2f5e3731 100644
--- a/app/controllers/contests_controller.rb
+++ b/app/controllers/contests_controller.rb
@@ -29,8 +29,9 @@ class ContestsController < ApplicationController
# @contests = Contest.visible
# @contests ||= []
@offset, @limit = api_offset_and_limit({:limit => 10})
- @contests = Contest.visible
- @contests = @contests.like(params[:name]) if params[:name].present?
+ #@contests = Contest.visible
+ #@contests = @contests.like(params[:name]) if params[:name].present?
+ @contests = Contest.visible.where("name like '%#{params[:name]}%'")
if params[:contests_search]
(redirect_to contests_path, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
end
diff --git a/app/views/repositories/_form_create.html.erb b/app/views/repositories/_form_create.html.erb
index 89ae6ffd0..669f47071 100644
--- a/app/views/repositories/_form_create.html.erb
+++ b/app/views/repositories/_form_create.html.erb
@@ -22,12 +22,12 @@ border:none
<% end %>
<%= f.check_box :is_default, :label => :field_repository_is_default %>
- <%= f.text_field :identifier, :required=>true, :disabled => @repository.identifier_frozen?, :label => l(:label_repository_name) %>
+ <%= f.text_field :identifier, :required=>true, :disabled => @repository.identifier_frozen?, :label => l(:label_repository_name)%>
<% unless @repository.identifier_frozen? %>
<%= l(:text_length_between, :min => 1, :max => Repository::IDENTIFIER_MAX_LENGTH) %>
<%= l(:text_repository_identifier_info).html_safe %>
<% end %>
-
+
<%= f.password_field :upassword, :required =>true, :label=> :field_password %>
<%= l(:label_upassword_info)%>
From c1519984de098a40164b66fd30bda13675927899 Mon Sep 17 00:00:00 2001
From: zhanghaitao
Date: Fri, 1 Aug 2014 13:56:12 +0800
Subject: [PATCH 7/7] =?UTF-8?q?Issue#1091,=E6=96=87=E6=9C=AC=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9?=
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 27afed749..f2140fd9b 100644
--- a/app/views/welcome/contest.html.erb
+++ b/app/views/welcome/contest.html.erb
@@ -157,7 +157,7 @@
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
-
+
<%= image_tag('/images/contest1.png')%>
@@ -173,7 +173,7 @@
<% end %>
-
+
<%=contest.description.truncate(100, omission: '...')%>
|