mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 17:13:27 +08:00

There are a few changes here to make the Emails admin page more consistent with the rest of the admin UI. - The header and navigation menu have been updated. - The sidebar now stays highlighted when visiting the email admin sub-pages. - Moved the Template editor from /admin/customize/email_templates to /admin/email/templates, so it fit as a sub-page. - Removed the link to the Template editor from the Customize section of the old top menu, since it's accessible from the Emails section, instead.
28 lines
657 B
JavaScript
28 lines
657 B
JavaScript
import { action } from "@ember/object";
|
|
import Route from "@ember/routing/route";
|
|
import { service } from "@ember/service";
|
|
|
|
export default class AdminEmailTemplatesRoute extends Route {
|
|
@service router;
|
|
|
|
model() {
|
|
return this.store.findAll("email-template");
|
|
}
|
|
|
|
setupController(controller, model) {
|
|
controller.set("emailTemplates", model);
|
|
}
|
|
|
|
@action
|
|
didTransition() {
|
|
const editController = this.controllerFor("adminEmailTemplates.edit");
|
|
|
|
if (!editController.emailTemplate) {
|
|
this.router.transitionTo(
|
|
"adminEmailTemplates.edit",
|
|
this.controller.get("sortedTemplates.firstObject")
|
|
);
|
|
}
|
|
}
|
|
}
|