2024-04-09 13:54:11 -04:00
|
|
|
import { TrackedObject } from "@ember-compat/tracked-built-ins";
|
2023-11-07 12:07:33 -05:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2020-09-04 07:24:14 -04:00
|
|
|
import I18n from "I18n";
|
2020-05-12 13:58:12 -04:00
|
|
|
|
|
|
|
export default DiscourseRoute.extend({
|
2019-04-18 17:52:59 -04:00
|
|
|
model(params) {
|
|
|
|
if (params.ad_id === "new") {
|
2024-04-09 13:54:11 -04:00
|
|
|
return new TrackedObject({
|
2019-04-18 17:52:59 -04:00
|
|
|
name: I18n.t("admin.adplugin.house_ads.new_name"),
|
2020-09-04 07:24:14 -04:00
|
|
|
html: "",
|
2023-04-07 10:56:22 -04:00
|
|
|
visible_to_logged_in_users: true,
|
|
|
|
visible_to_anons: true,
|
2019-04-18 17:52:59 -04:00
|
|
|
});
|
|
|
|
} else {
|
2024-04-09 13:54:11 -04:00
|
|
|
return new TrackedObject(
|
|
|
|
this.modelFor("adminPlugins.houseAds").findBy(
|
|
|
|
"id",
|
|
|
|
parseInt(params.ad_id, 10)
|
|
|
|
)
|
2019-04-18 17:52:59 -04:00
|
|
|
);
|
|
|
|
}
|
2020-09-04 07:24:14 -04:00
|
|
|
},
|
2019-04-18 17:52:59 -04:00
|
|
|
});
|