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 @@