Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
bc993e3b5c
|
@ -109,19 +109,19 @@ class UsersController < ApplicationController
|
|||
end
|
||||
if @user.course_messages
|
||||
if params[:type].nil?
|
||||
@user_course_messages = @user.course_messages
|
||||
@user_project_messges = @user.forge_messages
|
||||
@user_course_messages = @user.course_messages.reverse
|
||||
@user_project_messges = @user.forge_messages.reverse
|
||||
else
|
||||
case params[:type]
|
||||
when 'homework'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "HomeworkCommon"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "HomeworkCommon"}
|
||||
#@user_course_messages = ForgeMessage.find_by_sql("select * from course_messages where user_id='#{@user.id}' and course_message_type = 'HomeworkCommon' order by created_at desc;")
|
||||
when 'message'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "Message"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "Message"}
|
||||
when 'news'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "News"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "News"}
|
||||
when 'poll'
|
||||
@user_course_messages = @user.course_messages.select{|x| x.course_message_type == "Poll"}
|
||||
@user_course_messages = @user.course_messages.reverse.select{|x| x.course_message_type == "Poll"}
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
|
|
Loading…
Reference in New Issue