回复的时候会多出一条一模一样的内容

This commit is contained in:
lizanle 2015-11-14 09:44:53 +08:00
parent 36b3d0b636
commit b88d5e59a1
5 changed files with 6 additions and 10 deletions

View File

@ -1,3 +1,3 @@
$("#organization_document_<%= @document.id %>").html("");
$("#organization_document_<%= @document.id %>").html("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>"); $("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>");
init_activity_KindEditor_data(<%= @document.id %>,"","87%"); init_activity_KindEditor_data(<%= @document.id %>,"","87%");

View File

@ -20,8 +20,6 @@
init_activity_KindEditor_data(<%= document.id%>, null, "87%"); init_activity_KindEditor_data(<%= document.id%>, null, "87%");
}); });
</script> </script>
<p id="organization_document_<%= document.id %>">
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %> <%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %>
</p>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -1,4 +1,4 @@
<div class="resources mt10"> <div class="resources mt10" id="organization_document_<%= document.id %>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> <%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>

View File

@ -30,9 +30,8 @@
init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%"); init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%");
}); });
</script> </script>
<p id="organization_document_<%= @organization.home_id %>">
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %>
</p>
<% end %> <% end %>
<% unless @activities.nil? %> <% unless @activities.nil? %>
@ -58,9 +57,7 @@
init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%"); init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%");
}); });
</script> </script>
<p id="organization_document_<%= act.org_act.id %>" style="mt10">
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> <%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %>
</p>
<% end %> <% end %>
<% end %> <% end %>
<ul class="wlist" style=" border:none; padding-top: 15px;"> <ul class="wlist" style=" border:none; padding-top: 15px;">

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20151110011003) do ActiveRecord::Schema.define(:version => 20151112072948) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -960,6 +960,7 @@ ActiveRecord::Schema.define(:version => 20151110011003) do
t.datetime "created_on" t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false t.integer "comments_count", :default => 0, :null => false
t.integer "course_id" t.integer "course_id"
t.integer "sticky", :default => 0
end end
add_index "news", ["author_id"], :name => "index_news_on_author_id" add_index "news", ["author_id"], :name => "index_news_on_author_id"