From 27fb65b562172111657243e1eac2801195b25f19 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 24 Jun 2014 17:27:29 -0400 Subject: [PATCH] Add uncategorized_description site setting --- app/serializers/basic_category_serializer.rb | 4 ++++ config/locales/server.en.yml | 1 + config/site_settings.yml | 1 + 3 files changed, 6 insertions(+) diff --git a/app/serializers/basic_category_serializer.rb b/app/serializers/basic_category_serializer.rb index e1cf751631b..166f8d59b6d 100644 --- a/app/serializers/basic_category_serializer.rb +++ b/app/serializers/basic_category_serializer.rb @@ -17,4 +17,8 @@ class BasicCategorySerializer < ApplicationSerializer def include_parent_category_id? parent_category_id end + + def description + object.uncategorized? ? SiteSetting.uncategorized_description : object.description + end end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 34a6f1c188f..cb4cf15d5d0 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -607,6 +607,7 @@ en: min_private_message_title_length: "Minimum title length for a private message in characters" min_search_term_length: "Minimum search term length in characters" allow_uncategorized_topics: "Allow topics to be created without a category." + uncategorized_description: "The description of the uncategorized category. Leave blank if you don't want a description." allow_duplicate_topic_titles: "Allow topics with identical titles" unique_posts_mins: "How many minutes before a user can make a post with the same content again" enforce_global_nicknames: "Enforce global username uniqueness (WARNING: only change this during initial setup)" diff --git a/config/site_settings.yml b/config/site_settings.yml index b60a37d0dfe..117aa4a9c4f 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -293,6 +293,7 @@ posting: client: true default: true refresh: true + uncategorized_description: '' allow_duplicate_topic_titles: false min_title_similar_length: client: true