diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 337f951aa..4cd1b26c7 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -137,17 +137,17 @@ class ForumsController < ApplicationController @order_str = "reorder_time=desc" end =end - @memo = Memo.new(:forum => @forum) + #@memo = Memo.new(:forum => @forum) @memos = Memo.where("parent_id is null") @topic_count = @memos.count - @topic_pages = Paginator.new @topic_count, per_page_option, params['page'] - @memos = @memos.includes(:last_reply). - limit(@topic_pages.per_page). - offset(@topic_pages.offset). - reorder(order). - preload(:author, {:last_reply => :author}). - all - @forums = Forum.find_by_sql("SELECT *,topic_count + memo_count tm FROM `forums` order by tm desc;") + + @limit = 20 + @is_remote = true + @topic_pages = Paginator.new @topic_count, @limit, params['page'] || 1 + @memos = @memos.includes(:last_reply).reorder(order) + @memos = paginateHelper @memos, @limit + + #@forums = Forum.find_by_sql("SELECT *,topic_count + memo_count tm FROM `forums` order by tm desc;") @my_forums_count = Memo.where("author_id =? and parent_id is null", User.current.id).count @my_memos_count = Memo.where("author_id =? and parent_id is not null", User.current.id).count @errors = params[:errors] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 06d62c7ab..6ec99bdba 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2032,7 +2032,7 @@ module ApplicationHelper elsif @organization title << (@organization.name.nil? ? "创新源于实践" : @organization.name) elsif @forum || params[:controller] == "forums" - title << "问吧" + title << "论坛" elsif @my_syllabuses title << "我的课堂" elsif @user diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index eee792a77..7583463ce 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -86,6 +86,12 @@ + + + + + + <% if false %> <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 2085a3c5d..6a638ac62 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -18,7 +18,7 @@
  • <%= link_to "全部实训", shixuns_path, :class => "new-nav-a font-16" %>
  • <%= link_to "实训路径", subjects_path, :class => "new-nav-a font-16" %>
  • <%= link_to "在线课堂", courses_path, :class => "new-nav-a font-16" %>
  • -
  • <%= link_to "讨论", forums_path, :class => "new-nav-a font-16" %>
  • +
  • <%= link_to "论坛", forums_path, :class => "new-nav-a font-16" %>