diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-index.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-index.js.es6 index 6f1cd71..2d3f960 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-index.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-index.js.es6 @@ -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({}); diff --git a/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 b/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 index dcefa3f..4572342 100644 --- a/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 +++ b/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 @@ -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"); }); } diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-index.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-index.hbs index e3e0c18..4a7abbc 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-index.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-index.hbs @@ -14,10 +14,9 @@ {{product.metadata.group_name}} {{product.active}} - {{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 diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs index 99157f8..2e953c6 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs @@ -4,7 +4,6 @@