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({