show the plans in the buttons proper

This commit is contained in:
Rimian Perkins
2019-12-09 12:01:10 +11:00
parent 71d6c6dab2
commit 1c31884475
4 changed files with 23 additions and 12 deletions
@@ -5,12 +5,10 @@ import Subscription from "discourse/plugins/discourse-subscriptions/discourse/mo
export default Discourse.Route.extend({
model(params) {
const product_id = params["subscription-id"];
const product = Product.find(product_id);
const product = Product.find(product_id);
const subscription = Subscription.create();
const plans = Plan.findAll({ product_id: product_id }).then(results =>
results.map(p => ({ id: p.id, name: p.subscriptionRate }))
);
const plans = Plan.findAll({ product_id: product_id });
return Ember.RSVP.hash({ plans, product, subscription });
}
@@ -18,7 +18,7 @@
class="btn btn-discourse-subscriptions-subscribe"
}}
<div class="interval">
{{plan.interval}}
{{i18n (concat "discourse_subscriptions.plans.interval.adverb." plan.interval)}}
</div>
<span class="amount">
{{format-currency plan.currency plan.amountDollars}}