2023-03-15 09:17:51 -04:00
|
|
|
import { action } from "@ember/object";
|
2019-10-22 09:46:10 -04:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2015-03-02 12:12:19 -05:00
|
|
|
import SiteSetting from "admin/models/site-setting";
|
|
|
|
|
2023-03-15 09:17:51 -04:00
|
|
|
export default class AdminSiteSettingsRoute extends DiscourseRoute {
|
|
|
|
queryParams = {
|
2017-03-21 16:13:19 -04:00
|
|
|
filter: { replace: true },
|
2023-03-15 09:17:51 -04:00
|
|
|
};
|
2017-03-21 16:13:19 -04:00
|
|
|
|
2015-03-02 12:12:19 -05:00
|
|
|
model() {
|
|
|
|
return SiteSetting.findAll();
|
2023-03-15 09:17:51 -04:00
|
|
|
}
|
2015-03-02 12:12:19 -05:00
|
|
|
|
|
|
|
afterModel(siteSettings) {
|
2018-12-10 19:59:59 -05:00
|
|
|
const controller = this.controllerFor("adminSiteSettings");
|
|
|
|
|
2018-12-11 10:48:12 -05:00
|
|
|
if (!controller.get("visibleSiteSettings")) {
|
|
|
|
controller.set("visibleSiteSettings", siteSettings);
|
2018-12-10 19:59:59 -05:00
|
|
|
}
|
2023-03-15 09:17:51 -04:00
|
|
|
}
|
2019-05-01 09:44:45 -04:00
|
|
|
|
2023-03-15 09:17:51 -04:00
|
|
|
@action
|
|
|
|
refreshAll() {
|
|
|
|
SiteSetting.findAll().then((settings) => {
|
|
|
|
this.controllerFor("adminSiteSettings").set("model", settings);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|