diff --git a/assets/javascripts/discourse/components/wizard-subscription-authorize.js b/assets/javascripts/discourse/components/wizard-subscription-authorize.js
new file mode 100644
index 00000000..4422288c
--- /dev/null
+++ b/assets/javascripts/discourse/components/wizard-subscription-authorize.js
@@ -0,0 +1,24 @@
+// import { geoLocationSearch, providerDetails } from "../lib/location-utilities";
+//import { ajax } from "discourse/lib/ajax";
+import { action, set } from "@ember/object";
+// import { equal } from "@ember/object/computed";
+// import { A } from "@ember/array";
+import { inject as service } from "@ember/service";
+import Component from "@glimmer/component";
+import { tracked } from "@glimmer/tracking";
+// import I18n from "I18n";
+
+export default class WizardSubscriptionAuthorize extends Component {
+ @service siteSettings;
+ @tracked supplierId = 1;
+
+ constructor() {
+ super(...arguments);
+
+ }
+
+ @action
+ authorize() {
+ window.location.href = `${basePath}/authorize?supplier_id=${this.supplierId}`;
+ }
+}
diff --git a/assets/javascripts/discourse/templates/admin-wizards.hbs b/assets/javascripts/discourse/templates/admin-wizards.hbs
index 452193b1..6d6bad5b 100644
--- a/assets/javascripts/discourse/templates/admin-wizards.hbs
+++ b/assets/javascripts/discourse/templates/admin-wizards.hbs
@@ -18,6 +18,7 @@
}}
+ {{wizard-subscription-authorize}}
{{wizard-subscription-badge}}
{{wizard-subscription-cta}}
diff --git a/assets/javascripts/discourse/templates/components/wizard-subscription-authorize.hbs b/assets/javascripts/discourse/templates/components/wizard-subscription-authorize.hbs
new file mode 100644
index 00000000..996f8865
--- /dev/null
+++ b/assets/javascripts/discourse/templates/components/wizard-subscription-authorize.hbs
@@ -0,0 +1,15 @@
+
+ {{#if authorized}}
+ {{conditional-loading-spinner size="small" condition=unauthorizing}}
+
+ {{i18n "admin.wizard.subscription.deauthorize"}}
+
+ {{else}}
+ {{d-button
+ icon="id-card"
+ class="btn-primary"
+ label="admin.wizard.subscription.authorize"
+ title="admin.wizard.subscription.authorize"
+ action=(action "authorize")}}
+ {{/if}}
+
\ No newline at end of file
diff --git a/assets/stylesheets/common/admin.scss b/assets/stylesheets/common/admin.scss
index 6a1601d9..6b91a173 100644
--- a/assets/stylesheets/common/admin.scss
+++ b/assets/stylesheets/common/admin.scss
@@ -49,6 +49,10 @@ $error: #ef1700;
.btn-pavilion-support {
margin-left: 10px;
}
+
+ .supplier-authorize .btn-primary {
+ margin-right: 10px;
+ }
}
.wizard-message {
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 98519335..996951a8 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -545,6 +545,8 @@ en:
subscription:
title: Subscriber Features
+ authorize: "Authorize Subscription"
+ deauthorize: "De-authorize Subscription"
subscribed:
label: Subscribed
title: You're subscribed and can use these features
diff --git a/plugin.rb b/plugin.rb
index 756154bb..cf6bc714 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -8,6 +8,8 @@
# subscription_url: https://coop.pavilion.tech
gem 'liquid', '5.0.1', require: true
+gem "discourse_subscription_client", "0.1.0.pre14", require_name: "discourse_subscription_client"
+
register_asset 'stylesheets/common/admin.scss'
register_asset 'stylesheets/common/wizard.scss'