diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 920b9f2c4..2af1f1d9e 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -176,7 +176,8 @@ class OrganizationsController < ApplicationController def get_course_activities_org org course_ids = org.courses.map{|course| course.id}.join(",") unless course_ids.blank? - project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids}) and container_type = 'course' order by updated_at desc limit 8;") + project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids}) and container_type = 'course' + and org_act_type in ('HomeworkCommon', 'Poll', 'Message', 'News', 'Course') order by updated_at desc limit 8;") else project_acts = nil end diff --git a/app/views/organizations/_org_new_course_act_list.html.erb b/app/views/organizations/_org_new_course_act_list.html.erb index 81f1b6410..8dceeb6cb 100644 --- a/app/views/organizations/_org_new_course_act_list.html.erb +++ b/app/views/organizations/_org_new_course_act_list.html.erb @@ -43,6 +43,38 @@ <%= activity.comments.count %>
+ <% elsif act.org_act_type == "Poll" %> + <% activity = Poll.find(act.org_act_id) %> + <% has_commit = has_commit_poll?(activity.id ,User.current)%> + <% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%> + <% if ( activity.polls_status==2) %> +发布时间:<%= format_date activity.published_at %> + 作者:<%= activity.try(:user).try(:realname).nil? ? activity.try(:user) : activity.try(:user).try(:realname) %> + 0
+发布时间:<%= format_date activity.created_at %> + 作者:<%= activity.try(:teacher).try(:realname).nil? ? activity.try(:teacher) : activity.try(:teacher).try(:realname) %> + 0
+