From dc3739d49fa029f988674f782cd0dbe22711d3e2 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 3 Apr 2014 16:07:59 -0400 Subject: [PATCH] Replace underscore with space when showing site setting names --- app/assets/javascripts/admin/models/site_setting.js | 9 +++++++++ .../templates/site_settings/setting_bool.js.handlebars | 2 +- .../templates/site_settings/setting_enum.js.handlebars | 2 +- .../templates/site_settings/setting_string.js.handlebars | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/models/site_setting.js b/app/assets/javascripts/admin/models/site_setting.js index c23aae99157..3f227970071 100644 --- a/app/assets/javascripts/admin/models/site_setting.js +++ b/app/assets/javascripts/admin/models/site_setting.js @@ -31,6 +31,15 @@ Discourse.SiteSetting = Discourse.Model.extend({ }.property('value'), + /** + The name of the setting. Basically, underscores in the setting key are replaced with spaces. + + @property settingName + **/ + settingName: function() { + return this.get('setting').replace(/\_/g, ' '); + }.property('setting'), + /** Has the user changed the setting? If so we should save it. diff --git a/app/assets/javascripts/admin/templates/site_settings/setting_bool.js.handlebars b/app/assets/javascripts/admin/templates/site_settings/setting_bool.js.handlebars index 277c45685d9..f84fec06dc1 100644 --- a/app/assets/javascripts/admin/templates/site_settings/setting_bool.js.handlebars +++ b/app/assets/javascripts/admin/templates/site_settings/setting_bool.js.handlebars @@ -1,5 +1,5 @@
-

{{unbound setting}}

+

{{unbound settingName}}