From b944157d883705c36d19e2b6019ff47ae78e77fa Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 6 May 2013 11:22:39 -0400 Subject: [PATCH] Fix edit uncategorized when on the /category/uncategorized page --- app/assets/javascripts/discourse/models/category.js | 6 +++++- app/models/site_setting.rb | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/models/category.js b/app/assets/javascripts/discourse/models/category.js index 2b3f14ca7..9087b1728 100644 --- a/app/assets/javascripts/discourse/models/category.js +++ b/app/assets/javascripts/discourse/models/category.js @@ -10,7 +10,11 @@ Discourse.Category = Discourse.Model.extend({ init: function() { this._super(); - if (!this.get('id') && this.get('name')) this.set('is_uncategorized', true); + if (!this.get('id') && this.get('name')) { + this.set('is_uncategorized', true); + if (!this.get('color')) this.set('color', Discourse.SiteSettings.uncategorized_color); + if (!this.get('text_color')) this.set('text_color', Discourse.SiteSettings.uncategorized_text_color); + } }, url: function() { diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index a25b9c563..eb5442bb8 100755 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -86,9 +86,9 @@ class SiteSetting < ActiveRecord::Base setting(:max_mentions_per_post, 10) setting(:newuser_max_mentions_per_post, 2) - setting(:uncategorized_name, 'uncategorized') - setting(:uncategorized_color, 'AB9364'); - setting(:uncategorized_text_color, 'FFFFFF'); + client_setting(:uncategorized_name, 'uncategorized') + client_setting(:uncategorized_color, 'AB9364'); + client_setting(:uncategorized_text_color, 'FFFFFF'); setting(:unique_posts_mins, Rails.env.test? ? 0 : 5)