mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
27 lines
736 B
JavaScript
27 lines
736 B
JavaScript
import showModal from 'discourse/lib/show-modal';
|
|
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
|
|
|
export default Ember.Route.extend({
|
|
model() {
|
|
return this.store.findAll('site-customization');
|
|
},
|
|
|
|
actions: {
|
|
importModal() {
|
|
showModal('upload-customization');
|
|
},
|
|
|
|
newCustomization(obj) {
|
|
obj = obj || {name: I18n.t("admin.customize.new_style")};
|
|
const item = this.store.createRecord('site-customization');
|
|
|
|
const all = this.modelFor('adminCustomizeCssHtml');
|
|
const self = this;
|
|
item.save(obj).then(function() {
|
|
all.pushObject(item);
|
|
self.transitionTo('adminCustomizeCssHtml.show', item.get('id'), 'css');
|
|
}).catch(popupAjaxError);
|
|
}
|
|
}
|
|
});
|