贴吧缺陷修复

This commit is contained in:
daiao 2017-09-30 19:49:53 +08:00
parent cb13f6d360
commit 7dcc150a25
4 changed files with 17 additions and 11 deletions

View File

@ -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]

View File

@ -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

View File

@ -86,6 +86,12 @@
</div>
</div>
<% if false %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>

View File

@ -18,7 +18,7 @@
<li><%= link_to "全部实训", shixuns_path, :class => "new-nav-a font-16" %></li>
<li><%= link_to "实训路径", subjects_path, :class => "new-nav-a font-16" %></li>
<li><%= link_to "在线课堂", courses_path, :class => "new-nav-a font-16" %></li>
<li><%= link_to "论", forums_path, :class => "new-nav-a font-16" %></li>
<li><%= link_to "论", forums_path, :class => "new-nav-a font-16" %></li>
<!-- <li><%#= link_to "论坛", forums_path, :class =>"new-nav-a", :target => "_blank" %></li>-->
<!-- <li><%#= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "new-nav-a", :target=>"_blank" %></li>-->