mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-03-08 02:29:54 +00:00
- Colocate components / connectors - Move admin UI files to `admin/assets` so they are only served to admins
22 lines
556 B
JavaScript
22 lines
556 B
JavaScript
import EmberObject from "@ember/object";
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
import I18n from "I18n";
|
|
|
|
export default DiscourseRoute.extend({
|
|
model(params) {
|
|
if (params.ad_id === "new") {
|
|
return EmberObject.create({
|
|
name: I18n.t("admin.adplugin.house_ads.new_name"),
|
|
html: "",
|
|
visible_to_logged_in_users: true,
|
|
visible_to_anons: true,
|
|
});
|
|
} else {
|
|
return this.modelFor("adminPlugins.houseAds").findBy(
|
|
"id",
|
|
parseInt(params.ad_id, 10)
|
|
);
|
|
}
|
|
},
|
|
});
|