|
|
|
@ -44,6 +44,26 @@ class MessagesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@reply_count = @topic.children.count
|
|
|
|
|
# @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
|
|
|
|
# @replies = @topic.children.
|
|
|
|
|
# includes(:author, :attachments, {:board => :project}).
|
|
|
|
|
# reorder("#{Message.table_name}.created_on DESC").
|
|
|
|
|
# limit(@reply_pages.per_page).
|
|
|
|
|
# offset(@reply_pages.offset).
|
|
|
|
|
# all
|
|
|
|
|
|
|
|
|
|
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
|
|
|
|
if @course
|
|
|
|
|
messages_replies = @topic.children.
|
|
|
|
|
includes(:author, :attachments, {:board => :project}).
|
|
|
|
|
reorder("#{Message.table_name}.created_on DESC").
|
|
|
|
|
#limit(@reply_pages.per_page).
|
|
|
|
|
#offset(@reply_pages.offset).
|
|
|
|
|
all
|
|
|
|
|
@replies = paginateHelper messages_replies,10
|
|
|
|
|
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
|
|
|
|
render :action => "show", :layout => "base_courses"#by young
|
|
|
|
|
else
|
|
|
|
|
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
|
|
|
|
@replies = @topic.children.
|
|
|
|
|
includes(:author, :attachments, {:board => :project}).
|
|
|
|
@ -53,9 +73,6 @@ class MessagesController < ApplicationController
|
|
|
|
|
all
|
|
|
|
|
|
|
|
|
|
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
|
|
|
|
if @course
|
|
|
|
|
render :action => "show", :layout => "base_courses"#by young
|
|
|
|
|
else
|
|
|
|
|
render :action => "show", :layout => "base_projects"#by young
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|