From b88d5e59a13083463692a801dce215c66354db67 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 14 Nov 2015 09:44:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=BC=9A=E5=A4=9A=E5=87=BA=E4=B8=80=E6=9D=A1=E4=B8=80?= =?UTF-8?q?=E6=A8=A1=E4=B8=80=E6=A0=B7=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/add_reply.js.erb | 4 ++-- app/views/org_document_comments/index.html.erb | 2 -- app/views/organizations/_show_org_document.html.erb | 2 +- app/views/organizations/show.html.erb | 5 +---- db/schema.rb | 3 ++- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb index 930c8ebb0..5d54af2bf 100644 --- a/app/views/org_document_comments/add_reply.js.erb +++ b/app/views/org_document_comments/add_reply.js.erb @@ -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%"); \ No newline at end of file diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index a636b2ec8..3c2910529 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -20,8 +20,6 @@ init_activity_KindEditor_data(<%= document.id%>, null, "87%"); }); -

<%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %> -

<% end %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index f1c633320..700db0eeb 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -1,4 +1,4 @@ -
+
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %> diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index e77cc7d09..55d296cd1 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -30,9 +30,8 @@ init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%"); }); -

+ <%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %> -

<% end %> <% unless @activities.nil? %> @@ -58,9 +57,7 @@ init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%"); }); -

<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %> -

<% end %> <% end %>
    diff --git a/db/schema.rb b/db/schema.rb index 1f48eaf02..73924d83c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # 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| t.integer "act_id", :null => false @@ -960,6 +960,7 @@ ActiveRecord::Schema.define(:version => 20151110011003) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.integer "sticky", :default => 0 end add_index "news", ["author_id"], :name => "index_news_on_author_id" From e1a88dedbbe20cc0511cec88274da90763d71788 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 14 Nov 2015 09:58:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=20=E9=A6=96=E9=A1=B5=E5=9B=9E=E5=A4=8D=20?= =?UTF-8?q?=E4=BC=9A=E5=8F=98=E6=88=90=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_show_org_document.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 700db0eeb..b9c8c19aa 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -7,7 +7,7 @@
    <%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %> TO  <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> | - <% if defined?(home_id) %> + <% if document.organization.home_id == document.id %> 首页 <% else %> 组织