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) %> +
+ <%= link_to image_tag(url_to_avatar(activity.user),:width => "40", :height => "40"), user_path(activity.user), :class => "fl user-img" %> + +
+ <% if has_commit %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "fl note-title" %> + <% else %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s, :target => '_blank', :class => "fl note-title" %> + <% end %> +

发布时间:<%= format_date activity.published_at %> + 作者:<%= activity.try(:user).try(:realname).nil? ? activity.try(:user) : activity.try(:user).try(:realname) %> + 0

+
+
+ <% end %> + <% elsif act.org_act_type == "Course" %> + <% activity = Course.find(act.org_act_id) %> +
+ <%= link_to image_tag(url_to_avatar(activity.teacher),:width => "40", :height => "40"), user_path(activity.teacher), :class => "fl user-img" %> + +
+ <%= link_to activity.name.to_s, course_url_in_org(activity.id), :target => '_blank', :class => "fl note-title" %> +

发布时间:<%= format_date activity.created_at %> + 作者:<%= activity.try(:teacher).try(:realname).nil? ? activity.try(:teacher) : activity.try(:teacher).try(:realname) %> + 0

+
+
<% end %> <% end %> \ No newline at end of file