products admin route and basic pages
This commit is contained in:
-8
@@ -2,14 +2,6 @@ import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actions: {
|
||||
destroyPlan(plan) {
|
||||
plan.destroy().then(() =>
|
||||
this.controllerFor("adminPluginsDiscoursePatronsPlansIndex")
|
||||
.get("model")
|
||||
.removeObject(plan)
|
||||
);
|
||||
},
|
||||
|
||||
editPlan(id) {
|
||||
return DiscourseURL.redirectTo(
|
||||
`/admin/plugins/discourse-patrons/plans/${id}`
|
||||
|
||||
@@ -39,7 +39,7 @@ export default Ember.Controller.extend({
|
||||
};
|
||||
|
||||
return ajax("/patrons/subscriptions", { method: "post", data: subscriptionData }).then(
|
||||
subscription => {
|
||||
() => {
|
||||
return DiscourseURL.redirectTo(Discourse.SiteSettings.discourse_patrons_subscription_group_landing_page);
|
||||
}
|
||||
);
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import AdminProduct from "discourse/plugins/discourse-patrons/discourse/models/admin-product";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
model() {
|
||||
return AdminProduct.find();
|
||||
},
|
||||
|
||||
actions: {
|
||||
destroyProduct(product) {
|
||||
bootbox.confirm(
|
||||
I18n.t("discourse_patrons.admin.products.operations.destroy.confirm"),
|
||||
I18n.t("no_value"),
|
||||
I18n.t("yes_value"),
|
||||
confirmed => {
|
||||
if (confirmed) {
|
||||
this.controllerFor("adminPluginsDiscoursePatronsProductsIndex")
|
||||
.get("model")
|
||||
.removeObject(product);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
<table class="table discourse-patrons-admin">
|
||||
<thead>
|
||||
<th></th>
|
||||
<th>{{i18n 'discourse_patrons.admin.products.product.product_id'}}</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
{{#each model as |product|}}
|
||||
|
||||
Reference in New Issue
Block a user