add controllers

This commit is contained in:
Rimian Perkins 2019-09-11 21:09:34 +10:00
parent a9434f5723
commit 5cddda6703
3 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,12 @@
import { ajax } from "discourse/lib/ajax";
export default Ember.Controller.extend({
actions: {
stripePaymentHandler(paymentMethodId, amount) {
return ajax("/donate/charges", {
data: { paymentMethodId, amount },
method: "post"
});
},
},
});

View File

@ -0,0 +1,5 @@
import { ajax } from "discourse/lib/ajax";
export default Ember.Controller.extend({
});

View File

@ -1,2 +1,12 @@
index
<h3>{{i18n 'discourse_donations.title' site_name=siteSettings.title}}</h3>
<div class="donations-page-description">
{{cook-text siteSettings.discourse_donations_page_description}}
</div>
<div class="donations-page-payment">
{{donation-form
stripePaymentHandler=(action "stripePaymentHandler")
}}
</div>