mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
26 lines
736 B
JavaScript
26 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);
|
|
}
|
|
}
|
|
});
|