discourse/app/assets/javascripts/admin/routes/admin-customize-themes.js.es6

29 lines
647 B
Plaintext
Raw Normal View History

2018-06-15 11:03:24 -04:00
import showModal from "discourse/lib/show-modal";
export default Ember.Route.extend({
model() {
2018-06-15 11:03:24 -04:00
return this.store.findAll("theme");
},
setupController(controller, model) {
this._super(controller, model);
controller.set("editingTheme", false);
},
actions: {
importModal() {
2018-06-15 11:03:24 -04:00
showModal("admin-import-theme", { admin: true });
},
addTheme(theme) {
2018-06-15 11:03:24 -04:00
const all = this.modelFor("adminCustomizeThemes");
all.pushObject(theme);
2018-06-15 11:03:24 -04:00
this.transitionTo("adminCustomizeThemes.show", theme.get("id"));
},
showCreateModal() {
showModal("admin-create-theme", { admin: true });
}
}
});