diff --git a/.eslintrc b/.eslintrc index 3b7d8a1..ac403ef 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { "globals": { - "Stripe": true, + "Stripe": true }, "extends": "eslint-config-discourse" } diff --git a/.rubocop.yml b/.rubocop.yml index 7a86442..9661a87 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,3 @@ -AllCops: - Exclude: - - 'gems/**/*' inherit_gem: rubocop-discourse: default.yml diff --git a/Gemfile.lock b/Gemfile.lock index 57ac962..b5197eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,31 +7,32 @@ GIT GEM remote: https://rubygems.org/ specs: - ast (2.4.1) - parallel (1.19.2) - parser (2.7.1.4) + ast (2.4.2) + parallel (1.20.1) + parser (3.0.1.1) ast (~> 2.4.1) rainbow (3.0.0) - regexp_parser (1.7.1) + regexp_parser (2.1.1) rexml (3.2.5) - rubocop (0.88.0) + rubocop (1.18.2) parallel (~> 1.10) - parser (>= 2.7.1.1) + parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) + regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 0.1.0, < 1.0) + rubocop-ast (>= 1.7.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.3.0) - parser (>= 2.7.1.4) - rubocop-discourse (2.3.1) - rubocop (>= 0.69.0) - rubocop-rspec (>= 1.39.0) - rubocop-rspec (1.42.0) - rubocop (>= 0.87.0) - ruby-progressbar (1.10.1) - unicode-display_width (1.7.0) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.7.0) + parser (>= 3.0.1.1) + rubocop-discourse (2.4.2) + rubocop (>= 1.1.0) + rubocop-rspec (>= 2.0.0) + rubocop-rspec (2.4.0) + rubocop (~> 1.0) + rubocop-ast (>= 1.1.0) + ruby-progressbar (1.11.0) + unicode-display_width (2.0.0) PLATFORMS ruby @@ -41,4 +42,4 @@ DEPENDENCIES translations-manager! BUNDLED WITH - 2.1.4 + 2.2.19 diff --git a/assets/javascripts/discourse/components/campaign-banner.js.es6 b/assets/javascripts/discourse/components/campaign-banner.js.es6 index 4827ba5..7436027 100644 --- a/assets/javascripts/discourse/components/campaign-banner.js.es6 +++ b/assets/javascripts/discourse/components/campaign-banner.js.es6 @@ -92,6 +92,21 @@ export default Component.extend({ } }, + @discourseComputed("backgroundImageUrl") + bannerInfoStyle(backgroundImageUrl) { + if (!backgroundImageUrl) { + return ""; + } + + return `background-image: linear-gradient( + 0deg, + rgba(var(--secondary-rgb), 0.75) 0%, + rgba(var(--secondary-rgb), 0.75) 100%), + var(--campaign-background-image); + background-size: cover; + background-repeat: no-repeat;`; + }, + @discourseComputed( "router.currentRouteName", "currentUser", diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-coupons.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-coupons.hbs index c0cb065..1ea9127 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-coupons.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-coupons.hbs @@ -1,31 +1,34 @@ {{#if model.unconfigured}} -

{{i18n 'discourse_subscriptions.admin.unconfigured'}}

-

{{i18n 'discourse_subscriptions.admin.on_meta'}}

+

{{i18n "discourse_subscriptions.admin.unconfigured"}}

+

{{i18n "discourse_subscriptions.admin.on_meta"}}

