From b05708f6e8dff7c954fe2d21f5a0deba8d2c6e2c Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 27 Nov 2015 10:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=B8=8B=E4=B8=89?= =?UTF-8?q?=E4=B8=AAbug:=201.=E6=96=B0=E5=BB=BA=E7=BB=84=E7=BB=87=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E6=97=B6=EF=BC=8C=E7=BD=AE=E6=A0=87=E9=A2=98=E5=92=8C?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E4=B8=BA=E7=A9=BA=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8C=89=E9=92=AE=EF=BC=8C=E5=8D=B4=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E2=80=9C=E6=A0=87=E9=A2=98=E4=B8=8D=E8=83=BD=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E2=80=9D=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=202.=E8=AF=BE=E7=A8=8B/=E9=A1=B9=E7=9B=AE=E5=85=B3=E8=81=94?= =?UTF-8?q?=E7=BB=84=E7=BB=87=EF=BC=9A=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8D=E5=BA=94=E8=AF=A5=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E8=B5=B7=E5=85=B3=E8=81=94=E7=BB=84=E7=BB=87=E5=88=97?= =?UTF-8?q?=E8=A1=A8=203.=E7=BB=84=E7=BB=87=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=86=85=E5=86=8D=E7=BC=96=E8=BE=91=E7=BB=84=E7=BB=87?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E6=8C=89=E9=92=AE=E5=90=8E=E5=8F=88=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=BA=94=E8=BF=94=E5=9B=9E=E7=BB=84=E7=BB=87=E8=AF=A6=E6=83=85?= =?UTF-8?q?=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({