From ee43ce693f06fb055f93a65aeaf9636c5087b59a Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 5 Apr 2013 15:43:56 -0400 Subject: [PATCH] Add topic counts to category selector --- .../javascripts/discourse/views/combobox_view_category.js | 3 ++- app/assets/stylesheets/application/combobox.css.scss | 7 +++++++ app/assets/stylesheets/application/topic.css.scss | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/views/combobox_view_category.js b/app/assets/javascripts/discourse/views/combobox_view_category.js index f930212b8e6..3fbb6ad051b 100644 --- a/app/assets/javascripts/discourse/views/combobox_view_category.js +++ b/app/assets/javascripts/discourse/views/combobox_view_category.js @@ -10,13 +10,14 @@ Discourse.ComboboxViewCategory = Discourse.ComboboxView.extend({ none: 'category.none', classNames: ['combobox category-combobox'], overrideWidths: true, - dataAttributes: ['name', 'color', 'text_color', 'description'], + dataAttributes: ['name', 'color', 'text_color', 'description', 'topic_count'], valueBinding: Ember.Binding.oneWay('source'), template: function(text, templateData) { if (!templateData.color) return text; var result = "" + templateData.name + ""; + result += " × " + templateData.topic_count + ""; if (templateData.description && templateData.description !== 'null') { result += '
' + Handlebars.Utils.escapeExpression(templateData.description) + '
'; } diff --git a/app/assets/stylesheets/application/combobox.css.scss b/app/assets/stylesheets/application/combobox.css.scss index f433bafcdca..3676af5c531 100644 --- a/app/assets/stylesheets/application/combobox.css.scss +++ b/app/assets/stylesheets/application/combobox.css.scss @@ -1,4 +1,11 @@ .category-combobox { + .topic-count { + font-size: 11px; + color: #666; + } + .highlighted .topic-count { + color: white; + } .category-desc { margin: 6px 0px 0px 3px; font-size: 12px; diff --git a/app/assets/stylesheets/application/topic.css.scss b/app/assets/stylesheets/application/topic.css.scss index 67294843937..a392ba2c711 100644 --- a/app/assets/stylesheets/application/topic.css.scss +++ b/app/assets/stylesheets/application/topic.css.scss @@ -48,7 +48,7 @@ vertical-align: top; } } - .badge-category { + h1 > .badge-category { margin-top: 5px; vertical-align: top; }