reverting add readonly to site settings
see this commit for more details:
2ffddfb32c (commitcomment-22480952)
This commit is contained in:
parent
eab3562864
commit
9b8bf9c18c
|
@ -1,5 +1,4 @@
|
||||||
import debounce from 'discourse/lib/debounce';
|
import debounce from 'discourse/lib/debounce';
|
||||||
import { ajax } from 'discourse/lib/ajax';
|
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
filter: null,
|
filter: null,
|
||||||
|
@ -71,36 +70,7 @@ export default Ember.Controller.extend({
|
||||||
|
|
||||||
toggleMenu() {
|
toggleMenu() {
|
||||||
$('.admin-detail').toggleClass('mobile-closed mobile-open');
|
$('.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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
<div class='admin-controls'>
|
<div class='admin-controls'>
|
||||||
<div class='search controls'>
|
<div class='search controls'>
|
||||||
{{#if site.isReadOnly}}
|
|
||||||
{{d-button icon="eye" action="toggleReadOnlyMode" disabled=status.isOperationRunning title="admin.backups.read_only.disable.title" label="admin.backups.read_only.disable.label"}}
|
|
||||||
{{else}}
|
|
||||||
{{d-button icon="eye" action="toggleReadOnlyMode" disabled=status.isOperationRunning title="admin.backups.read_only.enable.title" label="admin.backups.read_only.enable.label"}}
|
|
||||||
{{/if}}
|
|
||||||
<label>
|
<label>
|
||||||
{{input type="checkbox" checked=onlyOverridden}}
|
{{input type="checkbox" checked=onlyOverridden}}
|
||||||
{{i18n 'admin.site_settings.show_overriden'}}
|
{{i18n 'admin.site_settings.show_overriden'}}
|
||||||
|
|
Loading…
Reference in New Issue