mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 09:17:15 +08:00
add query parameter to temporarily disable customization
This commit is contained in:
@ -8,52 +8,56 @@
|
||||
**/
|
||||
Discourse.AdminCustomizeController = Ember.ArrayController.extend({
|
||||
|
||||
/**
|
||||
Create a new customization style
|
||||
actions: {
|
||||
|
||||
@method newCustomization
|
||||
**/
|
||||
newCustomization: function() {
|
||||
var item = Discourse.SiteCustomization.create({name: I18n.t("admin.customize.new_style")});
|
||||
this.pushObject(item);
|
||||
this.set('selectedItem', item);
|
||||
},
|
||||
/**
|
||||
Create a new customization style
|
||||
|
||||
/**
|
||||
Select a given style
|
||||
@method newCustomization
|
||||
**/
|
||||
newCustomization: function() {
|
||||
var item = Discourse.SiteCustomization.create({name: I18n.t("admin.customize.new_style")});
|
||||
this.pushObject(item);
|
||||
this.set('selectedItem', item);
|
||||
},
|
||||
|
||||
@method selectStyle
|
||||
@param {Discourse.SiteCustomization} style The style we are selecting
|
||||
**/
|
||||
selectStyle: function(style) {
|
||||
this.set('selectedItem', style);
|
||||
},
|
||||
/**
|
||||
Select a given style
|
||||
|
||||
/**
|
||||
Save the current customization
|
||||
@method selectStyle
|
||||
@param {Discourse.SiteCustomization} style The style we are selecting
|
||||
**/
|
||||
selectStyle: function(style) {
|
||||
this.set('selectedItem', style);
|
||||
},
|
||||
|
||||
@method save
|
||||
**/
|
||||
save: function() {
|
||||
this.get('selectedItem').save();
|
||||
},
|
||||
/**
|
||||
Save the current customization
|
||||
|
||||
/**
|
||||
Destroy the current customization
|
||||
@method save
|
||||
**/
|
||||
save: function() {
|
||||
this.get('selectedItem').save();
|
||||
},
|
||||
|
||||
/**
|
||||
Destroy the current customization
|
||||
|
||||
@method destroy
|
||||
**/
|
||||
destroy: function() {
|
||||
var _this = this;
|
||||
return bootbox.confirm(I18n.t("admin.customize.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function(result) {
|
||||
var selected;
|
||||
if (result) {
|
||||
selected = _this.get('selectedItem');
|
||||
selected.destroy();
|
||||
_this.set('selectedItem', null);
|
||||
return _this.removeObject(selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@method destroy
|
||||
**/
|
||||
destroy: function() {
|
||||
var _this = this;
|
||||
return bootbox.confirm(I18n.t("admin.customize.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), function(result) {
|
||||
var selected;
|
||||
if (result) {
|
||||
selected = _this.get('selectedItem');
|
||||
selected.destroy();
|
||||
_this.set('selectedItem', null);
|
||||
return _this.removeObject(selected);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user