{{else}} {{#if model}} - - - - - + + + + + - {{#each model as |coupon|}} - - - - - - - - {{/each}} + + {{#each model as |coupon|}} + + + + + + + + {{/each}} +
{{i18n 'discourse_subscriptions.admin.coupons.code'}}{{i18n 'discourse_subscriptions.admin.coupons.discount'}}{{i18n 'discourse_subscriptions.admin.coupons.times_redeemed'}}{{i18n 'discourse_subscriptions.admin.coupons.active'}}{{i18n 'discourse_subscriptions.admin.coupons.actions'}}{{i18n "discourse_subscriptions.admin.coupons.code"}}{{i18n "discourse_subscriptions.admin.coupons.discount"}}{{i18n "discourse_subscriptions.admin.coupons.times_redeemed"}}{{i18n "discourse_subscriptions.admin.coupons.active"}}{{i18n "discourse_subscriptions.admin.coupons.actions"}}
{{coupon.code}}{{coupon.discount}}{{coupon.times_redeemed}}{{input type="checkbox" checked=coupon.active click=(action "toggleActive" coupon)}} - {{d-button - action=(action "deleteCoupon") - actionParam=coupon - icon="trash-alt" - class="btn-danger btn btn-icon btn-no-text"}} -
{{coupon.code}}{{coupon.discount}}{{coupon.times_redeemed}}{{input type="checkbox" checked=coupon.active click=(action "toggleActive" coupon)}} + {{d-button + action=(action "deleteCoupon") + actionParam=coupon + icon="trash-alt" + class="btn-danger btn btn-icon btn-no-text" + }} +
{{/if}} @@ -35,10 +38,11 @@ label="discourse_subscriptions.admin.coupons.create" title="discourse_subscriptions.admin.coupons.create" icon="plus" - class="btn btn-icon btn-primary create-coupon"}} + class="btn btn-icon btn-primary create-coupon" + }} {{/unless}} {{#if creating}} - {{create-coupon-form cancel=(action 'closeCreateForm') create=(action 'createNewCoupon')}} + {{create-coupon-form cancel=(action "closeCreateForm") create=(action "createNewCoupon")}} {{/if}} {{/if}} diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.hbs index fa04f74..4be4370 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-dashboard.hbs @@ -1,35 +1,36 @@ - -

{{i18n 'discourse_subscriptions.admin.dashboard.title'}}

+

{{i18n "discourse_subscriptions.admin.dashboard.title"}}

{{#load-more selector=".discourse-patrons-table tr" action=(action "loadMore")}} {{#if model}} - - - - - + + + + + - {{#each model as |payment|}} - - - - - - - - {{/each}} + + {{#each model as |payment|}} + + + + + + + + {{/each}} +
{{i18n 'discourse_subscriptions.admin.dashboard.table.head.user'}}{{i18n 'discourse_subscriptions.admin.dashboard.table.head.payment_intent'}}{{i18n 'discourse_subscriptions.admin.dashboard.table.head.receipt_email'}}{{i18n 'created'}}{{i18n 'discourse_subscriptions.admin.dashboard.table.head.amount'}}{{i18n "discourse_subscriptions.admin.dashboard.table.head.user"}}{{i18n "discourse_subscriptions.admin.dashboard.table.head.payment_intent"}}{{i18n "discourse_subscriptions.admin.dashboard.table.head.receipt_email"}}{{i18n "created"}}{{i18n "discourse_subscriptions.admin.dashboard.table.head.amount"}}
- {{#link-to "adminUser.index" payment.user_id payment.username}} - {{payment.username}} - {{/link-to}} - - {{#link-to "patrons.show" payment.payment_intent_id}} - {{{payment.payment_intent_id}}} - {{/link-to}} - {{payment.receipt_email}}{{{format-duration payment.created_at_age}}}{{payment.amount_currency}}
+ {{#link-to "adminUser.index" payment.user_id payment.username}} + {{payment.username}} + {{/link-to}} + + {{#link-to "patrons.show" payment.payment_intent_id}} + {{html-safe payment.payment_intent_id}} + {{/link-to}} + {{payment.receipt_email}}{{html-safe (format-duration payment.created_at_age)}}{{payment.amount_currency}}
{{/if}} {{/load-more}} diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.hbs index e62f983..ae634b9 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-plans-index.hbs @@ -1,29 +1,32 @@ - - - - - + + + + - {{#each model as |plan|}} - - - - - - - - {{/each}} + + {{#each model as |plan|}} + + + + + + + + {{/each}} +
{{i18n 'discourse_subscriptions.admin.plans.plan.plan_id'}}{{i18n 'discourse_subscriptions.admin.plans.plan.nickname.title'}}{{i18n 'discourse_subscriptions.admin.plans.plan.interval'}}{{i18n 'discourse_subscriptions.admin.plans.plan.amount'}}{{i18n "discourse_subscriptions.admin.plans.plan.plan_id"}}{{i18n "discourse_subscriptions.admin.plans.plan.nickname.title"}}{{i18n "discourse_subscriptions.admin.plans.plan.interval"}}{{i18n "discourse_subscriptions.admin.plans.plan.amount"}}
{{plan.id}}{{plan.nickname}}{{plan.interval}}{{plan.unit_amount}} - {{d-button - action=(action "editPlan" plan.id) - icon="far-edit" - class="btn no-text btn-icon"}} - {{d-button - action=(route-action "destroyPlan") - actionParam=plan - icon="trash-alt" - class="btn-danger btn no-text btn-icon"}} -
{{plan.id}}{{plan.nickname}}{{plan.interval}}{{plan.unit_amount}} + {{d-button + action=(action "editPlan" plan.id) + icon="far-edit" + class="btn no-text btn-icon" + }} + {{d-button + action=(route-action "destroyPlan") + actionParam=plan + icon="trash-alt" + class="btn-danger btn no-text btn-icon" + }} +
diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.hbs index 44c9aab..947736f 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-index.hbs @@ -1,47 +1,50 @@ {{#if model.unconfigured }} -

{{i18n 'discourse_subscriptions.admin.unconfigured'}}

-

{{i18n 'discourse_subscriptions.admin.on_meta'}}

+

{{i18n "discourse_subscriptions.admin.unconfigured"}}

+

{{i18n "discourse_subscriptions.admin.on_meta"}}

{{else}}

- {{#link-to 'adminPlugins.discourse-subscriptions.products.show' 'new' class="btn btn-primary"}} + {{#link-to "adminPlugins.discourse-subscriptions.products.show" "new" class="btn btn-primary"}} {{d-icon "plus"}} - {{i18n 'discourse_subscriptions.admin.products.operations.new'}} + {{i18n "discourse_subscriptions.admin.products.operations.new"}} {{/link-to}}

{{#if model}} - - - - + + + + - {{#each model as |product|}} - - - - - - - - {{/each}} + + {{#each model as |product|}} + + + + + + + + {{/each}} +
{{i18n 'discourse_subscriptions.admin.products.product.name'}}{{i18n 'discourse_subscriptions.admin.products.product.created_at'}}{{i18n 'discourse_subscriptions.admin.products.product.updated_at'}}{{i18n 'discourse_subscriptions.admin.products.product.active'}}{{i18n "discourse_subscriptions.admin.products.product.name"}}{{i18n "discourse_subscriptions.admin.products.product.created_at"}}{{i18n "discourse_subscriptions.admin.products.product.updated_at"}}{{i18n "discourse_subscriptions.admin.products.product.active"}}
{{product.name}}{{format-unix-date product.created}}{{format-unix-date product.updated}}{{product.active}} -
- {{#link-to "adminPlugins.discourse-subscriptions.products.show" product.id class="btn no-text btn-icon"}} - {{d-icon "far-edit"}} - {{/link-to}} - {{d-button - action=(route-action "destroyProduct") - actionParam=product - icon="trash-alt" - class="btn-danger btn no-text btn-icon"}} -
-
{{product.name}}{{format-unix-date product.created}}{{format-unix-date product.updated}}{{product.active}} +
+ {{#link-to "adminPlugins.discourse-subscriptions.products.show" product.id class="btn no-text btn-icon"}} + {{d-icon "far-edit"}} + {{/link-to}} + {{d-button + action=(route-action "destroyProduct") + actionParam=product + icon="trash-alt" + class="btn-danger btn no-text btn-icon" + }} +
+
{{else}}

- {{i18n 'discourse_subscriptions.admin.products.product_help'}} + {{i18n "discourse_subscriptions.admin.products.product_help"}}

{{/if}} {{/if}} diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.hbs index 8918d47..9e8d1a8 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show-plans-show.hbs @@ -1,20 +1,19 @@ - -

{{i18n 'discourse_subscriptions.admin.plans.title'}}

+

{{i18n "discourse_subscriptions.admin.plans.title"}}

- + {{input type="text" name="product_name" value=model.product.name disabled=true}}

- + {{input type="text" name="name" value=model.plan.nickname}}

- {{i18n 'discourse_subscriptions.admin.plans.plan.nickname_help'}} + {{i18n "discourse_subscriptions.admin.plans.plan.nickname_help"}}

- + {{combo-box valueProperty="name" content=availableGroups @@ -22,11 +21,11 @@ onChange=(action (mut model.plan.metadata.group_name)) }}

- {{i18n 'discourse_subscriptions.admin.plans.plan.group_help'}} + {{i18n "discourse_subscriptions.admin.plans.plan.group_help"}}

- + {{#if planFieldDisabled}} {{input class="plan-amount plan-currency" disabled=true value=model.plan.currency}} {{else}} @@ -41,7 +40,7 @@

{{#if planFieldDisabled}} {{input @@ -55,14 +54,14 @@ type="checkbox" name="recurring" checked=model.plan.isRecurring - change=(action 'changeRecurring') + change=(action "changeRecurring") }} {{/if}}

{{#if model.plan.isRecurring}}

{{#if planFieldDisabled}} {{input disabled=true value=selectedInterval}} @@ -77,18 +76,18 @@

{{input type="text" name="trial" value=model.plan.trial_period_days}}

- {{i18n 'discourse_subscriptions.admin.plans.plan.trial_help'}} + {{i18n "discourse_subscriptions.admin.plans.plan.trial_help"}}

{{/if}}

{{input type="checkbox" name="active" checked=model.plan.active}}

@@ -98,16 +97,24 @@

- {{i18n 'discourse_subscriptions.admin.plans.operations.create_help'}} + {{i18n "discourse_subscriptions.admin.plans.operations.create_help"}}

- {{#if model.plan.isNew}} - {{d-button label="discourse_subscriptions.admin.plans.operations.create" action="createPlan" icon="plus" class="btn btn-primary"}} + {{d-button + label="discourse_subscriptions.admin.plans.operations.create" + action="createPlan" + icon="plus" + class="btn btn-primary" + }} {{else}} - {{d-button label="discourse_subscriptions.admin.plans.operations.update" action="updatePlan" icon="check" class="btn btn-primary"}} + {{d-button + label="discourse_subscriptions.admin.plans.operations.update" + action="updatePlan" + icon="check" + class="btn btn-primary" + }} {{/if}}
- diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.hbs index d15cf40..0806ff1 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products-show.hbs @@ -1,96 +1,107 @@ -

{{i18n 'discourse_subscriptions.admin.products.title'}}

+

{{i18n "discourse_subscriptions.admin.products.title"}}

- + {{input type="text" name="name" value=model.product.name}}

{{textarea name="description" value=model.product.metadata.description class="discourse-subscriptions-admin-textarea"}}

- {{i18n 'discourse_subscriptions.admin.products.product.description_help'}} + {{i18n "discourse_subscriptions.admin.products.product.description_help"}}

{{input type="text" name="statement_descriptor" value=model.product.statement_descriptor}}

- {{i18n 'discourse_subscriptions.admin.products.product.statement_descriptor_help'}} + {{i18n "discourse_subscriptions.admin.products.product.statement_descriptor_help"}}

- + {{input type="checkbox" name="repurchaseable" checked=model.product.metadata.repurchaseable}}

- {{i18n 'discourse_subscriptions.admin.products.product.repurchase_help'}} + {{i18n "discourse_subscriptions.admin.products.product.repurchase_help"}}

- + {{input type="checkbox" name="active" checked=model.product.active}}

- {{i18n 'discourse_subscriptions.admin.products.product.active_help'}} + {{i18n "discourse_subscriptions.admin.products.product.active_help"}}

{{#unless model.product.isNew}} -

{{i18n 'discourse_subscriptions.admin.plans.title'}}

+

{{i18n "discourse_subscriptions.admin.plans.title"}}

- - - - - - + + + + + + - {{#each model.plans as |plan|}} - - - - - - - - - - {{/each}} - - {{#unless model.plans}} - - - - {{/unless}} + + {{#each model.plans as |plan|}} + + + + + + + + + + {{else}} + + + + {{/each}} +
{{i18n 'discourse_subscriptions.admin.plans.plan.nickname'}}{{i18n 'discourse_subscriptions.admin.plans.plan.interval'}}{{i18n 'discourse_subscriptions.admin.plans.plan.created_at'}}{{i18n 'discourse_subscriptions.admin.plans.plan.group'}}{{i18n 'discourse_subscriptions.admin.plans.plan.active'}}{{i18n 'discourse_subscriptions.admin.plans.plan.amount'}}{{i18n "discourse_subscriptions.admin.plans.plan.nickname"}}{{i18n "discourse_subscriptions.admin.plans.plan.interval"}}{{i18n "discourse_subscriptions.admin.plans.plan.created_at"}}{{i18n "discourse_subscriptions.admin.plans.plan.group"}}{{i18n "discourse_subscriptions.admin.plans.plan.active"}}{{i18n "discourse_subscriptions.admin.plans.plan.amount"}} {{#link-to "adminPlugins.discourse-subscriptions.products.show.plans.show" model.product.id "new" class="btn"}} - {{i18n 'discourse_subscriptions.admin.plans.operations.add'}} + {{i18n "discourse_subscriptions.admin.plans.operations.add"}} {{/link-to}}
{{plan.nickname}}{{plan.recurring.interval}}{{format-unix-date plan.created}}{{plan.metadata.group_name}}{{plan.active}}{{format-currency plan.currency plan.amountDollars}} - {{#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}} -
-
- {{i18n 'discourse_subscriptions.admin.products.product.plan_help'}} -
{{plan.nickname}}{{plan.recurring.interval}}{{format-unix-date plan.created}}{{plan.metadata.group_name}}{{plan.active}}{{format-currency plan.currency plan.amountDollars}} + {{#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}} +
+
+ {{i18n "discourse_subscriptions.admin.products.product.plan_help"}} +

{{/unless}}
{{d-button label="cancel" action=(action "cancelProduct") icon="times"}} + {{#if model.product.isNew}} - {{d-button label="discourse_subscriptions.admin.products.operations.create" action="createProduct" icon="plus" class="btn btn-primary"}} + {{d-button + label="discourse_subscriptions.admin.products.operations.create" + action="createProduct" + icon="plus" + class="btn btn-primary" + }} {{else}} - {{d-button label="discourse_subscriptions.admin.products.operations.update" action="updateProduct" icon="check" class="btn btn-primary"}} + {{d-button + label="discourse_subscriptions.admin.products.operations.update" + action="updateProduct" + icon="check" + class="btn btn-primary" + }} {{/if}}
diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.hbs index b1b1f40..c24cd68 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-products.hbs @@ -1,2 +1 @@ - {{outlet}} diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.hbs index 23d5c28..aa67105 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions-subscriptions.hbs @@ -1,46 +1,54 @@ {{#if model.unconfigured}} -

{{i18n 'discourse_subscriptions.admin.unconfigured'}}

-

{{i18n 'discourse_subscriptions.admin.on_meta'}}

+

{{i18n "discourse_subscriptions.admin.unconfigured"}}

+

{{i18n "discourse_subscriptions.admin.on_meta"}}

{{else}} {{#load-more selector=".discourse-patrons-table tr" action=(action "loadMore")}} - - - - - - - + + + + + + + - {{#each model.data as |subscription|}} - - - - - - - - - - - {{/each}} + + {{#each model.data as |subscription|}} + + + + + + + + + + + {{/each}} +
{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.user'}}{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.subscription_id'}}{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.customer'}}{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.product'}}{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.plan'}}{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.status'}}{{i18n 'discourse_subscriptions.admin.subscriptions.subscription.created_at'}}{{i18n "discourse_subscriptions.admin.subscriptions.subscription.user"}}{{i18n "discourse_subscriptions.admin.subscriptions.subscription.subscription_id"}}{{i18n "discourse_subscriptions.admin.subscriptions.subscription.customer"}}{{i18n "discourse_subscriptions.admin.subscriptions.subscription.product"}}{{i18n "discourse_subscriptions.admin.subscriptions.subscription.plan"}}{{i18n "discourse_subscriptions.admin.subscriptions.subscription.status"}}{{i18n "discourse_subscriptions.admin.subscriptions.subscription.created_at"}}
- {{#if subscription.metadataUserExists}} - - {{subscription.metadata.username}} - - {{/if}} - {{subscription.id}}{{subscription.customer}}{{subscription.plan.product.name}}{{subscription.plan.nickname}}{{subscription.status}}{{format-unix-date subscription.created}} - {{#if subscription.loading}} - {{loading-spinner size="small"}} - {{else}} - {{d-button disabled=subscription.canceled label="cancel" action=(action "showCancelModal" subscription) icon="times"}} - {{/if}} -
+ {{#if subscription.metadataUserExists}} + + {{subscription.metadata.username}} + + {{/if}} + {{subscription.id}}{{subscription.customer}}{{subscription.plan.product.name}}{{subscription.plan.nickname}}{{subscription.status}}{{format-unix-date subscription.created}} + {{#if subscription.loading}} + {{loading-spinner size="small"}} + {{else}} + {{d-button + disabled=subscription.canceled + label="cancel" + action=(action "showCancelModal" subscription) + icon="times" + }} + {{/if}} +
{{/load-more}} + {{conditional-loading-spinner condition=loading}} {{/if}} diff --git a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs index c5a04ee..230d4a5 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-discourse-subscriptions.hbs @@ -1,5 +1,4 @@ - -

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

+

{{i18n "discourse_subscriptions.title" site_name=siteSettings.title}}

{{#if stripeConfigured}}
@@ -7,14 +6,14 @@ {{d-button label="discourse_subscriptions.campaign.refresh_campaign" icon="sync-alt" - action=(action 'triggerManualRefresh') + action=(action "triggerManualRefresh") }} {{else}} {{#unless campaignProductSet}} {{d-button label="discourse_subscriptions.campaign.one_click_campaign" icon="plus-square" - action=(action 'createOneClickCampaign') + action=(action "createOneClickCampaign") isLoading=loading }} {{/unless}} @@ -22,9 +21,9 @@

@@ -33,6 +32,6 @@ {{outlet}} {{else}} -

{{i18n 'discourse_subscriptions.admin.unconfigured'}}

-

{{i18n 'discourse_subscriptions.admin.on_meta'}}

+

{{i18n "discourse_subscriptions.admin.unconfigured"}}

+

{{i18n "discourse_subscriptions.admin.on_meta"}}

{{/if}} diff --git a/assets/javascripts/discourse/templates/components/campaign-banner.hbs b/assets/javascripts/discourse/templates/components/campaign-banner.hbs index 9c1a4b8..1807103 100644 --- a/assets/javascripts/discourse/templates/components/campaign-banner.hbs +++ b/assets/javascripts/discourse/templates/components/campaign-banner.hbs @@ -1,85 +1,85 @@ {{#if shouldShow}} -
+
{{d-button icon="times" action="dismissBanner" class="close" }} -
+
{{#if isGoalMet}} -

{{i18n 'discourse_subscriptions.campaign.success_title'}}

-

{{i18n 'discourse_subscriptions.campaign.success_body'}}

+

{{i18n "discourse_subscriptions.campaign.success_title"}}

+

{{i18n "discourse_subscriptions.campaign.success_body"}}

{{else}} -

{{i18n 'discourse_subscriptions.campaign.title'}}

-

{{i18n 'discourse_subscriptions.campaign.body'}}

+

{{i18n "discourse_subscriptions.campaign.title"}}

+

{{i18n "discourse_subscriptions.campaign.body"}}

+ {{#if product}} {{#link-to "s.show" product disabled=product.subscribed class="btn btn-primary campaign-banner-info-button"}} - {{d-icon "far-heart"}} {{d-icon "heart" class="hover-heart"}} {{i18n 'discourse_subscriptions.campaign.button'}} + {{d-icon "far-heart"}} {{d-icon "heart" class="hover-heart"}} {{i18n "discourse_subscriptions.campaign.button"}} {{/link-to}} {{else}} {{#link-to "s" class="btn btn-primary campaign-banner-info-button"}} - {{d-icon "far-heart"}} {{d-icon "heart" class="hover-heart"}} {{i18n 'discourse_subscriptions.campaign.button'}} + {{d-icon "far-heart"}} {{d-icon "heart" class="hover-heart"}} {{i18n "discourse_subscriptions.campaign.button"}} {{/link-to}} {{/if}} {{/if}}
+
{{#if isGoalMet}}
+
+ {{#if subscriberGoal}}

- {{html-safe (i18n 'discourse_subscriptions.campaign.goal_comparison' current=subscribers goal=goalTarget)}} - {{i18n 'discourse_subscriptions.campaign.subscribers'}} + {{html-safe (i18n "discourse_subscriptions.campaign.goal_comparison" current=subscribers goal=goalTarget)}} + {{i18n "discourse_subscriptions.campaign.subscribers"}}

{{else}}

- {{html-safe (i18n 'discourse_subscriptions.campaign.goal_comparison' current=(format-currency currency amountRaised) goal=(format-currency currency goalTarget))}} - {{i18n 'discourse_subscriptions.campaign.raised'}} + {{html-safe (i18n "discourse_subscriptions.campaign.goal_comparison" current=(format-currency currency amountRaised) goal=(format-currency currency goalTarget))}} + {{i18n "discourse_subscriptions.campaign.raised"}}

- {{#if showContributors}} - {{#conditional-loading-spinner condition=loading size="small"}} -
-

- {{i18n 'discourse_subscriptions.campaign.recent_contributors'}} -

-
- {{#each contributors as |contributor|}} - {{avatar contributor avatarTemplatePath="avatar_template" usernamePath="username" namePath="name" imageSize="small"}} - {{/each}} -
+ {{#if showContributors}} + {{#conditional-loading-spinner condition=loading size="small"}} +
+

+ {{i18n "discourse_subscriptions.campaign.recent_contributors"}} +

+ +
+ {{#each contributors as |contributor|}} + {{avatar contributor avatarTemplatePath="avatar_template" usernamePath="username" namePath="name" imageSize="small"}} + {{/each}}
- {{/conditional-loading-spinner}} - {{/if}} +
+ {{/conditional-loading-spinner}} + {{/if}} {{/if}} {{else}} {{#if subscriberGoal}} - +

- {{i18n 'discourse_subscriptions.campaign.goal_comparison' current=subscribers goal=goalTarget}} - {{i18n 'discourse_subscriptions.campaign.subscribers'}} + {{i18n "discourse_subscriptions.campaign.goal_comparison" current=subscribers goal=goalTarget}} + {{i18n "discourse_subscriptions.campaign.subscribers"}}

{{else}} - +

- {{html-safe (i18n 'discourse_subscriptions.campaign.goal_comparison' current=(format-currency currency amountRaised) goal=(format-currency currency goalTarget))}} - {{i18n 'discourse_subscriptions.campaign.raised'}} + {{html-safe (i18n "discourse_subscriptions.campaign.goal_comparison" current=(format-currency currency amountRaised) goal=(format-currency currency goalTarget))}} + {{i18n "discourse_subscriptions.campaign.raised"}}

{{/if}} + {{#if showContributors}} {{#conditional-loading-spinner condition=loading size="small"}}

- {{i18n 'discourse_subscriptions.campaign.recent_contributors'}} + {{i18n "discourse_subscriptions.campaign.recent_contributors"}}

{{#each contributors as |contributor|}} diff --git a/assets/javascripts/discourse/templates/components/create-coupon-form.hbs b/assets/javascripts/discourse/templates/components/create-coupon-form.hbs index 72aa197..5bb1ce1 100644 --- a/assets/javascripts/discourse/templates/components/create-coupon-form.hbs +++ b/assets/javascripts/discourse/templates/components/create-coupon-form.hbs @@ -1,11 +1,11 @@ -
+

- + {{input type="text" name="promo_code" value=promoCode}}

- + {{combo-box content=discountTypes value=discountType @@ -15,7 +15,7 @@

{{input type="checkbox" name="active" checked=active}}

diff --git a/assets/javascripts/discourse/templates/components/login-required.hbs b/assets/javascripts/discourse/templates/components/login-required.hbs index 6358ebc..bab68fc 100644 --- a/assets/javascripts/discourse/templates/components/login-required.hbs +++ b/assets/javascripts/discourse/templates/components/login-required.hbs @@ -1,2 +1,2 @@ -

{{i18n 'discourse_subscriptions.subscribe.unauthenticated'}}

+

{{i18n "discourse_subscriptions.subscribe.unauthenticated"}}

{{d-button label="log_in" action="createAccount" icon="user" class="btn btn-primary"}} diff --git a/assets/javascripts/discourse/templates/components/product-item.hbs b/assets/javascripts/discourse/templates/components/product-item.hbs index 7db9db4..4ef4300 100644 --- a/assets/javascripts/discourse/templates/components/product-item.hbs +++ b/assets/javascripts/discourse/templates/components/product-item.hbs @@ -8,22 +8,22 @@
{{#if product.repurchaseable}} {{#link-to "s.show" product.id class="btn btn-primary"}} - {{i18n 'discourse_subscriptions.subscribe.title'}} + {{i18n "discourse_subscriptions.subscribe.title"}} {{/link-to}} {{#if product.subscribed}} {{#link-to "user.billing.subscriptions" currentUser.username class="billing-link"}} - {{i18n 'discourse_subscriptions.subscribe.view_past'}} + {{i18n "discourse_subscriptions.subscribe.view_past"}} {{/link-to}} {{/if}} {{else}} {{#if product.subscribed}} - ✓ {{i18n 'discourse_subscriptions.subscribe.purchased'}} + ✓ {{i18n "discourse_subscriptions.subscribe.purchased"}} {{#link-to "user.billing.subscriptions" currentUser.username class="billing-link"}} - {{i18n 'discourse_subscriptions.subscribe.go_to_billing'}} + {{i18n "discourse_subscriptions.subscribe.go_to_billing"}} {{/link-to}} {{else}} {{#link-to "s.show" product.id disabled=product.subscribed class="btn btn-primary"}} - {{i18n 'discourse_subscriptions.subscribe.title'}} + {{i18n "discourse_subscriptions.subscribe.title"}} {{/link-to}} {{/if}} {{/if}} diff --git a/assets/javascripts/discourse/templates/components/product-list.hbs b/assets/javascripts/discourse/templates/components/product-list.hbs index e45fc36..a59295e 100644 --- a/assets/javascripts/discourse/templates/components/product-list.hbs +++ b/assets/javascripts/discourse/templates/components/product-list.hbs @@ -1,5 +1,5 @@ {{#if emptyProducts}} -

{{i18n 'discourse_subscriptions.subscribe.no_products'}}

+

{{i18n "discourse_subscriptions.subscribe.no_products"}}

{{else}} {{#each products as |product|}} {{product-item product=product isLoggedIn=isLoggedIn}} diff --git a/assets/javascripts/discourse/templates/components/subscribe-card.hbs b/assets/javascripts/discourse/templates/components/subscribe-card.hbs index f2afe6e..0d222cc 100644 --- a/assets/javascripts/discourse/templates/components/subscribe-card.hbs +++ b/assets/javascripts/discourse/templates/components/subscribe-card.hbs @@ -1,2 +1 @@ -
diff --git a/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs b/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs index 488aa1a..869c25e 100644 --- a/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs +++ b/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs @@ -1 +1 @@ -{{campaign-banner connectorName='above-main-container'}} +{{campaign-banner connectorName="above-main-container"}} diff --git a/assets/javascripts/discourse/templates/connectors/after-topic-footer-buttons/subscriptions-campaign-topic-footer.hbs b/assets/javascripts/discourse/templates/connectors/after-topic-footer-buttons/subscriptions-campaign-topic-footer.hbs index 6ec542f..ff38907 100644 --- a/assets/javascripts/discourse/templates/connectors/after-topic-footer-buttons/subscriptions-campaign-topic-footer.hbs +++ b/assets/javascripts/discourse/templates/connectors/after-topic-footer-buttons/subscriptions-campaign-topic-footer.hbs @@ -1 +1 @@ -{{campaign-banner connectorName='after-topic-footer-buttons'}} \ No newline at end of file +{{campaign-banner connectorName="after-topic-footer-buttons"}} diff --git a/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs b/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs index 0366ea5..d6514cf 100644 --- a/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs +++ b/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs @@ -1 +1 @@ -{{campaign-banner connectorName='before-topic-list'}} +{{campaign-banner connectorName="before-topic-list"}} diff --git a/assets/javascripts/discourse/templates/connectors/user-main-nav/billing.hbs b/assets/javascripts/discourse/templates/connectors/user-main-nav/billing.hbs index 2665898..ff8629e 100644 --- a/assets/javascripts/discourse/templates/connectors/user-main-nav/billing.hbs +++ b/assets/javascripts/discourse/templates/connectors/user-main-nav/billing.hbs @@ -1,3 +1,3 @@ {{#if (user-viewing-self model)}} - {{#link-to 'user.billing'}}{{d-icon "far-credit-card"}}{{I18n 'discourse_subscriptions.navigation.billing'}}{{/link-to}} + {{#link-to "user.billing"}}{{d-icon "far-credit-card"}}{{I18n "discourse_subscriptions.navigation.billing"}}{{/link-to}} {{/if}} diff --git a/assets/javascripts/discourse/templates/modal/admin-cancel-subscription.hbs b/assets/javascripts/discourse/templates/modal/admin-cancel-subscription.hbs index 0f114c3..e2f602c 100644 --- a/assets/javascripts/discourse/templates/modal/admin-cancel-subscription.hbs +++ b/assets/javascripts/discourse/templates/modal/admin-cancel-subscription.hbs @@ -4,7 +4,6 @@ {{i18n "discourse_subscriptions.admin.ask_refund"}} {{/d-modal-body}} -