|
|
@ -1,4 +1,3 @@
|
|
|
|
#coding=utf-8
|
|
|
|
|
|
|
|
class CoursesService
|
|
|
|
class CoursesService
|
|
|
|
include ApplicationHelper
|
|
|
|
include ApplicationHelper
|
|
|
|
include CoursesHelper
|
|
|
|
include CoursesHelper
|
|
|
@ -355,19 +354,19 @@ class CoursesService
|
|
|
|
latest_course_dynamics = []
|
|
|
|
latest_course_dynamics = []
|
|
|
|
latest_news = course.news.order("created_on desc").first
|
|
|
|
latest_news = course.news.order("created_on desc").first
|
|
|
|
unless latest_news.nil?
|
|
|
|
unless latest_news.nil?
|
|
|
|
latest_course_dynamics << {:type => 1,:time => latest_news.created_on,:message => '最近更新了通知' }#l(:label_recently_updated_notification,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
latest_course_dynamics << {:type => 1,:time => latest_news.created_on,:message => l(:label_recently_updated_notification,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
latest_message = course.journals_for_messages.order("created_on desc").first
|
|
|
|
latest_message = course.journals_for_messages.order("created_on desc").first
|
|
|
|
unless latest_message.nil?
|
|
|
|
unless latest_message.nil?
|
|
|
|
latest_course_dynamics << {:type => 2,:time => latest_message.created_on,:message => '最近更新了留言'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
latest_course_dynamics << {:type => 2,:time => latest_message.created_on,:message => l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
latest_attachment = course.attachments.order("created_on desc").first
|
|
|
|
latest_attachment = course.attachments.order("created_on desc").first
|
|
|
|
unless latest_attachment.nil?
|
|
|
|
unless latest_attachment.nil?
|
|
|
|
latest_course_dynamics << {:type => 3,:time => latest_attachment.created_on,:message => '最近更新了课件'}#l(:label_recently_updated_courseware,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
latest_course_dynamics << {:type => 3,:time => latest_attachment.created_on,:message => l(:label_recently_updated_courseware,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
latest_bid = course.homeworks.order('updated_on DESC').first
|
|
|
|
latest_bid = course.homeworks.order('updated_on DESC').first
|
|
|
|
unless latest_bid.nil?
|
|
|
|
unless latest_bid.nil?
|
|
|
|
latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => '最近更新了作业'}#l(:label_recently_updated_homework,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => l(:label_recently_updated_homework,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
#每个作业中的最新留言
|
|
|
|
#每个作业中的最新留言
|
|
|
|
messages = []
|
|
|
|
messages = []
|
|
|
|