diff --git a/app/assets/javascripts/discourse/controllers/list_controller.js b/app/assets/javascripts/discourse/controllers/list_controller.js index 1ac722643a9..2cee358acc3 100644 --- a/app/assets/javascripts/discourse/controllers/list_controller.js +++ b/app/assets/javascripts/discourse/controllers/list_controller.js @@ -64,7 +64,6 @@ Discourse.ListController = Discourse.Controller.extend({ return Discourse.TopicList.list(current).then(function(items) { listController.setProperties({ loading: false, - filterSummary: items.filter_summary, filterMode: filterMode, draft: items.draft, draft_key: items.draft_key, diff --git a/app/models/topic_list.rb b/app/models/topic_list.rb index eee437c8899..21370594a20 100644 --- a/app/models/topic_list.rb +++ b/app/models/topic_list.rb @@ -46,10 +46,6 @@ class TopicList @topics_input.map {|t| t.id} end - def filter_summary - @filter_summary ||= get_summary - end - def attributes {'more_topics_url' => page} end @@ -62,33 +58,4 @@ class TopicList # Only show them on 'Hot' return @filter == :hot 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 diff --git a/app/serializers/topic_list_serializer.rb b/app/serializers/topic_list_serializer.rb index f3bf96cf402..282786cc508 100644 --- a/app/serializers/topic_list_serializer.rb +++ b/app/serializers/topic_list_serializer.rb @@ -2,7 +2,6 @@ class TopicListSerializer < ApplicationSerializer attributes :can_create_topic, :more_topics_url, - # :filter_summary, :draft, :draft_key, :draft_sequence,