From 478a534c96cf467a7260c6e6ee36f959710f8716 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 19 Nov 2015 10:08:11 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B0=86=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81=E7=9A=84?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E4=B8=AD=EF=BC=9B=202.?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=96=87=E7=AB=A0=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=BB=99=E5=87=BA=E4=BF=A1=E6=81=AF=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org_document_comments_controller.rb | 2 +- app/controllers/organizations_controller.rb | 8 ++++++++ app/views/org_document_comments/index.html.erb | 2 +- app/views/organizations/show.html.erb | 18 ++++++++++++++++-- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 13a188e72..af229635c 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -12,7 +12,7 @@ class OrgDocumentCommentsController < ApplicationController @org_document_comment.title = params[:org_document_comment][:title] @org_document_comment.content = params[:org_document_comment][:content] if @org_document_comment.save - #flash[:notice] = 'success' + flash.keep[:notice] = l(:notice_successful_create) OrgActivity redirect_to organization_org_document_comments_path(@organization) else diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 8c8d8bae4..3713beb22 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -70,6 +70,14 @@ class OrganizationsController < ApplicationController @org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Message' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10) when 'org' @org_activities = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10) + when 'course_homework' + @org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'HomeworkCommon' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10) + when 'course_news' + @org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'News' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10) + when 'course_message' + @org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Message' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10) + when 'course_poll' + @org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10) end @page = params[:page] respond_to do |format| diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb index d9b1d9579..6019dae14 100644 --- a/app/views/org_document_comments/index.html.erb +++ b/app/views/org_document_comments/index.html.erb @@ -19,6 +19,6 @@ init_activity_KindEditor_data(<%= document.id%>, null, "87%"); }); - <%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %> + <%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first} %> <% end %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index acaf2879e..e44e0778d 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -17,6 +17,19 @@