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