mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Revert "Merge pull request #1673 from aperrault/patch-04"
This reverts commitc9ea89bdd3
, reversing changes made to9ed49888fc
.
This commit is contained in:
parent
c9ea89bdd3
commit
309904ef8f
4 changed files with 3 additions and 17 deletions
|
@ -11,9 +11,6 @@ class ListController < ApplicationController
|
||||||
user = list_target_user
|
user = list_target_user
|
||||||
list = TopicQuery.new(user, list_opts).public_send("list_#{filter}")
|
list = TopicQuery.new(user, list_opts).public_send("list_#{filter}")
|
||||||
list.more_topics_url = construct_url_with(filter, list_opts)
|
list.more_topics_url = construct_url_with(filter, list_opts)
|
||||||
if list_opts.include?(:category)
|
|
||||||
list.category = Category.where(name: list_opts[:category]).first
|
|
||||||
end
|
|
||||||
if [:latest, :hot].include?(filter)
|
if [:latest, :hot].include?(filter)
|
||||||
@description = SiteSetting.site_description
|
@description = SiteSetting.site_description
|
||||||
@rss = filter
|
@rss = filter
|
||||||
|
@ -54,7 +51,6 @@ class ListController < ApplicationController
|
||||||
query = TopicQuery.new(current_user, list_opts)
|
query = TopicQuery.new(current_user, list_opts)
|
||||||
list = query.list_latest
|
list = query.list_latest
|
||||||
list.more_topics_url = construct_url_with(:latest, list_opts)
|
list.more_topics_url = construct_url_with(:latest, list_opts)
|
||||||
list.category = @category if @category
|
|
||||||
respond(list)
|
respond(list)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,7 @@ class TopicList
|
||||||
end
|
end
|
||||||
|
|
||||||
def attributes
|
def attributes
|
||||||
hash = {'more_topics_url' => page}
|
{'more_topics_url' => page}
|
||||||
if @category.present?
|
|
||||||
hash['category'] = @category
|
|
||||||
end
|
|
||||||
hash
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_rank_details?
|
def has_rank_details?
|
||||||
|
|
|
@ -18,12 +18,8 @@ class TopicListSerializer < ApplicationSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_create_topic
|
def can_create_topic
|
||||||
if object.category.present?
|
|
||||||
scope.can_create?(Topic, object.category)
|
|
||||||
else
|
|
||||||
scope.can_create?(Topic)
|
scope.can_create?(Topic)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def include_more_topics_url?
|
def include_more_topics_url?
|
||||||
object.more_topics_url.present? && (object.topics.size == SiteSetting.topics_per_page)
|
object.more_topics_url.present? && (object.topics.size == SiteSetting.topics_per_page)
|
||||||
|
|
|
@ -244,9 +244,7 @@ class Guardian
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_create_topic?(parent)
|
def can_create_topic?(parent)
|
||||||
user &&
|
user && user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i && can_create_post?(parent)
|
||||||
user.trust_level >= SiteSetting.min_trust_to_create_topic.to_i &&
|
|
||||||
can_create_post?(parent)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_create_topic_on_category?(category)
|
def can_create_topic_on_category?(category)
|
||||||
|
|
Loading…
Reference in a new issue