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}}{{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"}} | - {{#each model as |coupon|}} -
---|---|---|---|---|
{{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" + }} + | +
{{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}} | +
{{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"}} | - {{#each model as |plan|}} - |
---|---|---|---|---|
{{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" + }} + | +
{{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}}{{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"}} | - {{#each model as |product|}} - |
---|---|---|---|---|
{{product.name}} | -{{format-unix-date product.created}} | -{{format-unix-date product.updated}} | -{{product.active}} | -- | - -
{{product.name}} | +{{format-unix-date product.created}} | +{{format-unix-date product.updated}} | +{{product.active}} | ++ | + +
- {{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.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}} | - {{#each model.plans as |plan|}} -
---|---|---|---|---|---|---|---|
{{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"}} + |
+
{{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")}}{{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}} + | +
{{i18n 'discourse_subscriptions.admin.unconfigured'}}
-{{i18n 'discourse_subscriptions.admin.on_meta'}}
+{{i18n "discourse_subscriptions.admin.unconfigured"}}
+ {{/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}} -