From 9b8bf9c18c962cdc8109b6ed072f2a61c639a3c0 Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Mon, 12 Jun 2017 06:50:21 -0600 Subject: [PATCH] reverting add readonly to site settings see this commit for more details: https://github.com/discourse/discourse/commit/2ffddfb32cd68ed749bdc6a59fe94b843b52e717#commitcomment-22480952 --- .../controllers/admin-site-settings.js.es6 | 30 ------------------- .../admin/templates/site-settings.hbs | 5 ---- 2 files changed, 35 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 b/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 index abfd1d29349..02a907d7af9 100644 --- a/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-site-settings.js.es6 @@ -1,5 +1,4 @@ import debounce from 'discourse/lib/debounce'; -import { ajax } from 'discourse/lib/ajax'; export default Ember.Controller.extend({ filter: null, @@ -71,36 +70,7 @@ export default Ember.Controller.extend({ toggleMenu() { $('.admin-detail').toggleClass('mobile-closed mobile-open'); - }, - - toggleReadOnlyMode() { - var self = this; - if (!this.site.get("isReadOnly")) { - bootbox.confirm( - I18n.t("admin.backups.read_only.enable.confirm"), - I18n.t("no_value"), - I18n.t("yes_value"), - function(confirmed) { - if (confirmed) { - Discourse.User.currentProp("hideReadOnlyAlert", true); - self._toggleReadOnlyMode(true); - } - } - ); - } else { - this._toggleReadOnlyMode(false); - } } - }, - - _toggleReadOnlyMode(enable) { - var site = this.site; - ajax("/admin/backups/readonly", { - type: "PUT", - data: { enable: enable } - }).then(() => { - site.set("isReadOnly", enable); - }); } }); diff --git a/app/assets/javascripts/admin/templates/site-settings.hbs b/app/assets/javascripts/admin/templates/site-settings.hbs index 40d0f324702..5fd95459324 100644 --- a/app/assets/javascripts/admin/templates/site-settings.hbs +++ b/app/assets/javascripts/admin/templates/site-settings.hbs @@ -1,10 +1,5 @@