From 35eb7e80af4dbf7bb51794989540371f6615061c Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 16:17:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=95=99=E8=A8=80?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 31 ++++++++++++++++++------ app/views/messages/_course_show.html.erb | 4 ++- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index b72cb9218..b50b2720f 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -44,18 +44,35 @@ 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_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}). + reorder("#{Message.table_name}.created_on DESC"). + limit(@reply_pages.per_page). + offset(@reply_pages.offset). + all + + @reply = Message.new(:subject => "RE: #{@message.subject}") render :action => "show", :layout => "base_projects"#by young end end diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 344aa067d..e79913380 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -148,7 +148,9 @@
<% end %> - + <% html_title @topic.subject %>