2019-10-22 09:46:10 -04:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2018-06-15 11:03:24 -04:00
|
|
|
import SiteSetting from "admin/models/site-setting";
|
2015-03-02 12:12:19 -05:00
|
|
|
|
2019-10-22 09:46:10 -04:00
|
|
|
export default DiscourseRoute.extend({
|
2017-03-21 16:13:19 -04:00
|
|
|
queryParams: {
|
|
|
|
filter: { replace: true }
|
|
|
|
},
|
|
|
|
|
2015-03-02 12:12:19 -05:00
|
|
|
model() {
|
|
|
|
return SiteSetting.findAll();
|
|
|
|
},
|
|
|
|
|
|
|
|
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
|
|
|
}
|
2019-05-01 09:44:45 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
refreshAll() {
|
|
|
|
SiteSetting.findAll().then(settings => {
|
|
|
|
this.controllerFor("adminSiteSettings").set("model", settings);
|
|
|
|
});
|
|
|
|
}
|
2015-03-02 12:12:19 -05:00
|
|
|
}
|
|
|
|
});
|