From 382fd4ac410d5fd70140c43b304b53698d76963a Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Mon, 2 Dec 2019 18:58:14 +1100 Subject: [PATCH] name space the js admin --- README.md | 10 +++--- ...-discourse-subscriptions-dashboard.js.es6} | 0 ...iscourse-subscriptions-plans-index.js.es6} | 2 +- ...discourse-subscriptions-plans-show.js.es6} | 2 +- ...gins-discourse-subscriptions-plans.js.es6} | 0 ...ourse-subscriptions-products-index.js.es6} | 0 ...criptions-products-show-plans-show.js.es6} | 2 +- ...course-subscriptions-products-show.js.es6} | 6 ++-- ...course-subscriptions-subscriptions.js.es6} | 0 ... discourse-subscriptions-route-map.js.es6} | 2 +- .../discourse/models/admin-plan.js.es6 | 2 +- .../discourse/models/user-subscription.js.es6 | 2 +- ...ugins-discourse-patrons-plans-index.js.es6 | 7 ---- ...-discourse-subscriptions-dashboard.js.es6} | 0 ...discourse-subscriptions-plans-index.js.es6 | 7 ++++ ...gins-discourse-subscriptions-plans.js.es6} | 0 ...ourse-subscriptions-products-index.js.es6} | 4 +-- ...criptions-products-show-plans-show.js.es6} | 10 +++--- ...course-subscriptions-products-show.js.es6} | 6 ++-- ...s-discourse-subscriptions-products.js.es6} | 0 ...course-subscriptions-subscriptions.js.es6} | 2 +- ...in-plugins-discourse-subscriptions.js.es6} | 0 .../routes/patrons-subscribe-show.js.es6 | 6 ++-- .../discourse/routes/patrons-subscribe.js.es6 | 2 +- .../discourse/routes/user-billing.js.es6 | 2 +- .../routes/user-subscriptions.js.es6 | 2 +- .../admin/plugins-discourse-patrons.hbs | 14 -------- ...ins-discourse-subscriptions-dashboard.hbs} | 0 ...s-discourse-subscriptions-plans-index.hbs} | 0 ...iscourse-subscriptions-products-index.hbs} | 4 +-- ...ubscriptions-products-show-plans-show.hbs} | 0 ...discourse-subscriptions-products-show.hbs} | 8 ++--- ...gins-discourse-subscriptions-products.hbs} | 0 ...discourse-subscriptions-subscriptions.hbs} | 0 .../admin/plugins-discourse-subscriptions.hbs | 14 ++++++++ config/locales/client.en.yml | 4 +-- plugin.rb | 33 +++++++++++-------- 37 files changed, 79 insertions(+), 74 deletions(-) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-dashboard.js.es6 => admin-plugins-discourse-subscriptions-dashboard.js.es6} (100%) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-plans-index.js.es6 => admin-plugins-discourse-subscriptions-plans-index.js.es6} (74%) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-plans-show.js.es6 => admin-plugins-discourse-subscriptions-plans-show.js.es6} (84%) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-plans.js.es6 => admin-plugins-discourse-subscriptions-plans.js.es6} (100%) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-products-index.js.es6 => admin-plugins-discourse-subscriptions-products-index.js.es6} (100%) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-products-show-plans-show.js.es6 => admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6} (94%) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-products-show.js.es6 => admin-plugins-discourse-subscriptions-products-show.js.es6} (69%) rename assets/javascripts/discourse/controllers/{admin-plugins-discourse-patrons-subscriptions.js.es6 => admin-plugins-discourse-subscriptions-subscriptions.js.es6} (100%) rename assets/javascripts/discourse/{discourse-patrons-route-map.js.es6 => discourse-subscriptions-route-map.js.es6} (88%) delete mode 100644 assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-plans-index.js.es6 rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-dashboard.js.es6 => admin-plugins-discourse-subscriptions-dashboard.js.es6} (100%) create mode 100644 assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans-index.js.es6 rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-plans.js.es6 => admin-plugins-discourse-subscriptions-plans.js.es6} (100%) rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-products-index.js.es6 => admin-plugins-discourse-subscriptions-products-index.js.es6} (78%) rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-products-show-plans-show.js.es6 => admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6} (63%) rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-products-show.js.es6 => admin-plugins-discourse-subscriptions-products-show.js.es6} (77%) rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-products.js.es6 => admin-plugins-discourse-subscriptions-products.js.es6} (100%) rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons-subscriptions.js.es6 => admin-plugins-discourse-subscriptions-subscriptions.js.es6} (88%) rename assets/javascripts/discourse/routes/{admin-plugins-discourse-patrons.js.es6 => admin-plugins-discourse-subscriptions.js.es6} (100%) delete mode 100644 assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-dashboard.hbs => plugins-discourse-subscriptions-dashboard.hbs} (100%) rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-plans-index.hbs => plugins-discourse-subscriptions-plans-index.hbs} (100%) rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-products-index.hbs => plugins-discourse-subscriptions-products-index.hbs} (85%) rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-products-show-plans-show.hbs => plugins-discourse-subscriptions-products-show-plans-show.hbs} (100%) rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-products-show.hbs => plugins-discourse-subscriptions-products-show.hbs} (90%) rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-products.hbs => plugins-discourse-subscriptions-products.hbs} (100%) rename assets/javascripts/discourse/templates/admin/{plugins-discourse-patrons-subscriptions.hbs => plugins-discourse-subscriptions-subscriptions.hbs} (100%) create mode 100644 assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs diff --git a/README.md b/README.md index 8dd5b08..5403e97 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Discourse Patrons +# Discourse Subscriptions -[![Build Status](https://travis-ci.org/rimian/discourse-patrons.svg?branch=master)](https://travis-ci.org/rimian/discourse-patrons) +[![Build Status](https://travis-ci.org/rimian/discourse-subscriptions.svg?branch=master)](https://travis-ci.org/rimian/discourse-subscriptions) -The Discourse Patrons plugin allows you to set up a subscription based Discourse application. By integrating with the [Stripe](https://stripe.com) payment gateway and setting up this plugin to manage Subscriptions, you can start selling users access to content on your website. +The Discourse Subscriptions plugin allows you to set up a subscription based Discourse application. By integrating with the [Stripe](https://stripe.com) payment gateway and setting up this plugin to manage Subscriptions, you can start selling users access to content on your website. You can try it out here: https://discourse.rimian.com.au/patrons/subscribe @@ -50,7 +50,7 @@ You can also toggle the Subscribe button on and off in case you want to hide the In the admin, add a new Product. Once you have a product saved, you can add plans to it. Keep in mind that the pricing and billing intervals of plans cannot be changed once you create them. This is to avoid confusion around subscription management. -If you take a look at your [Stripe Dashboard](https://dashboard.stripe.com), you'll see all those products and plans are listed. Discourse Patrons does not create them locally. They are created in Stripe. +If you take a look at your [Stripe Dashboard](https://dashboard.stripe.com), you'll see all those products and plans are listed. Discourse Patrons does not create them locally. They are created in Stripe. ## Testing @@ -58,7 +58,7 @@ Test with these credit card numbers: * 4111 1111 1111 1111 -Visit `/patrons/subscribe` and enter a few test transcations. +Visit `/patrons/subscribe` and enter a few test transcations. ## Warranty diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-dashboard.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-dashboard.js.es6 similarity index 100% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-dashboard.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-dashboard.js.es6 diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-index.js.es6 similarity index 74% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-index.js.es6 index 69ba47a..3f37394 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-index.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-index.js.es6 @@ -4,7 +4,7 @@ export default Ember.Controller.extend({ actions: { editPlan(id) { return DiscourseURL.redirectTo( - `/admin/plugins/discourse-patrons/plans/${id}` + `/admin/plugins/discourse-subscriptions/plans/${id}` ); } } diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-show.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-show.js.es6 similarity index 84% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-show.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-show.js.es6 index 39f9ee0..6fa26ad 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans-show.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans-show.js.es6 @@ -11,7 +11,7 @@ export default Ember.Controller.extend({ this.get("model.plan") .save() .then(() => { - this.transitionToRoute("adminPlugins.discourse-patrons.plans"); + this.transitionToRoute("adminPlugins.discourse-subscriptions.plans"); }) .catch(popupAjaxError); } diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans.js.es6 similarity index 100% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-plans.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-plans.js.es6 diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-index.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-index.js.es6 similarity index 100% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-index.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-index.js.es6 diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 similarity index 94% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 index 63b23c2..90ebf93 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 @@ -17,7 +17,7 @@ export default Ember.Controller.extend({ redirect(product_id) { DiscourseURL.redirectTo( - `/admin/plugins/discourse-patrons/products/${product_id}` + `/admin/plugins/discourse-subscriptions/products/${product_id}` ); }, diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show.js.es6 similarity index 69% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show.js.es6 index d3050bb..7ae2376 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-products-show.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-products-show.js.es6 @@ -3,7 +3,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; export default Ember.Controller.extend({ actions: { cancelProduct() { - this.transitionToRoute("adminPlugins.discourse-patrons.products"); + this.transitionToRoute("adminPlugins.discourse-subscriptions.products"); }, createProduct() { @@ -11,7 +11,7 @@ export default Ember.Controller.extend({ .save() .then(product => { this.transitionToRoute( - "adminPlugins.discourse-patrons.products.show", + "adminPlugins.discourse-subscriptions.products.show", product.id ); }) @@ -22,7 +22,7 @@ export default Ember.Controller.extend({ this.get("model.product") .update() .then(() => { - this.transitionToRoute("adminPlugins.discourse-patrons.products"); + this.transitionToRoute("adminPlugins.discourse-subscriptions.products"); }) .catch(popupAjaxError); } diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-subscriptions.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-subscriptions.js.es6 similarity index 100% rename from assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons-subscriptions.js.es6 rename to assets/javascripts/discourse/controllers/admin-plugins-discourse-subscriptions-subscriptions.js.es6 diff --git a/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 b/assets/javascripts/discourse/discourse-subscriptions-route-map.js.es6 similarity index 88% rename from assets/javascripts/discourse/discourse-patrons-route-map.js.es6 rename to assets/javascripts/discourse/discourse-subscriptions-route-map.js.es6 index b700afd..fa2cd04 100644 --- a/assets/javascripts/discourse/discourse-patrons-route-map.js.es6 +++ b/assets/javascripts/discourse/discourse-subscriptions-route-map.js.es6 @@ -3,7 +3,7 @@ export default { path: "/plugins", map() { - this.route("discourse-patrons", function() { + this.route("discourse-subscriptions", function() { this.route("dashboard"); this.route("products", function() { diff --git a/assets/javascripts/discourse/models/admin-plan.js.es6 b/assets/javascripts/discourse/models/admin-plan.js.es6 index 6f7b0ad..c76c753 100644 --- a/assets/javascripts/discourse/models/admin-plan.js.es6 +++ b/assets/javascripts/discourse/models/admin-plan.js.es6 @@ -1,4 +1,4 @@ -import Plan from "discourse/plugins/discourse-patrons/discourse/models/plan"; +import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan"; import computed from "ember-addons/ember-computed-decorators"; import { ajax } from "discourse/lib/ajax"; diff --git a/assets/javascripts/discourse/models/user-subscription.js.es6 b/assets/javascripts/discourse/models/user-subscription.js.es6 index 20b7102..936e63e 100644 --- a/assets/javascripts/discourse/models/user-subscription.js.es6 +++ b/assets/javascripts/discourse/models/user-subscription.js.es6 @@ -1,6 +1,6 @@ import computed from "ember-addons/ember-computed-decorators"; import { ajax } from "discourse/lib/ajax"; -import Plan from "discourse/plugins/discourse-patrons/discourse/models/plan"; +import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan"; const UserSubscription = Discourse.Model.extend({ @computed("status") diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-plans-index.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-plans-index.js.es6 deleted file mode 100644 index e9f7c31..0000000 --- a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-plans-index.js.es6 +++ /dev/null @@ -1,7 +0,0 @@ -import AdminPlan from "discourse/plugins/discourse-patrons/discourse/models/admin-plan"; - -export default Discourse.Route.extend({ - model() { - return AdminPlan.findAll(); - } -}); diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-dashboard.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-dashboard.js.es6 similarity index 100% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-dashboard.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-dashboard.js.es6 diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans-index.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans-index.js.es6 new file mode 100644 index 0000000..bfca7c4 --- /dev/null +++ b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans-index.js.es6 @@ -0,0 +1,7 @@ +import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan"; + +export default Discourse.Route.extend({ + model() { + return AdminPlan.findAll(); + } +}); diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-plans.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans.js.es6 similarity index 100% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-plans.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-plans.js.es6 diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-index.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-index.js.es6 similarity index 78% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-index.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-index.js.es6 index 5c80528..a92c2b5 100644 --- a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-index.js.es6 +++ b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-index.js.es6 @@ -1,4 +1,4 @@ -import AdminProduct from "discourse/plugins/discourse-patrons/discourse/models/admin-product"; +import AdminProduct from "discourse/plugins/discourse-subscriptions/discourse/models/admin-product"; export default Discourse.Route.extend({ model() { @@ -16,7 +16,7 @@ export default Discourse.Route.extend({ product .destroy() .then(() => { - this.controllerFor("adminPluginsDiscoursePatronsProductsIndex") + this.controllerFor("adminPluginsDiscourseSubscriptionsProductsIndex") .get("model") .removeObject(product); }) diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 similarity index 63% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 index bfbd22b..529f844 100644 --- a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-show-plans-show.js.es6 +++ b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show-plans-show.js.es6 @@ -1,11 +1,11 @@ -import AdminPlan from "discourse/plugins/discourse-patrons/discourse/models/admin-plan"; +import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan"; import Group from "discourse/models/group"; export default Discourse.Route.extend({ model(params) { const id = params["plan-id"]; const product = this.modelFor( - "adminPlugins.discourse-patrons.products.show" + "adminPlugins.discourse-subscriptions.products.show" ).product; let plan; @@ -26,10 +26,10 @@ export default Discourse.Route.extend({ }, renderTemplate() { - this.render("adminPlugins.discourse-patrons.products.show.plans.show", { - into: "adminPlugins.discourse-patrons.products", + this.render("adminPlugins.discourse-subscriptions.products.show.plans.show", { + into: "adminPlugins.discourse-subscriptions.products", outlet: "main", - controller: "adminPlugins.discourse-patrons.products.show.plans.show" + controller: "adminPlugins.discourse-subscriptions.products.show.plans.show" }); } }); diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-show.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show.js.es6 similarity index 77% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-show.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show.js.es6 index 0fab55d..f7f515e 100644 --- a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products-show.js.es6 +++ b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products-show.js.es6 @@ -1,5 +1,5 @@ -import AdminProduct from "discourse/plugins/discourse-patrons/discourse/models/admin-product"; -import AdminPlan from "discourse/plugins/discourse-patrons/discourse/models/admin-plan"; +import AdminProduct from "discourse/plugins/discourse-subscriptions/discourse/models/admin-product"; +import AdminPlan from "discourse/plugins/discourse-subscriptions/discourse/models/admin-plan"; export default Discourse.Route.extend({ model(params) { @@ -28,7 +28,7 @@ export default Discourse.Route.extend({ plan .destroy() .then(() => { - this.controllerFor("adminPluginsDiscoursePatronsProductsShow") + this.controllerFor("adminPluginsDiscourseSubscriptionsProductsShow") .get("model.plans") .removeObject(plan); }) diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products.js.es6 similarity index 100% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-products.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-products.js.es6 diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-subscriptions.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-subscriptions.js.es6 similarity index 88% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-subscriptions.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-subscriptions.js.es6 index bfca9f0..9f834e4 100644 --- a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons-subscriptions.js.es6 +++ b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions-subscriptions.js.es6 @@ -1,4 +1,4 @@ -import AdminSubscription from "discourse/plugins/discourse-patrons/discourse/models/admin-subscription"; +import AdminSubscription from "discourse/plugins/discourse-subscriptions/discourse/models/admin-subscription"; export default Discourse.Route.extend({ model() { diff --git a/assets/javascripts/discourse/routes/admin-plugins-discourse-patrons.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions.js.es6 similarity index 100% rename from assets/javascripts/discourse/routes/admin-plugins-discourse-patrons.js.es6 rename to assets/javascripts/discourse/routes/admin-plugins-discourse-subscriptions.js.es6 diff --git a/assets/javascripts/discourse/routes/patrons-subscribe-show.js.es6 b/assets/javascripts/discourse/routes/patrons-subscribe-show.js.es6 index 7c51e8b..7664b0e 100644 --- a/assets/javascripts/discourse/routes/patrons-subscribe-show.js.es6 +++ b/assets/javascripts/discourse/routes/patrons-subscribe-show.js.es6 @@ -1,6 +1,6 @@ -import Product from "discourse/plugins/discourse-patrons/discourse/models/product"; -import Plan from "discourse/plugins/discourse-patrons/discourse/models/plan"; -import Subscription from "discourse/plugins/discourse-patrons/discourse/models/subscription"; +import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product"; +import Plan from "discourse/plugins/discourse-subscriptions/discourse/models/plan"; +import Subscription from "discourse/plugins/discourse-subscriptions/discourse/models/subscription"; export default Discourse.Route.extend({ model(params) { diff --git a/assets/javascripts/discourse/routes/patrons-subscribe.js.es6 b/assets/javascripts/discourse/routes/patrons-subscribe.js.es6 index 7f525cb..42f0abc 100644 --- a/assets/javascripts/discourse/routes/patrons-subscribe.js.es6 +++ b/assets/javascripts/discourse/routes/patrons-subscribe.js.es6 @@ -1,4 +1,4 @@ -import Product from "discourse/plugins/discourse-patrons/discourse/models/product"; +import Product from "discourse/plugins/discourse-subscriptions/discourse/models/product"; export default Discourse.Route.extend({ model() { diff --git a/assets/javascripts/discourse/routes/user-billing.js.es6 b/assets/javascripts/discourse/routes/user-billing.js.es6 index ad03653..3a6899d 100644 --- a/assets/javascripts/discourse/routes/user-billing.js.es6 +++ b/assets/javascripts/discourse/routes/user-billing.js.es6 @@ -1,4 +1,4 @@ -import Invoice from "discourse/plugins/discourse-patrons/discourse/models/invoice"; +import Invoice from "discourse/plugins/discourse-subscriptions/discourse/models/invoice"; export default Discourse.Route.extend({ model() { diff --git a/assets/javascripts/discourse/routes/user-subscriptions.js.es6 b/assets/javascripts/discourse/routes/user-subscriptions.js.es6 index 571e2ac..1baf8c3 100644 --- a/assets/javascripts/discourse/routes/user-subscriptions.js.es6 +++ b/assets/javascripts/discourse/routes/user-subscriptions.js.es6 @@ -1,4 +1,4 @@ -import UserSubscription from "discourse/plugins/discourse-patrons/discourse/models/user-subscription"; +import UserSubscription from "discourse/plugins/discourse-subscriptions/discourse/models/user-subscription"; export default Discourse.Route.extend({ model() { diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs deleted file mode 100644 index 3c6a30c..0000000 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons.hbs +++ /dev/null @@ -1,14 +0,0 @@ - -

