From d2a87127da4eda0e15cd422d1c3510c9516d05a3 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 23 Nov 2015 09:32:03 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E6=88=91=E7=9A=84=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_organizations.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb index e9d78e695..50bb24000 100644 --- a/app/views/users/user_organizations.html.erb +++ b/app/views/users/user_organizations.html.erb @@ -6,12 +6,12 @@
组织列表 - - + <%= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %> + - - - + + 搜索 + <% end %>
From 1914639bc309ad486ae300d103832ef0003e39c0 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 23 Nov 2015 10:17:20 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9F=90=E6=88=90=E5=91=98=E5=90=8E=EF=BC=8C=E5=9C=A8=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E4=B8=AD=E8=BE=93=E5=85=A5=E7=9A=84=E8=AF=A5?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=85=B3=E9=94=AE=E5=AD=97=E5=B0=B1=E8=A6=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_member/create.js.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/org_member/create.js.erb b/app/views/org_member/create.js.erb index f1e48281f..25bbded34 100644 --- a/app/views/org_member/create.js.erb +++ b/app/views/org_member/create.js.erb @@ -4,4 +4,5 @@ $("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>'); $("#principals_for_new_member").html(''); $("#org_members_count_id").html("<%= @org.org_members.count %>"); + $("#not_org_member_search").val(""); <% end %> \ No newline at end of file From 71e98c873d70e19218cacc8d3cbd9b0638d56b80 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 23 Nov 2015 16:40:21 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=A1=86=E4=B8=AD=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E4=B8=BA=E7=81=B0=E8=89=B2=EF=BC=8C=E5=BD=93?= =?UTF-8?q?=E7=84=A6=E7=82=B9=E6=94=BE=E5=9C=A8=E8=BE=93=E5=85=A5=E6=A1=86?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=9B=BE=E7=89=87=E9=A2=9C=E8=89=B2=E5=8F=98?= =?UTF-8?q?=E4=BA=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_show_org_document.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index e74da846e..0142e6f37 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -87,7 +87,7 @@
-
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
From 68bb1422781e1f8f898dda61d22601761ed9fc66 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 23 Nov 2015 17:29:55 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BB=84=E7=BB=87bug:?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=BF=87=E6=BB=A4=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E2=80=9C=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A=E2=80=9D=EF=BC=8C?= =?UTF-8?q?=E6=9C=89=E9=80=9A=E7=9F=A5=E7=AD=89=E5=85=B6=E4=BB=96=E5=8A=A8?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_organizations.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb index 50bb24000..e9d78e695 100644 --- a/app/views/users/user_organizations.html.erb +++ b/app/views/users/user_organizations.html.erb @@ -6,12 +6,12 @@
组织列表 - <%= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %> - + + - - 搜索 - <% end %> + + +
From b46561dac1fe3c0083b8550980d6aa08d28c9a80 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 24 Nov 2015 10:34:23 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=97=B6=E8=8B=A5=E4=BD=9C=E5=93=81=E5=90=8D=E7=A7=B0=E5=92=8C?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=8F=8F=E8=BF=B0=E4=B8=BA=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E4=B8=8D=E5=BC=B9=E5=87=BA=E4=BD=9C=E5=93=81=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/edit.html.erb | 13 ++++++++----- app/views/student_work/new.html.erb | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 517a238b0..d506b5542 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -62,10 +62,13 @@
\ No newline at end of file diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index fdf1e31a3..4f9999277 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -121,10 +121,13 @@
\ No newline at end of file From ccfbc1e0bdb93425667e9ee776a5ebecc2cf16b1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 24 Nov 2015 12:50:43 +0800 Subject: [PATCH 06/19] =?UTF-8?q?1.=E7=BB=84=E7=BB=87=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0type=E5=8F=82=E6=95=B0=EF=BC=9B=202.=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=BB=84=E7=BB=87=E8=A1=A8=E4=B8=AD=E5=86=97=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81=E5=92=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E5=8A=A8=E6=80=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_org_activities.html.erb | 2 +- ...1124032319_delete_useless_org_activities.rb | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20151124032319_delete_useless_org_activities.rb diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb index aa48fedf1..33ac13e76 100644 --- a/app/views/organizations/_org_activities.html.erb +++ b/app/views/organizations/_org_activities.html.erb @@ -56,7 +56,7 @@ <% end %> <% if org_act_count == 10 %> -
展开更多<%=link_to "", organization_path(org,:page => page.to_i + 1),:id => "more_org_activities_link",:remote => "true",:class => "none" %>
+
展开更多<%=link_to "", organization_path(org,:page => page.to_i + 1, :type => params[:type]),:id => "more_org_activities_link",:remote => "true",:class => "none" %>
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end%> diff --git a/db/migrate/20151124032319_delete_useless_org_activities.rb b/db/migrate/20151124032319_delete_useless_org_activities.rb new file mode 100644 index 000000000..705e0dbed --- /dev/null +++ b/db/migrate/20151124032319_delete_useless_org_activities.rb @@ -0,0 +1,18 @@ +class DeleteUselessOrgActivities < ActiveRecord::Migration + def up + OrgActivity.all.each do |act| + if act.container_type == 'Course' + if CourseActivity.where("course_act_type=? and course_act_id =? and course_id =?", act.org_act_type, act.org_act_id, act.container_id).count == 0 + puts "course" + end + else + if act.container_type == 'Project' and ForgeActivity.where("forge_act_type=? and forge_act_id =? and project_id =?", act.org_act_type, act.org_act_id, act.container_id).count == 0 + act.destroy + end + end + end + end + + def down + end +end From 269d2f992eecdbbc426c12184622cc2f5a4bf32e Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 24 Nov 2015 15:02:25 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A1=86=E8=B0=83=E6=95=B4=E5=90=8E=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_organizations.html.erb | 6 +++--- public/stylesheets/new_user.css | 1 + public/stylesheets/org.css | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb index 50bb24000..25a0c4508 100644 --- a/app/views/users/user_organizations.html.erb +++ b/app/views/users/user_organizations.html.erb @@ -6,11 +6,11 @@
组织列表 - <%= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %> - + <%#= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %> + - 搜索 + <% end %>
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index d18dd27d8..fd7c0c4d6 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -384,6 +384,7 @@ a.resourcesGrey:hover {font-size:12px; color:#269ac9;} a.uploadText {color:#ffffff; font-size:14px;} .resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:left; background-color:#ffffff;} .searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;} +.searchResource:focus {border:none;} .searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;} /*.resourcesSearchBanner {height:34px; margin-bottom:10px;}*/ .resourcesSearchBanner {width:710px; height:34px; margin-bottom:10px; margin-top:15px; margin-left:auto; margin-right:auto;} diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 914df16b5..daabfc99d 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -37,7 +37,7 @@ a.org_member_btn{ padding:1px 5px; background:#15bccf; color:#fff;} /*项目关联css*/ .relateOrg {width:335px;} .relatedList {width:335px;} -.searchOrg {height:24px; width:200px; color:#9b9b9b9; border:1px solid #15bccf;} +.searchOrg {height:24px; width:200px; color:#9b9b9b; border:1px solid #15bccf;} a.cancelBtn {padding:3px 5px; background-color:#D9D9D9; color:#656565;} a.cancelBtn:hover {background-color:#717171; color:#ffffff;} .relatedList ul li {border-bottom:1px solid #e4e4e4; width:320px; height:22px; vertical-align:middle; line-height:22px;} From 3a66b1859c716bb9668f6805cb9df1fbadfb2e23 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 24 Nov 2015 16:47:31 +0800 Subject: [PATCH 08/19] =?UTF-8?q?reserved=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/zh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4563944c8..ea172b554 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2081,7 +2081,7 @@ zh: label_co_organizer_BHU: 北京航空航天大学 label_co_organizer_CAS: 中国科学院软件研究所 label_co_organizer_InforS: 中创软件 - label_rights_reserved: Copyright 2007~2015, All Rights Riserved + label_rights_reserved: Copyright 2007~2015, All Rights Reserved label_about_us: 关于我们 label_contact_us: 联系我们 label_recruitment_information: 招聘信息 From 2dc31637d862c11911ee26004c0f3d81d978f677 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 24 Nov 2015 17:29:58 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=92=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E5=8A=A0=E5=85=A5=E7=BB=84=E7=BB=87=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=B7=B2=E7=BB=8F=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=BA=86=E6=9F=90=E7=BB=84=E7=BB=87=EF=BC=8C=E5=B0=B1=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E9=87=8D=E5=A4=8D=E5=8A=A0=E5=85=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_courses_controller.rb | 4 +++- app/controllers/org_projects_controller.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/org_courses_controller.rb b/app/controllers/org_courses_controller.rb index 3d1d313c5..d054e41de 100644 --- a/app/controllers/org_courses_controller.rb +++ b/app/controllers/org_courses_controller.rb @@ -3,7 +3,9 @@ class OrgCoursesController < ApplicationController org_ids = params[:orgNames] @course = Course.find(params[:course_id]) org_ids.each do |org_id| - OrgCourse.create(:organization_id => org_id.to_i, :course_id => params[:course_id].to_i, :created_at => Time.now) + if OrgCourse.where("organization_id =? and course_id =?", org_id.to_i, params[:course_id].to_i).count == 0 + OrgCourse.create(:organization_id => org_id.to_i, :course_id => params[:course_id].to_i, :created_at => Time.now) + end end respond_to do |format| format.js diff --git a/app/controllers/org_projects_controller.rb b/app/controllers/org_projects_controller.rb index 29e60a62a..a455ce408 100644 --- a/app/controllers/org_projects_controller.rb +++ b/app/controllers/org_projects_controller.rb @@ -3,7 +3,9 @@ class OrgProjectsController < ApplicationController org_ids = params[:orgNames] @project = Project.find(params[:project_id]) org_ids.each do |org_id| - OrgProject.create(:organization_id => org_id.to_i, :project_id => params[:project_id].to_i, :created_at => Time.now) + if OrgProject.where("organization_id =? and project_id =?", org_id.to_i, @project.id).count == 0 + OrgProject.create(:organization_id => org_id.to_i, :project_id => params[:project_id].to_i, :created_at => Time.now) + end end respond_to do |format| format.js From 394d60049d0f0ea4a3860358babe5ebe9ce6aa3e Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 25 Nov 2015 09:48:20 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 59 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 95f79b84b..97c566feb 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 => 20151120134208) do +ActiveRecord::Schema.define(:version => 20151124032319) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -241,6 +241,58 @@ ActiveRecord::Schema.define(:version => 20151120134208) 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 @@ -539,7 +591,7 @@ ActiveRecord::Schema.define(:version => 20151120134208) do end create_table "exercise_questions", :force => true do |t| - t.text "question_title" + t.string "question_title" t.integer "question_type" t.integer "question_number" t.integer "exercise_id" @@ -568,7 +620,7 @@ ActiveRecord::Schema.define(:version => 20151120134208) do end create_table "exercises", :force => true do |t| - t.text "exercise_name" + t.string "exercise_name" t.text "exercise_description" t.integer "course_id" t.integer "exercise_status" @@ -1085,6 +1137,7 @@ ActiveRecord::Schema.define(:version => 20151120134208) do create_table "org_members", :force => true do |t| t.integer "user_id" t.integer "organization_id" + t.string "role" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end From 9c3aed802841b46ff98c25accd2b9e8c6eaf3e54 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 26 Nov 2015 16:29:50 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 36 +++++++ app/views/layouts/base_org.html.erb | 23 +++++ .../organizations/_join_course_menu.html.erb | 98 +++++++++++++++++++ .../organizations/join_course_menu.js.erb | 12 +++ app/views/organizations/search_courses.js.erb | 9 ++ config/routes.rb | 3 + public/stylesheets/new_user.css | 1 + public/stylesheets/org.css | 1 + 8 files changed, 183 insertions(+) create mode 100644 app/views/organizations/_join_course_menu.html.erb create mode 100644 app/views/organizations/join_course_menu.js.erb create mode 100644 app/views/organizations/search_courses.js.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 0d22ab461..4277b5976 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -175,4 +175,40 @@ class OrganizationsController < ApplicationController format.js end end + + def join_course_menu + @organization = Organization.find(params[:id]) + respond_to do |format| + format.js + end + end + + def search_courses + @organization = Organization.find(params[:id]) + condition = '%%' + if !params[:name].nil? + condition = "%#{params[:name].strip}%".gsub(" ","") + end + #sql = "select courses.* from courses inner join members on courses.id = members.course_id inner join org_courses on courses.id = org_courses.course_id where org_courses.organization_id != #{@organization.id} and members.user_id = #{User.current.id} and courses.name like '#{condition}'" + sql = "select courses.* from courses inner join members on courses.id = members.course_id where members.user_id = #{User.current.id} and courses.name like '#{condition}'" + user_courses = Course.find_by_sql(sql) + @added_course_ids = @organization.courses.map(&:id) + @courses = [] + user_courses.each do |course| + if @added_course_ids.include?(course.id) + @courses << course + end + end + end + + def join_courses + @organization = Organization.find(params[:id]) + course_ids = params[:courseNames] + course_ids.each do |id| + OrgCourse.create(:organization_id => @organization.id, :course_id => id.to_i, :created_at => Time.now) + end + respond_to do |format| + format.js + end + end end diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 84edf02e1..7c55060b4 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -98,6 +98,18 @@
课程 +
+
    +
  • +
      + +
    • + <%= link_to "加入课程",join_course_menu_organization_path(@organization),:remote => true,:class => "menuGrey",:method => "post"%> +
    • +
    +
  • +
+
@@ -122,9 +134,20 @@
+ + + + diff --git a/app/views/organizations/_join_course_menu.html.erb b/app/views/organizations/_join_course_menu.html.erb new file mode 100644 index 000000000..36894d92e --- /dev/null +++ b/app/views/organizations/_join_course_menu.html.erb @@ -0,0 +1,98 @@ + + + + + + + + + + + + + +
+
+
请选择关联到组织的课程
+
+
+
+ <%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %> + +
+
+ 关联 +
+ + <% end %> +
+ +
+
+
+
+
+ + + + diff --git a/app/views/organizations/join_course_menu.js.erb b/app/views/organizations/join_course_menu.js.erb new file mode 100644 index 000000000..95b9f282f --- /dev/null +++ b/app/views/organizations/join_course_menu.js.erb @@ -0,0 +1,12 @@ +$('#topnav_course_menu').hide(); +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_course_menu', :locals => {:organization_id => @organization.id}) %>'); +$('#ajax-modal').show(); +//showModal('ajax-modal', '540px'); +//$('#ajax-modal').css('height','390px'); +////$('#ajax-modal').siblings().remove(); +////$('#ajax-modal').siblings().hide(); +//$('#ajax-modal').before("" + +// ""); +//$('#ajax-modal').parent().removeClass("alert_praise"); +//$('#ajax-modal').parent().css("top","").css("left",""); +//$('#ajax-modal').parent().addClass("alert_box"); \ No newline at end of file diff --git a/app/views/organizations/search_courses.js.erb b/app/views/organizations/search_courses.js.erb new file mode 100644 index 000000000..9e92b4b07 --- /dev/null +++ b/app/views/organizations/search_courses.js.erb @@ -0,0 +1,9 @@ +$("#search_courses_result_list").html(""); +$("#search_courses_result_list").append('
    '); + +<% @courses.each do |course|%> +link = "
  • "; +$("#search_courses_result_list").append(link ); +<%end %> +$("#search_courses_result_list").append('
') + diff --git a/config/routes.rb b/config/routes.rb index d137553ad..f8f0e1cc1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,6 +39,9 @@ RedmineApp::Application.routes.draw do get 'members' get 'more_org_projects' get 'more_org_courses' + get 'search_courses' + post 'join_course_menu' + post 'join_courses' end collection do get 'check_uniq' diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index d18dd27d8..bedfa1ceb 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -384,6 +384,7 @@ a.resourcesGrey:hover {font-size:12px; color:#269ac9;} a.uploadText {color:#ffffff; font-size:14px;} .resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:left; background-color:#ffffff;} .searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;} +.searchCourse {border:none; outline:none; background-color:#ffffff; width:184px; padding-left:10px; display:block; margin-bottom:15px;} .searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;} /*.resourcesSearchBanner {height:34px; margin-bottom:10px;}*/ .resourcesSearchBanner {width:710px; height:34px; margin-bottom:10px; margin-top:15px; margin-left:auto; margin-right:auto;} diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 914df16b5..0a578ccc3 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -44,6 +44,7 @@ a.cancelBtn:hover {background-color:#717171; color:#ffffff;} .relatedListName {width:240px; text-align:left; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} .relatedListOption {width:80px; text-align:center;} .relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} +.search_org {width:150px; max-width:200px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} /*组织列表*/ .mt28 {margin-top:28px;} From b05708f6e8dff7c954fe2d21f5a0deba8d2c6e2c Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 27 Nov 2015 10:43:21 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E4=B8=89=E4=B8=AAbug:=201.=E6=96=B0=E5=BB=BA=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=97=B6=EF=BC=8C=E7=BD=AE=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=92=8C=E6=8F=8F=E8=BF=B0=E4=B8=BA=E7=A9=BA=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=8F=96=E6=B6=88=E6=8C=89=E9=92=AE=EF=BC=8C=E5=8D=B4?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E2=80=9C=E6=A0=87=E9=A2=98=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E2=80=9D=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=202.=E8=AF=BE=E7=A8=8B/=E9=A1=B9=E7=9B=AE=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=BB=84=E7=BB=87=EF=BC=9A=E7=82=B9=E5=87=BB=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E6=8C=89=E9=92=AE=E4=B8=8D=E5=BA=94=E8=AF=A5=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E8=B5=B7=E5=85=B3=E8=81=94=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=88=97=E8=A1=A8=203.=E7=BB=84=E7=BB=87=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=86=85=E5=86=8D=E7=BC=96=E8=BE=91=E7=BB=84?= =?UTF-8?q?=E7=BB=87=EF=BC=8C=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E7=9A=84=E6=8C=89=E9=92=AE=E5=90=8E=E5=8F=88=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E8=BF=94=E5=9B=9E=E7=BB=84=E7=BB=87=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_document_comments_controller.rb | 9 ++++++++- app/views/courses/settings/_join_org.html.erb | 3 +-- app/views/org_document_comments/_new.html.erb | 5 +++-- app/views/org_document_comments/edit.html.erb | 2 +- app/views/org_document_comments/show.html.erb | 2 +- app/views/organizations/_join_course_menu.html.erb | 3 ++- app/views/organizations/_join_project_menu.html.erb | 3 ++- app/views/organizations/_show_org_document.html.erb | 2 +- app/views/projects/settings/_join_org.html.erb | 4 +--- 9 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 61a27c433..776bd132d 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -38,12 +38,19 @@ class OrgDocumentCommentsController < ApplicationController act.update_attributes(:updated_at => @org_document.updated_at) end respond_to do |format| - format.html {redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)} + format.html { + if params[:flag] == 0 + redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id) + else + redirect_to org_document_comment_path(@org_document.root.id, :organization_id => @org_document.organization.id) + end + } end end def edit @org_document = OrgDocumentComment.find(params[:id]) + @flag = params[:flag] @organization = Organization.find(params[:organization_id]) end diff --git a/app/views/courses/settings/_join_org.html.erb b/app/views/courses/settings/_join_org.html.erb index cd2d515cc..fff0f807c 100644 --- a/app/views/courses/settings/_join_org.html.erb +++ b/app/views/courses/settings/_join_org.html.erb @@ -68,8 +68,7 @@ }); }); function cancel_join_orgs() { - $("#search_orgs_result_list").html(""); - $("#paginator").css("display", "none") + $("#join_orgs_for_course input:checked").attr("checked", false); } function course_join_org(courseId) { $.ajax({ diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb index 3a3356c66..a7ce22548 100644 --- a/app/views/org_document_comments/_new.html.erb +++ b/app/views/org_document_comments/_new.html.erb @@ -25,13 +25,14 @@ $("#document_title").val(""); org_document_description_editor.html(""); org_document_description_editor.sync(); - $('#org_document_editor').hide(); $('#doc_title_hint').hide(); + $('#org_document_editor').hide(); + $('#doc_title_hint').hide(); } <%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
- +
diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index 4b50c1064..c4a74c791 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -17,7 +17,7 @@
-<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id),:method => 'put', :id => 'new_org_document_form' do |f| %> +<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag),:method => 'put', :id => 'new_org_document_form' do |f| %>
diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index 9df568e02..31e4f7e05 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -43,7 +43,7 @@ <% end %>
  • - <%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id), :class => "postOptionLink" %> + <%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %>
  • <%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id), :method => 'delete', diff --git a/app/views/organizations/_join_course_menu.html.erb b/app/views/organizations/_join_course_menu.html.erb index e11ef46e0..e66d0bcce 100644 --- a/app/views/organizations/_join_course_menu.html.erb +++ b/app/views/organizations/_join_course_menu.html.erb @@ -79,7 +79,8 @@ }); }); function cancel_join_courses() { - $("#search_courses_result_list").html(""); + $("#join_courses_form input:checked").attr("checked", false); + //$("#search_courses_result_list").html(""); } function org_join_courses(orgId) { $.ajax({ diff --git a/app/views/organizations/_join_project_menu.html.erb b/app/views/organizations/_join_project_menu.html.erb index 4b77ee043..765b4b23a 100644 --- a/app/views/organizations/_join_project_menu.html.erb +++ b/app/views/organizations/_join_project_menu.html.erb @@ -75,7 +75,8 @@ }); }); function cancel_join_projects() { - $("#search_projects_result_list").html(""); + $("#join_projects_form input:checked").attr("checked", false); + //$("#search_projects_result_list").html(""); } function org_join_projects(orgId) { $.ajax({ diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 0142e6f37..888cbbf68 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -36,7 +36,7 @@ <% end %>
  • - <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %> + <%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => 0), :class => "postOptionLink" %>
  • <%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete', diff --git a/app/views/projects/settings/_join_org.html.erb b/app/views/projects/settings/_join_org.html.erb index 8b8425934..982e7b79e 100644 --- a/app/views/projects/settings/_join_org.html.erb +++ b/app/views/projects/settings/_join_org.html.erb @@ -67,9 +67,7 @@ }); }); function cancel_join_orgs() { - $("#search_orgs_result_list").html(""); - $("#paginator").html(""); - $("#paginator").css("display", "none"); + $("#join_orgs_for_project input:checked").attr("checked", false); } function join_org(projectId) { $.ajax({ From 042b1977671e99cd8180ba2120bbc4f37f8c4a4f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 27 Nov 2015 10:49:41 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E6=A6=9C=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4=20=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C=E8=A7=A6=E5=8F=91=E7=9A=84=E6=97=B6=E5=80=99=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=80=BB=E5=88=86=20=E6=9B=B4=E6=8D=A2=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 20 ++++--- app/helpers/courses_helper.rb | 2 +- app/models/course_contributor_score.rb | 2 +- app/views/courses/_tool_expand.html.erb | 14 ++--- app/views/layouts/base_courses.html.erb | 58 +++++++++++-------- ...1125072235_add_course_contributor_score.rb | 36 ------------ ...1351_add_course_contributor_total_score.rb | 36 ++++++++++++ db/schema.rb | 2 +- public/stylesheets/courses.css | 2 +- 9 files changed, 94 insertions(+), 78 deletions(-) delete mode 100644 db/migrate/20151125072235_add_course_contributor_score.rb create mode 100644 db/migrate/20151127011351_add_course_contributor_total_score.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a65ed639c..046e0c5a0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -83,34 +83,38 @@ module ApplicationHelper when "JournalForMessage" if course_contributor_score.nil? CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0, - :news_reply_num => 0, :resource_num => 0, :journal_num => 1, :journal_reply_num => 0) + :news_reply_num => 0, :resource_num => 0, :journal_num => 1, :journal_reply_num => 0, :total_score => 1) else score = course_contributor_score.journal_num + 1 - course_contributor_score.update_attributes(:journal_num => score) + total_score = course_contributor_score.total_score + 1 + course_contributor_score.update_attributes(:journal_num => score, :total_score => total_score) end when "Message" if course_contributor_score.nil? CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 2, :message_reply_num => 0, - :news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0) + :news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0, :total_score => 2) else score = course_contributor_score.message_num + 2 - course_contributor_score.update_attributes(:message_num => score) + total_score = course_contributor_score.total_score + 2 + course_contributor_score.update_attributes(:message_num => score, :total_score => total_score) end when "MessageReply" if course_contributor_score.nil? CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 1, - :news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0) + :news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0, :total_score => 1) else score = course_contributor_score.message_reply_num + 1 - course_contributor_score.update_attributes(:message_reply_num => score) + total_score = course_contributor_score.total_score + 1 + course_contributor_score.update_attributes(:message_reply_num => score, :total_score => total_score) end when "NewReply" if course_contributor_score.nil? CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0, - :news_reply_num => 1, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0) + :news_reply_num => 1, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0, :total_score => 1) else score = course_contributor_score.news_reply_num + 1 - course_contributor_score.update_attributes(:news_reply_num => score) + total_score = course_contributor_score.total_score + 1 + course_contributor_score.update_attributes(:news_reply_num => score, :total_score => total_score) end end end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 022d86d9b..1d82d035d 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -758,7 +758,7 @@ module CoursesHelper end def contributor_course_scor(course_id) - ccs = CourseContributorScore.where("course_id =?", course_id).limit(9) + ccs = CourseContributorScore.where("course_id =?", course_id).order("total_score desc") .limit(9) end end diff --git a/app/models/course_contributor_score.rb b/app/models/course_contributor_score.rb index 598b8e014..f2b05458f 100644 --- a/app/models/course_contributor_score.rb +++ b/app/models/course_contributor_score.rb @@ -1,5 +1,5 @@ class CourseContributorScore < ActiveRecord::Base - attr_accessible :course_id, :journal_num, :journal_reply_num, :message_num, :message_reply_num, :news_reply_num, :resource_num, :user_id + attr_accessible :course_id, :journal_num, :journal_reply_num, :message_num, :message_reply_num, :news_reply_num, :resource_num, :user_id, :total_score belongs_to :course belongs_to :user end diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index cec5311c6..9a36b8efb 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -2,19 +2,19 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% if show_nav?(@course.homework_commons.count) %> <% end %> <% if show_nav?(@course.news.count) %> <% end %> <% if show_nav?(course_file_num) %> <%# 课程贡献榜 %>
    + <% unless contributor_course_scor(@course.id).count == 0 %> + <% end %> +

    <%= l(:label_course_brief_introduction)%>:

    diff --git a/db/migrate/20151125072235_add_course_contributor_score.rb b/db/migrate/20151125072235_add_course_contributor_score.rb deleted file mode 100644 index 99ef60cf0..000000000 --- a/db/migrate/20151125072235_add_course_contributor_score.rb +++ /dev/null @@ -1,36 +0,0 @@ -class AddCourseContributorScore < ActiveRecord::Migration - def up - # course_count = Course.all.count / 30 + 1 - # transaction do - # for i in 1 ... course_count do i - Course.all.each do |course| - if course.course_activities.count > 1 - course.student.each do |s| - puts course.id - puts course.name - puts s.student_id - # board_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?",s.student_id, course.id, "Message").count * 2 - board_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.student_id} and me.parent_id is null;").count * 2 - message_reply_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.student_id} and me.parent_id is not null").count * 1 - common_reply_count = Comment.find_by_sql("select cm.* from comments cm, news n where cm.author_id = #{s.student_id} and n.course_id = #{course.id} and cm.commented_id = n.id and cm.commented_type ='News'").count * 1 - # attachment_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "Attachment").count * 5 - attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.student_id};").count * 5 - journal_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ", s.student_id, course.id, "Course").count * 1 - # journal_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "JournalsForMessage").count * 1 - # journal_reply_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? and status =?", s.student_id, course.id, "Course",1).count * 1 - total = board_count + message_reply_count + common_reply_count + attachment_count + journal_count - if total !=0 - CourseContributorScore.create(:course_id => course.id, :user_id => s.student_id, :message_num => board_count, :message_reply_num => message_reply_count, - :news_reply_num => common_reply_count, :resource_num => attachment_count, :journal_num => journal_count, :journal_reply_num => 0, :total => total) - end - - end - end - end - # end - # end - end - - def down - end -end \ No newline at end of file diff --git a/db/migrate/20151127011351_add_course_contributor_total_score.rb b/db/migrate/20151127011351_add_course_contributor_total_score.rb new file mode 100644 index 000000000..2606864d8 --- /dev/null +++ b/db/migrate/20151127011351_add_course_contributor_total_score.rb @@ -0,0 +1,36 @@ +class AddCourseContributorTotalScore < ActiveRecord::Migration + def up + # course_count = Course.all.count / 30 + 1 + # transaction do + # for i in 1 ... course_count do i + Course.all.each do |course| + if course.course_activities.count > 1 + course.student.each do |s| + puts course.id + puts course.name + puts s.student_id + # board_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?",s.student_id, course.id, "Message").count * 2 + board_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.student_id} and me.parent_id is null;").count * 2 + message_reply_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.student_id} and me.parent_id is not null").count * 1 + common_reply_count = Comment.find_by_sql("select cm.* from comments cm, news n where cm.author_id = #{s.student_id} and n.course_id = #{course.id} and cm.commented_id = n.id and cm.commented_type ='News'").count * 1 + # attachment_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "Attachment").count * 5 + attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.student_id};").count * 5 + journal_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ", s.student_id, course.id, "Course").count * 1 + # journal_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "JournalsForMessage").count * 1 + # journal_reply_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? and status =?", s.student_id, course.id, "Course",1).count * 1 + total = board_count + message_reply_count + common_reply_count + attachment_count + journal_count + if total !=0 + CourseContributorScore.create(:course_id => course.id, :user_id => s.student_id, :message_num => board_count, :message_reply_num => message_reply_count, + :news_reply_num => common_reply_count, :resource_num => attachment_count, :journal_num => journal_count, :journal_reply_num => 0, :total_score => total) + end + + end + end + end + # end + # end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 8a0ec8605..8e2082b37 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 => 20151126160252) do +ActiveRecord::Schema.define(:version => 20151127011351) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 7d5d66103..bdcfbd08e 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1172,7 +1172,7 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;} .courseMenuSetting {background:url(../images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top:3px; float:right; margin-right:5px;} .courseMenuSetting:hover {background:url(../images/homepage_icon2.png) -190px -407px no-repeat;} .rankList {width:220px; padding:10px; background-color:#ffffff; margin-top:10px;} -.rankList li {width:73px; padding:5px 0px; text-align:center; float:left; position:relative;} +.rankList li {width:73px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;} .rankList li p {width:100%; overflow:hidden; white-space:normal; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;} .rankPortrait {border-radius:50%; width:35px; height:35px;} .numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; width:65px; color:#585858;} \ No newline at end of file From 4aa827eb4a24737eeef3de96920d35efd44cabf0 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 27 Nov 2015 11:02:48 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E7=82=B9=E5=87=BB=E9=A1=B9=E7=9B=AE=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=EF=BC=8C=E5=86=8D?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B1=95=E5=BC=80=E5=88=97=E8=A1=A8=EF=BC=9B?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=AF=BE=E7=A8=8B=E5=90=8C=E6=A0=B7=E5=A6=82?= =?UTF-8?q?=E6=AD=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index e5c238ac5..89777de01 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -85,7 +85,7 @@
    <%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
    -
    项目 +
    项目
    • @@ -100,7 +100,7 @@
    -
    +
      <%= render :partial => 'layouts/org_projects',:locals=>{:projects=>@organization.projects.reorder('created_at').limit(5),:org_id=>@organization.id,:page=>1}%> @@ -109,7 +109,7 @@
    -
    课程 +
    课程
    • @@ -124,7 +124,7 @@
    -
    +
      <%= render :partial => 'layouts/org_courses',:locals=>{:courses=>@organization.courses.reorder('created_at').limit(5),:org_id=>@organization.id,:page=>1}%>
    @@ -146,8 +146,6 @@
    - - From e0f4050779cab8a2ba58b7589e18220634b0a00f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 27 Nov 2015 12:34:02 +0800 Subject: [PATCH 15/19] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=B8=AD=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE=E5=92=8C=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E5=86=85=E5=AE=B9=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/views/layouts/base_org.html.erb | 57 ++++++++++--------- app/views/organizations/join_projects.js.erb | 3 + ...124032319_delete_useless_org_activities.rb | 2 +- 4 files changed, 36 insertions(+), 28 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index dce472346..ba4dda939 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -225,7 +225,7 @@ class OrganizationsController < ApplicationController if !params[:name].nil? condition = "%#{params[:name].strip}%".gsub(" ","") end - sql = "select projects.* from projects inner join members on projects.id = members.course_id where members.user_id = #{User.current.id} and projects.name like '#{condition}'" + sql = "select projects.* from projects inner join members on projects.id = members.project_id where members.user_id = #{User.current.id} and projects.status != 9 and projects.name like '#{condition}'" user_projects = Course.find_by_sql(sql) @added_course_ids = @organization.projects.map(&:id) @projects = [] diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 89777de01..b89977b09 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -85,19 +85,21 @@
    <%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
    -
    项目 -
    -
      -
    • -
        - -
      • - <%= link_to "加入项目",join_project_menu_organization_path(@organization),:remote => true,:class => "menuGrey",:method => "post"%> -
      • -
      -
    • -
    -
    +
    + 项目 + <%=link_to "", join_project_menu_organization_path(@organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%> + + + + + + + + + + + +
    @@ -109,19 +111,22 @@
    -
    课程 -
    -
      -
    • -
        - -
      • - <%= link_to "加入课程",join_course_menu_organization_path(@organization),:remote => true,:class => "menuGrey",:method => "post"%> -
      • -
      -
    • -
    -
    +
    + 课程 + <%=link_to "", join_course_menu_organization_path(@organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%> + <%#= link_to "关联课程",join_course_menu_organization_path(@organization),:remote => true,:class => "menuGrey",:method => "post"%> + + + + + + + + + + + +
    diff --git a/app/views/organizations/join_projects.js.erb b/app/views/organizations/join_projects.js.erb index e69de29bb..b796d5f99 100644 --- a/app/views/organizations/join_projects.js.erb +++ b/app/views/organizations/join_projects.js.erb @@ -0,0 +1,3 @@ +//$("#homepageLeftMenuProjects").html(""); +//$("#homepageLeftMenuProjects").append("
      "); +//$("#homepageLeftMenuProjects").append("<%#= escape_javascript %>") \ No newline at end of file diff --git a/db/migrate/20151124032319_delete_useless_org_activities.rb b/db/migrate/20151124032319_delete_useless_org_activities.rb index 705e0dbed..57d858e7e 100644 --- a/db/migrate/20151124032319_delete_useless_org_activities.rb +++ b/db/migrate/20151124032319_delete_useless_org_activities.rb @@ -3,7 +3,7 @@ class DeleteUselessOrgActivities < ActiveRecord::Migration OrgActivity.all.each do |act| if act.container_type == 'Course' if CourseActivity.where("course_act_type=? and course_act_id =? and course_id =?", act.org_act_type, act.org_act_id, act.container_id).count == 0 - puts "course" + act.destroy end else if act.container_type == 'Project' and ForgeActivity.where("forge_act_type=? and forge_act_id =? and project_id =?", act.org_act_type, act.org_act_id, act.container_id).count == 0 From 365349878dad13ca703a9d66459155bd23312d86 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 27 Nov 2015 13:17:23 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=88=96=E8=80=85=E8=AF=BE=E7=A8=8B=EF=BC=8C?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E5=92=8C?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=EF=BC=9B=E5=90=8C=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=BC=B9=E7=AA=97=E7=BB=99=E5=87=BA=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_join_course_menu.html.erb | 1 + app/views/organizations/_join_project_menu.html.erb | 1 + app/views/organizations/join_courses.js.erb | 5 +++++ app/views/organizations/join_projects.js.erb | 8 +++++--- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/_join_course_menu.html.erb b/app/views/organizations/_join_course_menu.html.erb index e66d0bcce..a643acdcf 100644 --- a/app/views/organizations/_join_course_menu.html.erb +++ b/app/views/organizations/_join_course_menu.html.erb @@ -91,6 +91,7 @@ url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(), type: "get" }); + alert("加入成功"); } }); } diff --git a/app/views/organizations/_join_project_menu.html.erb b/app/views/organizations/_join_project_menu.html.erb index 765b4b23a..ea5b4ce25 100644 --- a/app/views/organizations/_join_project_menu.html.erb +++ b/app/views/organizations/_join_project_menu.html.erb @@ -87,6 +87,7 @@ url: "/organizations/" + orgId + "/search_projects?name=" + $("input[name='projects']").val().trim(), type: "get" }); + alert("加入成功"); } }); } diff --git a/app/views/organizations/join_courses.js.erb b/app/views/organizations/join_courses.js.erb index e69de29bb..1c234704e 100644 --- a/app/views/organizations/join_courses.js.erb +++ b/app/views/organizations/join_courses.js.erb @@ -0,0 +1,5 @@ +$("#homepageLeftMenuCourses").html(""); +$("#homepageLeftMenuCourses").append("
        "); +$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses', + :locals=>{:courses=>@organization.courses.reorder('created_at').limit(5),:org_id=>@organization.id,:page=> 1}) %>"); +$("#homepageLeftMenuCourses").append("
      "); \ No newline at end of file diff --git a/app/views/organizations/join_projects.js.erb b/app/views/organizations/join_projects.js.erb index b796d5f99..1db8021bf 100644 --- a/app/views/organizations/join_projects.js.erb +++ b/app/views/organizations/join_projects.js.erb @@ -1,3 +1,5 @@ -//$("#homepageLeftMenuProjects").html(""); -//$("#homepageLeftMenuProjects").append("
        "); -//$("#homepageLeftMenuProjects").append("<%#= escape_javascript %>") \ No newline at end of file +$("#homepageLeftMenuProjects").html(""); +$("#homepageLeftMenuProjects").append("
          "); +$("#homepageLeftMenuProjects").append("<%= escape_javascript(render :partial => 'layouts/org_projects', + :locals=>{:projects=>@organization.projects.reorder('created_at').limit(5),:org_id=>@organization.id,:page=> 1}) %>"); +$("#homepageLeftMenuProjects").append("
        "); \ No newline at end of file From 1cc6e305ed723e3686ac9a3612eae560d488ea9f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 27 Nov 2015 13:52:40 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=A8=A1=E5=9D=97=E5=BC=80=E5=8F=91=EF=BC=9A=201?= =?UTF-8?q?=E3=80=81=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E5=88=99=E4=B8=8D=E6=98=BE=E7=A4=BA=202=E3=80=81=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A1=86=E5=B1=95=E5=BC=80=E6=B2=A1=E6=9C=89=E5=88=99?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 17 ++++++++ app/helpers/courses_helper.rb | 3 -- app/models/attachment.rb | 17 +------- app/views/layouts/base_courses.html.erb | 55 ++++++++++++++----------- public/stylesheets/courses.css | 2 +- 5 files changed, 49 insertions(+), 45 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index a2902e3fc..b15be4896 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -374,6 +374,9 @@ class FilesController < ApplicationController if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added') Mailer.run.attachments_added(attachments[:files]) end + # 更新课程英雄榜得分 + update_contributor_score(@course, attachments[:files].first) + # end if params[:course_attachment_type] && params[:course_attachment_type].is_a?(Array) params[:course_attachment_type].each do |type| tag_name = get_tag_name_by_type_number type @@ -423,6 +426,20 @@ class FilesController < ApplicationController end end + def update_contributor_score(course, file ) + unless file.author.allowed_to?(:as_teacher, course) + course_contributor_score = CourseContributorScore.where("course_id =? and user_id =?", course.id, file.author.id).first + if course_contributor_score.nil? + CourseContributorScore.create(:course_id => course.id, :user_id => file.author.id, :message_num => 0, :message_reply_num => 0, + :news_reply_num => 0, :resource_num => 5, :journal_num => 0, :journal_reply_num => 0, :total_score => 5) + else + score = course_contributor_score.resource_num + 5 + total_score = course_contributor_score.total_score + 5 + course_contributor_score.update_attributes(:resource_num => score, :total_score => total_score) + end + end + end + def get_tag_name_by_type_number type case type when "1" diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 1d82d035d..a1b119cb5 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -751,10 +751,7 @@ module CoursesHelper JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 9" - sql = ActiveRecord::Base.connection() homework_scores = Member.find_by_sql(sql_select) - sql.close() - homework_scores end def contributor_course_scor(course_id) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 45d19e681..9c6bb9cb1 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -73,11 +73,10 @@ class Attachment < ActiveRecord::Base cattr_accessor :thumbnails_storage_path @@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails") - before_save :files_to_final_location,:act_as_course_activity, :act_as_student_score + before_save :files_to_final_location,:act_as_course_activity after_create :office_conver, :be_user_score,:act_as_forge_activity after_update :office_conver, :be_user_score after_destroy :delete_from_disk,:down_user_score - # after_save :act_as_student_score # add by nwb # 获取所有可公开的资源文件列表 @@ -562,18 +561,4 @@ class Attachment < ActiveRecord::Base end end - # 课程成员得分(英雄榜) - def act_as_student_score - unless self.author.allowed_to?(:as_teacher, self.container) - course_contributor_score = CourseContributorScore.where("course_id =? and user_id =?", self.container_id, self.author_id).first - if course_contributor_score.nil? - CourseContributorScore.create(:course_id => self.container_id, :user_id => self.author_id, :message_num => 0, :message_reply_num => 0, - :news_reply_num => 0, :resource_num => 5, :journal_num => 0, :journal_reply_num => 0) - else - score = course_contributor_score.news_reply_num + 5 - course_contributor_score.update_attributes(:resource_num => score) - end - end - end - end diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 00c56b7ee..603f7febb 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -196,59 +196,64 @@
    <% end %> <%# 工具栏展开 %> - - + <% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 || + course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %> + + + <% end %>
    <%# 课程贡献榜 %>
    <% unless contributor_course_scor(@course.id).count == 0 %> -
      +

        课程贡献榜

        <% contributor_course_scor(@course.id).each do |contributor_score| %> + <% unless contributor_score.total_score ==0 %>
      • <%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %>

        <%=link_to contributor_score.user, user_path(contributor_score.user), :title => contributor_score.user %>

        - <%#= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id }, - :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", - :onmouseover =>"message_titile_show($(this),event)", - :onmouseout => "message_titile_hide($(this))" %> <%= contributor_score.total_score.to_i %>

      • + <% end %> <% end %>
      + <% end %> + + <% hero_homework_scores = hero_homework_score(@course, "desc") %> + <% unless hero_homework_scores.map(&:score).detect{|s| s != nil}.nil? %> + <% end %> -
      diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index bdcfbd08e..f840f20cf 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1175,4 +1175,4 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;} .rankList li {width:73px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;} .rankList li p {width:100%; overflow:hidden; white-space:normal; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;} .rankPortrait {border-radius:50%; width:35px; height:35px;} -.numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; width:65px; color:#585858;} \ No newline at end of file +.numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; color:#585858; white-space: nowrap;} \ No newline at end of file From 25b66b5dbbd5a7b7b661c4409fbc30481d35dc68 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 27 Nov 2015 14:43:08 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_join_course_menu.html.erb | 1 - app/views/organizations/_join_project_menu.html.erb | 1 - 2 files changed, 2 deletions(-) diff --git a/app/views/organizations/_join_course_menu.html.erb b/app/views/organizations/_join_course_menu.html.erb index a643acdcf..e66d0bcce 100644 --- a/app/views/organizations/_join_course_menu.html.erb +++ b/app/views/organizations/_join_course_menu.html.erb @@ -91,7 +91,6 @@ url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(), type: "get" }); - alert("加入成功"); } }); } diff --git a/app/views/organizations/_join_project_menu.html.erb b/app/views/organizations/_join_project_menu.html.erb index ea5b4ce25..765b4b23a 100644 --- a/app/views/organizations/_join_project_menu.html.erb +++ b/app/views/organizations/_join_project_menu.html.erb @@ -87,7 +87,6 @@ url: "/organizations/" + orgId + "/search_projects?name=" + $("input[name='projects']").val().trim(), type: "get" }); - alert("加入成功"); } }); } From 580cc6b8d8160b969103859078617139de5075b1 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 27 Nov 2015 16:14:42 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/schema.rb b/db/schema.rb index 8e2082b37..504052365 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1151,6 +1151,7 @@ ActiveRecord::Schema.define(:version => 20151127011351) do create_table "org_members", :force => true do |t| t.integer "user_id" t.integer "organization_id" + t.string "role" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end