Skip to content

Commit

Permalink
FEATURE: added suppress_uncategorized_badge
Browse files Browse the repository at this point in the history
site setting to remove the suppression of the uncategorized badge from topic lists
  • Loading branch information
SamSaffron committed Jan 7, 2014
1 parent 3bb2948 commit 164418b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/assets/javascripts/discourse/lib/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ Discourse.HTML = {
opts = opts || {};

if ((!category) ||
(!opts.allowUncategorized && Em.get(category, 'id') === Discourse.Site.currentProp("uncategorized_category_id"))) return "";
(!opts.allowUncategorized &&
Em.get(category, 'id') === Discourse.Site.currentProp("uncategorized_category_id") &&
Discourse.SiteSettings.suppress_uncategorized_badge
)
) return "";

var name = Em.get(category, 'name'),
description = Em.get(category, 'description'),
Expand All @@ -57,4 +61,4 @@ Discourse.HTML = {
return html;
}

};
};
1 change: 1 addition & 0 deletions config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ en:
enable_mobile_theme: "Mobile devices use a mobile-friendly theme, with the ability to switch to the full site. Disable this if you want to use a custom stylesheet that is fully responsive."

dominating_topic_minimum_percent: "What percentage of posts a user has to make in a topic before we consider it dominating."
suppress_uncategorized_badge: "Don't show the badge for uncategorized topics in topic lists"

enable_names: "Allow users to show their full names"
display_name_on_posts: "Also show a user's full name on their posts"
Expand Down
3 changes: 3 additions & 0 deletions config/site_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,5 +420,8 @@ uncategorized:
minimum_topics_similar: 50
sequential_replies_threshold: 2
dominating_topic_minimum_percent: 20
suppress_uncategorized_badge:
client: true
default: true


0 comments on commit 164418b

Please sign in to comment.