activity.rb
This commit is contained in:
parent
4df5f3114d
commit
51a61a52d4
|
@ -30,22 +30,26 @@ module Mobile
|
||||||
ac.nil? || ac.act.nil? ? 0 : ac.act.journals.where("notes is not null and notes != ''").count
|
ac.nil? || ac.act.nil? ? 0 : ac.act.journals.where("notes is not null and notes != ''").count
|
||||||
end
|
end
|
||||||
when :subject
|
when :subject
|
||||||
if ac.act_type == "HomeworkCommon"
|
unless ac.act.nil?
|
||||||
ac.act.name unless ac.nil? || ac.act.nil?
|
if ac.act_type == "HomeworkCommon"
|
||||||
elsif ac.act_type == "News" || ac.act_type == "BlogComment"
|
ac.act.name unless ac.nil? || ac.act.nil?
|
||||||
ac.act.title unless ac.nil? || ac.act.nil?
|
elsif ac.act_type == "News" || ac.act_type == "BlogComment"
|
||||||
elsif ac.act_type == "Message" || ac.act_type == "Issue"
|
ac.act.title unless ac.nil? || ac.act.nil?
|
||||||
ac.act.subject unless ac.nil? || ac.act.nil?
|
elsif ac.act_type == "Message" || ac.act_type == "Issue"
|
||||||
elsif ac.act_type == "JournalsForMessage"
|
ac.act.subject unless ac.nil? || ac.act.nil?
|
||||||
ac.act.private == 0 ? "留言" : "私信"
|
elsif ac.act_type == "JournalsForMessage"
|
||||||
|
ac.act.private == 0 ? "留言" : "私信"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
when :description
|
when :description
|
||||||
if ac.act_type == "HomeworkCommon" || ac.act_type == "Issue" || ac.act_type == "News"
|
unless ac.act.nil?
|
||||||
ac.act.description unless ac.nil? || ac.act.nil?
|
if ac.act_type == "HomeworkCommon" || ac.act_type == "Issue" || ac.act_type == "News"
|
||||||
elsif ac.act_type == "Message" || ac.act_type == "BlogComment"
|
ac.act.description unless ac.nil? || ac.act.nil?
|
||||||
ac.act.content unless ac.nil? || ac.act.nil?
|
elsif ac.act_type == "Message" || ac.act_type == "BlogComment"
|
||||||
elsif ac.act_type == "JournalsForMessage"
|
ac.act.content unless ac.nil? || ac.act.nil?
|
||||||
ac.act.notes
|
elsif ac.act_type == "JournalsForMessage"
|
||||||
|
ac.act.notes
|
||||||
|
end
|
||||||
end
|
end
|
||||||
when :latest_update
|
when :latest_update
|
||||||
time_from_now ac.updated_at unless ac.nil?
|
time_from_now ac.updated_at unless ac.nil?
|
||||||
|
@ -103,12 +107,14 @@ module Mobile
|
||||||
if a.is_a? ::UserActivity
|
if a.is_a? ::UserActivity
|
||||||
if a.act_type == "ProjectCreateInfo"
|
if a.act_type == "ProjectCreateInfo"
|
||||||
get_user(get_project(a.act_id).user_id)
|
get_user(get_project(a.act_id).user_id)
|
||||||
elsif a.act_type == 'Issue' || a.act_type == 'News' || a.act_type == 'Message' || a.act_type == 'BlogComment'
|
elsif !a.act.nil?
|
||||||
|
if a.act_type == 'Issue' || a.act_type == 'News' || a.act_type == 'Message' || a.act_type == 'BlogComment'
|
||||||
a.act.author
|
a.act.author
|
||||||
elsif a.act_type == 'HomeworkCommon' || a.act_type == 'Poll' || a.act_type == 'JournalsForMessage'
|
elsif a.act_type == 'HomeworkCommon' || a.act_type == 'Poll' || a.act_type == 'JournalsForMessage'
|
||||||
a.act.user
|
a.act.user
|
||||||
elsif a.act_type == 'Course'
|
elsif a.act_type == 'Course'
|
||||||
a.act.teacher
|
a.act.teacher
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue