mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
Merge pull request #4034 from techAPJ/404
show monthly top topics on 404 page
This commit is contained in:
commit
f259d7a7b9
2 changed files with 2 additions and 1 deletions
|
@ -454,7 +454,7 @@ class ApplicationController < ActionController::Base
|
||||||
def build_not_found_page(status=404, layout=false)
|
def build_not_found_page(status=404, layout=false)
|
||||||
category_topic_ids = Category.pluck(:topic_id).compact
|
category_topic_ids = Category.pluck(:topic_id).compact
|
||||||
@container_class = "wrap not-found-container"
|
@container_class = "wrap not-found-container"
|
||||||
@top_viewed = Topic.where.not(id: category_topic_ids).top_viewed(10)
|
@top_viewed = TopicQuery.new(nil, {except_topic_ids: category_topic_ids}).list_top_for("monthly").topics.first(10)
|
||||||
@recent = Topic.where.not(id: category_topic_ids).recent(10)
|
@recent = Topic.where.not(id: category_topic_ids).recent(10)
|
||||||
@slug = params[:slug].class == String ? params[:slug] : ''
|
@slug = params[:slug].class == String ? params[:slug] : ''
|
||||||
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
|
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
|
||||||
|
|
|
@ -1232,6 +1232,7 @@ describe UsersController do
|
||||||
guardian = Guardian.new(user)
|
guardian = Guardian.new(user)
|
||||||
guardian.stubs(:ensure_can_edit!).with(user).raises(Discourse::InvalidAccess.new)
|
guardian.stubs(:ensure_can_edit!).with(user).raises(Discourse::InvalidAccess.new)
|
||||||
Guardian.stubs(new: guardian).with(user)
|
Guardian.stubs(new: guardian).with(user)
|
||||||
|
Guardian.stubs(new: guardian).with(nil)
|
||||||
|
|
||||||
put :update, username: user.username, name: 'Jim Tom'
|
put :update, username: user.username, name: 'Jim Tom'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue