Merge branch 'yuanke' into develop
This commit is contained in:
commit
66709b16e5
|
@ -102,15 +102,14 @@ class OrgDocumentCommentsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@org_document_comment = SubDocumentComment.find(params[:id])
|
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||||
@sub_domain = @org_document_comment.sub_domain
|
@org_sub_id = @org_document_comment.org_subfield_id
|
||||||
@org_subfield = @sub_domain.org_subfield
|
org = @org_document_comment.organization
|
||||||
# org = @org_document_comment.organization
|
if @org_document_comment.id == org.home_id
|
||||||
# if @org_document_comment.id == org.home_id
|
org.update_attributes(:home_id => nil)
|
||||||
# org.update_attributes(:home_id => nil)
|
end
|
||||||
# end
|
if @org_document_comment.destroy
|
||||||
@org_document_comment.destroy
|
end
|
||||||
# end
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -125,6 +125,8 @@ class SubDocumentCommentsController < ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
@sub_document_comment = SubDocumentComment.find(params[:id])
|
@sub_document_comment = SubDocumentComment.find(params[:id])
|
||||||
@sub_document_comment.destroy
|
@sub_document_comment.destroy
|
||||||
|
@sub_domain = @sub_document_comment.sub_domain
|
||||||
|
@org_subfield = @sub_domain.org_subfield
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
# format.html{
|
# format.html{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//location.reload();
|
//location.reload();
|
||||||
<% if params[:detail_page] %>
|
<% if params[:detail_page] %>
|
||||||
window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @sub_domain.id)%>';
|
window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>';
|
||||||
<% else %>
|
<% else %>
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
<% end %>
|
<% end %>
|
|
@ -1,6 +1,6 @@
|
||||||
//location.reload();
|
//location.reload();
|
||||||
<% if params[:detail_page] %>
|
<% if params[:detail_page] %>
|
||||||
window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @subdomain.id)%>';
|
window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @sub_domain.id)%>';
|
||||||
<% else %>
|
<% else %>
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
<% end %>
|
<% end %>
|
|
@ -56,7 +56,7 @@
|
||||||
<%= link_to "编辑文章", edit_org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 1), :class => "postOptionLink" %>
|
<%= link_to "编辑文章", edit_org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 1), :class => "postOptionLink" %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @organization.id, :detail_page => 1), :method => 'delete',
|
<%= link_to "删除文章", org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 0, :detail_page=>1), :method => 'delete',
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:remote => true, :class => 'postOptionLink' %>
|
:remote => true, :class => 'postOptionLink' %>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in New Issue