From e0f4050779cab8a2ba58b7589e18220634b0a00f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 27 Nov 2015 12:34:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87=E4=B8=AD?= =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE=E5=92=8C=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=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