{{i18n 'discourse_patrons.title' site_name=siteSettings.title}}

- - - -
- -
- {{outlet}} -
diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-dashboard.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.hbs similarity index 100% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-dashboard.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.hbs diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-plans-index.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.hbs similarity index 100% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-plans-index.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.hbs diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-index.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.hbs similarity index 85% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-index.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.hbs index 3de8aa8..605f161 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-index.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.hbs @@ -1,6 +1,6 @@

- {{#link-to 'adminPlugins.discourse-patrons.products.show' 'new' class="btn btn-primary"}} + {{#link-to 'adminPlugins.discourse-subscriptions.products.show' 'new' class="btn btn-primary"}} {{d-icon "plus"}} {{i18n 'discourse_patrons.admin.products.operations.new'}} {{/link-to}} @@ -22,7 +22,7 @@ {{format-unix-date product.updated}} {{product.active}} - {{#link-to "adminPlugins.discourse-patrons.products.show" product.id class="btn no-text btn-icon"}} + {{#link-to "adminPlugins.discourse-subscriptions.products.show" product.id class="btn no-text btn-icon"}} {{d-icon "far-edit"}} {{/link-to}} {{d-button diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-show-plans-show.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.hbs similarity index 100% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-show-plans-show.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.hbs diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-show.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.hbs similarity index 90% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-show.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.hbs index 162b08e..33771aa 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products-show.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.hbs @@ -42,9 +42,9 @@ {{i18n 'discourse_patrons.admin.plans.plan.active'}} {{i18n 'discourse_patrons.admin.plans.plan.amount'}} - {{#link-to "adminPlugins.discourse-patrons.products.show.plans.show" model.product.id "new" class="btn"}} - {{i18n 'discourse_patrons.admin.plans.operations.add'}} - {{/link-to}} + {{#link-to "adminPlugins.discourse-subscriptions.products.show.plans.show" model.product.id "new" class="btn"}} + {{i18n 'discourse_patrons.admin.plans.operations.add'}} + {{/link-to}} {{#each model.plans as |plan|}} @@ -56,7 +56,7 @@ {{plan.active}} {{format-currency plan.currency plan.amountDollars}} - {{#link-to "adminPlugins.discourse-patrons.products.show.plans.show" model.product.id plan.id class="btn no-text btn-icon"}} + {{#link-to "adminPlugins.discourse-subscriptions.products.show.plans.show" model.product.id plan.id class="btn no-text btn-icon"}} {{d-icon "far-edit"}} {{/link-to}} {{d-button diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.hbs similarity index 100% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-products.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.hbs diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-subscriptions.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.hbs similarity index 100% rename from assets/javascripts/discourse/templates/admin/plugins-discourse-patrons-subscriptions.hbs rename to assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.hbs diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs new file mode 100644 index 0000000..66b4c30 --- /dev/null +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs @@ -0,0 +1,14 @@ + +

{{i18n 'discourse_patrons.title' site_name=siteSettings.title}}

+ + + +
+ +
+ {{outlet}} +
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 77f20d5..2fe7889 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1,6 +1,6 @@ en: site_settings: - discourse_patrons_enabled: Enable the Discourse Patrons plugin. + discourse_patrons_enabled: Enable the Discourse Subscriptions plugin. discourse_patrons_extra_nav_subscribe: Show the subscribe button in the primary navigation discourse_patrons_public_key: Stripe Publishable Key discourse_patrons_secret_key: Stripe Secret Key @@ -15,7 +15,7 @@ en: discourse_patrons_amount_must_be_currency: "Currency amounts must be currencies without dollar symbol (eg 1.50)" js: discourse_patrons: - title: Discourse Patrons + title: Discourse Subscriptions optional: Optional transactions: payment: diff --git a/plugin.rb b/plugin.rb index 1e97123..53b2e35 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -# name: discourse-patrons -# about: Integrates Stripe into Discourse to allow visitors to make payments and Subscribe -# version: 2.3.2 -# url: https://github.com/rimian/discourse-patrons +# name: discourse-subscriptions +# about: Integrates Stripe into Discourse to allow visitors to subscribe +# version: 2.4.0 +# url: https://github.com/rimian/discourse-subscriptions # authors: Rimian Perkins enabled_site_setting :discourse_patrons_enabled @@ -24,24 +24,29 @@ extend_content_security_policy( script_src: ['https://js.stripe.com/v3/'] ) -add_admin_route 'discourse_patrons.title', 'discourse-patrons.products' +add_admin_route 'discourse_patrons.title', 'discourse-subscriptions.products' Discourse::Application.routes.append do - get '/admin/plugins/discourse-patrons' => 'admin/plugins#index' - get '/admin/plugins/discourse-patrons/products' => 'admin/plugins#index' - get '/admin/plugins/discourse-patrons/products/:product_id' => 'admin/plugins#index' - get '/admin/plugins/discourse-patrons/products/:product_id/plans' => 'admin/plugins#index' - get '/admin/plugins/discourse-patrons/products/:product_id/plans/:plan_id' => 'admin/plugins#index' - get '/admin/plugins/discourse-patrons/subscriptions' => 'admin/plugins#index' - get '/admin/plugins/discourse-patrons/plans' => 'admin/plugins#index' - get '/admin/plugins/discourse-patrons/plans/:plan_id' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions/products' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions/products/:product_id' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions/products/:product_id/plans' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions/products/:product_id/plans/:plan_id' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions/subscriptions' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions/plans' => 'admin/plugins#index' + get '/admin/plugins/discourse-subscriptions/plans/:plan_id' => 'admin/plugins#index' get 'u/:username/billing' => 'users#show', constraints: { username: USERNAME_ROUTE_FORMAT } get 'u/:username/subscriptions' => 'users#show', constraints: { username: USERNAME_ROUTE_FORMAT } end after_initialize do ::Stripe.api_version = "2019-11-05" - ::Stripe.set_app_info('Discourse Patrons', version: '2.3.2', url: 'https://github.com/rimian/discourse-patrons') + + ::Stripe.set_app_info( + 'Discourse Subscriptions', + version: '2.4.0', + url: 'https://github.com/rimian/discourse-subscriptions' + ) [ "../lib/discourse_patrons/engine",