mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-07-04 05:22:12 +00:00
pretty js
This commit is contained in:
parent
78cbfc2652
commit
482ce178d5
@ -34,7 +34,9 @@ export default Ember.Controller.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
subscription.save().then(() => {
|
subscription.save().then(() => {
|
||||||
bootbox.alert(I18n.t("discourse_patrons.transactions.payment.success"));
|
bootbox.alert(
|
||||||
|
I18n.t("discourse_patrons.transactions.payment.success")
|
||||||
|
);
|
||||||
this.transitionToRoute(
|
this.transitionToRoute(
|
||||||
"user.subscriptions",
|
"user.subscriptions",
|
||||||
Discourse.User.current().username.toLowerCase()
|
Discourse.User.current().username.toLowerCase()
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
// TODO: typo in this helper name: currency not curency.
|
// TODO: typo in this helper name: currency not curency.
|
||||||
export default Ember.Helper.helper(function(params) {
|
export default Ember.Helper.helper(function(params) {
|
||||||
let currencySign;
|
let currencySign;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
export default Ember.Helper.helper(function(params) {
|
export default Ember.Helper.helper(function(params) {
|
||||||
let currencySign;
|
let currencySign;
|
||||||
|
|
||||||
@ -13,5 +12,5 @@ export default Ember.Helper.helper(function(params) {
|
|||||||
currencySign = "$";
|
currencySign = "$";
|
||||||
}
|
}
|
||||||
|
|
||||||
return currencySign + params.map(p => p.toUpperCase()).join(' ');
|
return currencySign + params.map(p => p.toUpperCase()).join(" ");
|
||||||
});
|
});
|
||||||
|
@ -10,8 +10,8 @@ Product.reopenClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
find(id) {
|
find(id) {
|
||||||
return ajax(`/patrons/products/${id}`, { method: "get" }).then(
|
return ajax(`/patrons/products/${id}`, { method: "get" }).then(product =>
|
||||||
product => Product.create(product)
|
Product.create(product)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -9,9 +9,9 @@ const UserSubscription = Discourse.Model.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
return ajax(`/patrons/user/subscriptions/${this.id}`, { method: "delete" }).then(
|
return ajax(`/patrons/user/subscriptions/${this.id}`, {
|
||||||
result => UserSubscription.create(result)
|
method: "delete"
|
||||||
);
|
}).then(result => UserSubscription.create(result));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -12,5 +12,5 @@ export default Discourse.Route.extend({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return Ember.RSVP.hash({ plans, product, subscription });
|
return Ember.RSVP.hash({ plans, product, subscription });
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
@ -3,5 +3,5 @@ import Product from "discourse/plugins/discourse-patrons/discourse/models/produc
|
|||||||
export default Discourse.Route.extend({
|
export default Discourse.Route.extend({
|
||||||
model() {
|
model() {
|
||||||
return Product.findAll();
|
return Product.findAll();
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user