diff --git a/app/assets/javascripts/admin/models/site_setting.js b/app/assets/javascripts/admin/models/site_setting.js index 3f2279700..ae487f0b3 100644 --- a/app/assets/javascripts/admin/models/site_setting.js +++ b/app/assets/javascripts/admin/models/site_setting.js @@ -23,10 +23,6 @@ Discourse.SiteSetting = Discourse.Model.extend({ } else { // set the boolean value of the setting this.set('value', value ? 'true' : 'false'); - - // We save booleans right away, it's not like a text field where it makes sense to - // undo what you typed in. - this.save(); } }.property('value'), 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 f84fec06d..f74f129fd 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 @@ -7,3 +7,13 @@ {{unbound description}} </label> </div> +{{#if dirty}} + <div class='setting-controls'> + <button class='btn ok no-text' {{action save this}}><i class='fa fa-check'></i></button> + <button class='btn cancel no-text' {{action cancel this}}><i class='fa fa-times'></i></button> + </div> +{{else}} + {{#if overridden}} + <button class='btn' href='#' {{action resetDefault this}}><i class="fa fa-undo"></i>{{i18n admin.site_settings.reset}}</button> + {{/if}} +{{/if}}