2019-04-18 17:52:59 -04:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2020-05-12 13:58:12 -04:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2019-04-18 17:52:59 -04:00
|
|
|
|
2020-05-12 13:58:12 -04:00
|
|
|
export default DiscourseRoute.extend({
|
2019-04-18 17:52:59 -04:00
|
|
|
settings: null,
|
|
|
|
|
2019-06-14 12:10:11 -04:00
|
|
|
model() {
|
2020-09-04 07:24:14 -04:00
|
|
|
return ajax("/admin/plugins/pluginad/house_creatives.json").then((data) => {
|
2019-04-18 17:52:59 -04:00
|
|
|
this.set("settings", Ember.Object.create(data.settings));
|
2020-09-04 07:24:14 -04:00
|
|
|
return data.house_ads.map((ad) => Ember.Object.create(ad));
|
2019-04-18 17:52:59 -04:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
controller.setProperties({
|
|
|
|
model,
|
|
|
|
houseAdsSettings: this.get("settings"),
|
2020-09-04 07:24:14 -04:00
|
|
|
loadingAds: false,
|
2019-04-18 17:52:59 -04:00
|
|
|
});
|
2020-09-04 07:24:14 -04:00
|
|
|
},
|
2019-04-18 17:52:59 -04:00
|
|
|
});
|