remove dead uncalled code

This commit is contained in:
Sam 2013-06-23 15:28:17 +10:00
parent d4d8daaa6d
commit 25bb8cf382
3 changed files with 0 additions and 35 deletions

View File

@ -64,7 +64,6 @@ Discourse.ListController = Discourse.Controller.extend({
return Discourse.TopicList.list(current).then(function(items) { return Discourse.TopicList.list(current).then(function(items) {
listController.setProperties({ listController.setProperties({
loading: false, loading: false,
filterSummary: items.filter_summary,
filterMode: filterMode, filterMode: filterMode,
draft: items.draft, draft: items.draft,
draft_key: items.draft_key, draft_key: items.draft_key,

View File

@ -46,10 +46,6 @@ class TopicList
@topics_input.map {|t| t.id} @topics_input.map {|t| t.id}
end end
def filter_summary
@filter_summary ||= get_summary
end
def attributes def attributes
{'more_topics_url' => page} {'more_topics_url' => page}
end end
@ -62,33 +58,4 @@ class TopicList
# Only show them on 'Hot' # Only show them on 'Hot'
return @filter == :hot return @filter == :hot
end end
protected
def get_summary
s = {}
return s unless @current_user
split = SiteSetting.top_menu.split("|")
split.each do |i|
name, filter = i.split(",")
exclude = nil
if filter && filter[0] == "-"
exclude = filter[1..-1]
end
query = TopicQuery.new(@current_user, exclude_category: exclude)
s["unread"] = query.unread_count if name == 'unread'
s["new"] = query.new_count if name == 'new'
catSplit = name.split("/")
if catSplit[0] == "category" && catSplit.length == 2 && @current_user
query = TopicQuery.new(@current_user, only_category: catSplit[1], limit: false)
s[name] = query.unread_count + query.new_count
end
end
s
end
end end

View File

@ -2,7 +2,6 @@ class TopicListSerializer < ApplicationSerializer
attributes :can_create_topic, attributes :can_create_topic,
:more_topics_url, :more_topics_url,
# :filter_summary,
:draft, :draft,
:draft_key, :draft_key,
:draft_sequence, :draft_sequence,