add nested route
This commit is contained in:
parent
a914d4ee59
commit
0d4cd5b1e5
|
@ -1,11 +1 @@
|
|||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actions: {
|
||||
editProduct(id) {
|
||||
return DiscourseURL.redirectTo(
|
||||
`/admin/plugins/discourse-patrons/products/${id}`
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
export default Ember.Controller.extend({});
|
||||
|
|
|
@ -4,12 +4,20 @@ export default {
|
|||
map() {
|
||||
this.route("discourse-patrons", function() {
|
||||
this.route("dashboard");
|
||||
|
||||
this.route("products", function() {
|
||||
this.route("plans", { path: "/:product-id/plans" }, function() {
|
||||
this.route("show", { path: "/:plan-id" });
|
||||
});
|
||||
this.route("show", { path: "/:product-id" });
|
||||
});
|
||||
this.route("plans", function() {
|
||||
this.route("show", { path: "/:plan-id" });
|
||||
});
|
||||
|
||||
// this.route("products", function() {
|
||||
// this.route("show", { path: "/:product-id" });
|
||||
// });
|
||||
// this.route("plans", function() {
|
||||
// this.route("show", { path: "/:plan-id" });
|
||||
// });
|
||||
this.route("subscriptions");
|
||||
});
|
||||
}
|
||||
|
|
|
@ -14,10 +14,9 @@
|
|||
<td>{{product.metadata.group_name}}</td>
|
||||
<td>{{product.active}}</td>
|
||||
<td class="td-right">
|
||||
{{d-button
|
||||
action=(action "editProduct" product.id)
|
||||
icon="far-edit"
|
||||
class="btn no-text btn-icon"}}
|
||||
{{#link-to "adminPlugins.discourse-patrons.products.show" product.id class="btn no-text btn-icon"}}
|
||||
{{d-icon "far-edit"}}
|
||||
{{/link-to}}
|
||||
{{d-button
|
||||
action=(route-action "destroyProduct")
|
||||
actionParam=product
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
<ul class="nav nav-pills">
|
||||
{{nav-item route='adminPlugins.discourse-patrons.dashboard' label='discourse_patrons.admin.dashboard.title'}}
|
||||
{{nav-item route='adminPlugins.discourse-patrons.products' label='discourse_patrons.admin.products.title'}}
|
||||
{{nav-item route='adminPlugins.discourse-patrons.plans' label='discourse_patrons.admin.plans.title'}}
|
||||
{{nav-item route='adminPlugins.discourse-patrons.subscriptions' label='discourse_patrons.admin.subscriptions.title'}}
|
||||
</ul>
|
||||
|
||||
|
|
Loading…
Reference in New Issue