2021-01-28 18:25:21 +03:00
<div class="flex flex-column mb5">
<section class="flex flex-column br3 shadow-1 bg-grouped-table pa5">
2020-05-20 17:24:43 +03:00
{{ # if this .stripeDirect }}
2020-10-22 13:39:00 +03:00
<div class="gh-setting-first">
<div class="gh-setting-content">
2020-05-20 17:24:43 +03:00
<h4 class="gh-setting-title">Connect to Stripe</h4>
<p class="gh-setting-desc pa0 ma0">Configure API keys to create subscriptions and take payments</p>
</div>
2020-10-22 13:39:00 +03:00
<div class="gh-setting-action">
2020-05-20 17:24:43 +03:00
<button type="button" class="gh-btn" {{ action ( toggle "membersStripeOpen" this ) }} data-test-toggle-membersstripe><span> {{ if this .membersStripeOpen "Close" "Expand" }} </span></button>
</div>
2019-10-11 11:20:30 +03:00
</div>
2019-10-09 13:02:56 +03:00
2020-05-20 17:24:43 +03:00
{{ # liquid-if this .membersStripeOpen }}
<div class="flex flex-column flex-row-l items-start justify-between mb4 mt6">
<div class="w-100 w-50-l">
<div class="mb4">
<label class="fw6 f8">Stripe Publishable key</label>
<GhTextInput
@type="password"
2020-06-29 20:37:11 +03:00
@value= {{ readonly this .stripeDirectPublicKey }}
@input= {{ action "setStripeDirectPublicKey" }}
2020-05-20 17:24:43 +03:00
@class="mt1 password"
/>
</div>
<div class="nudge-top--3">
<label class="fw6 f8 mt4">Stripe Secret key</label>
<GhTextInput
@type="password"
2020-06-29 20:37:11 +03:00
@value= {{ readonly this .stripeDirectSecretKey }}
@input= {{ action "setStripeDirectSecretKey" }}
2020-05-20 17:24:43 +03:00
@class="mt1 password"
/>
<a href="https://dashboard.stripe.com/account/apikeys" target="_blank" class="mt1 fw4 f8">
Find your Stripe API keys here »
</a>
</div>
2019-10-16 20:54:49 +03:00
</div>
2020-05-20 17:24:43 +03:00
<div class="ml0 ml5-l mt6">
<div class="gh-members-stripe-info">
<div class="gh-members-stripe-info-header">
<h4>How you get paid</h4>
{{ svg-jar "stripe-verified-partner-badge" class = "gh-members-stripe-badge" }}
</div>
<p class="f8 mt2 mb0">
Stripe is our exclusive direct payments partner.<br />
Ghost collects <strong>no fees</strong> on any payments! If you don’ t have a Stripe account yet, you can <a href="https://stripe.com" target="_blank" rel="noopener" class="gh-members-stripe-link">sign up here</a>.
</p>
2019-10-16 20:54:49 +03:00
</div>
</div>
2019-10-09 13:02:56 +03:00
</div>
2020-05-20 17:24:43 +03:00
{{ / liquid-if }}
2020-06-02 14:58:43 +03:00
{{ else }}
2020-10-22 13:39:00 +03:00
<div class="gh-setting-first">
<div class="gh-setting-content">
2020-06-02 14:58:43 +03:00
<h4 class="gh-setting-title">Connect to Stripe</h4>
2020-06-30 12:50:43 +03:00
{{ # if this .stripeConnectAccountId }}
2020-07-17 20:07:20 +03:00
{{ # if this .hasActiveStripeSubscriptions }}
<p class="red ma0 pa0 f8 nudge-bottom--2">
Cannot disconnect while there are members with active Stripe subscriptions.
</p>
{{ else }}
2020-06-11 16:36:22 +03:00
<p class="gh-setting-desc pa0 ma0">
2020-06-15 19:43:02 +03:00
{{ # if this .stripeConnectSuccess }}
2020-06-29 20:37:11 +03:00
{{ svg-jar "check-circle" class = "stroke-green w4 h4 nudge-top--3" }} <span class="green-d1">Successfully connected to {{ this .stripeConnectAccountName }} </span>
2020-06-11 17:55:26 +03:00
{{ else }}
2020-06-29 20:37:11 +03:00
Connected to <a href="https://dashboard.stripe.com/ {{ this .stripeConnectAccountId }} " target="_blank"> {{ this .stripeConnectAccountName }} </a>
2020-06-11 17:55:26 +03:00
{{ / if }}
2020-06-15 19:43:02 +03:00
2020-06-29 20:37:11 +03:00
{{ # unless this .stripeConnectLivemode }}
2020-06-11 16:36:22 +03:00
<span class="gh-members-connect-testmodelabel">Test mode</span>
{{ / unless }}
</p>
2020-06-23 14:29:12 +03:00
{{ / if }}
2020-06-11 16:15:44 +03:00
{{ else }}
<p class="gh-setting-desc pa0 ma0">Connect to Stripe to create subscriptions and take payments</p>
{{ / if }}
2020-06-02 14:58:43 +03:00
</div>
2020-10-22 13:39:00 +03:00
<div class="gh-setting-action">
2020-06-30 12:50:43 +03:00
{{ # if this .stripeConnectAccountId }}
2020-06-23 14:29:12 +03:00
<button type="button" class="gh-btn" {{ action "openDisconnectStripeModal" }} ><span>Disconnect</span></button>
{{ else }}
<button type="button" class="gh-btn" {{ action ( toggle "membersStripeOpen" this ) }} data-test-toggle-membersstripe><span> {{ if this .membersStripeOpen "Close" "Expand" }} </span></button>
{{ / if }}
2020-06-02 14:58:43 +03:00
</div>
</div>
{{ # liquid-if this .membersStripeOpen }}
2020-10-22 13:39:00 +03:00
<div class="mt2">
2020-06-11 16:15:44 +03:00
<div class="flex flex-column flex-row-l items-start justify-between">
<div class="w-100 w-50-l">
<label class="fw6 f8">Generate secure key</label>
<div class="flex items-center mb4 justify-between gh-members-connectbutton-container mt2">
<a href=" {{ if this .stripeConnectTestMode this .testStripeConnectAuthUrl this .liveStripeConnectAuthUrl }} " class="stripe-connect light-blue" target="_blank"><span>Connect with Stripe</span></a>
<div class="ml2 flex items-center flex-nowrap">
<span class="mr2 f8 midgrey nowrap {{ if this .stripeConnectTestMode "gh-members-connect-testmodeon" }} "> {{ if this .stripeConnectTestMode "Using" "Use" }} test mode</span>
<div class="for-switch small">
<label class="switch" for="stripe-connect-test-mode" {{ action ( toggle "stripeConnectTestMode" this ) bubbles = "false" }} >
<input type="checkbox" class="gh-input" checked= {{ this .stripeConnectTestMode }} onclick= {{ action ( toggle "stripeConnectTestMode" this ) }} data-test-checkbox="stripe-connect-test-mode">
<span class="input-toggle-component mt1"></span>
</label>
</div>
</div>
</div>
<div class="nudge-top--3">
2020-06-15 19:43:02 +03:00
<GhTextarea
2020-06-11 16:15:44 +03:00
@class="gh-members-stripe-connect-token"
@placeholder="Paste your secure key here"
2020-06-29 20:37:11 +03:00
@input= {{ action "setStripeConnectIntegrationToken" }}
2020-06-11 16:15:44 +03:00
/>
{{ # if this .stripeConnectError }} <p class="mb0 mt2 f8 red"> {{ this .stripeConnectError }} </p> {{ / if }}
</div>
2020-06-02 14:58:43 +03:00
</div>
2020-06-11 16:15:44 +03:00
<div class="mt5 mt5-m mt8-l ml0 ml5-l">
<div class="gh-members-stripe-info">
<div class="gh-members-stripe-info-header">
<h4>How you get paid</h4>
{{ svg-jar "stripe-verified-partner-badge" class = "gh-members-stripe-badge" }}
</div>
<p class="f8 mt2 mb0">
Stripe is our exclusive direct payments partner.<br />
Ghost collects <strong>no fees</strong> on any payments! If you don’ t have a Stripe account yet, you can <a href="https://stripe.com" target="_blank" rel="noopener" class="gh-members-stripe-link">sign up here</a>.
</p>
2020-06-02 14:58:43 +03:00
</div>
</div>
</div>
2020-06-15 18:55:16 +03:00
2020-06-15 19:43:02 +03:00
<div class="gh-members-connect-savecontainer {{ if this .settings .stripeConnectIntegrationToken "expanded" }} ">
2020-06-15 18:55:16 +03:00
<GhTaskButton @buttonText="Save Stripe settings"
2020-06-11 16:15:44 +03:00
@task= {{ this .saveStripeSettings }}
@successText="Saved"
2020-06-15 19:43:02 +03:00
@disabled= {{ is-empty this .settings .stripeConnectIntegrationToken }}
2020-06-11 16:15:44 +03:00
@runningText="Saving"
2020-06-15 18:55:16 +03:00
@class="gh-btn gh-btn-blue gh-btn-icon"
2020-06-11 16:15:44 +03:00
/>
2020-06-15 18:55:16 +03:00
</div>
2020-06-02 14:58:43 +03:00
</div>
{{ / liquid-if }}
2020-05-20 17:24:43 +03:00
{{ / if }}
2020-08-25 15:05:45 +03:00
2020-10-22 13:39:00 +03:00
<div class="gh-setting-last">
<div class="gh-setting-content">
2019-10-16 11:27:46 +03:00
<h4 class="gh-setting-title">Subscription pricing</h4>
<p class="gh-setting-desc pa0 ma0">Set monthly and yearly recurring subscription prices</p>
2019-10-11 11:20:30 +03:00
</div>
2020-10-22 13:39:00 +03:00
<div class="gh-setting-action">
2019-12-13 17:20:29 +03:00
<button type="button" class="gh-btn" {{ action ( toggle "membersPricingOpen" this ) }} data-test-toggle-memberspricing><span> {{ if this .membersPricingOpen "Close" "Expand" }} </span></button>
2019-10-09 13:02:56 +03:00
</div>
</div>
2019-10-16 11:27:46 +03:00
2019-12-13 17:20:29 +03:00
{{ # liquid-if this .membersPricingOpen }}
2019-10-21 14:09:56 +03:00
<div class="w-100 w-50-l flex flex-column flex-row-ns mt8">
2020-03-04 08:31:39 +03:00
<div class="w-100">
<GhFormGroup @class="for-select">
<label class="fw6 f8"for="currency">Plan currency</label>
<span class="gh-select mt1">
{{ one-way-select this .selectedCurrency
id="currency"
name="currency"
options=(readonly this.currencies)
optionValuePath="value"
optionLabelPath="label"
2020-06-29 20:37:11 +03:00
update=(action "setStripePlansCurrency")
2020-03-04 08:31:39 +03:00
}}
{{ svg-jar "arrow-down-small" }}
</span>
</GhFormGroup>
</div>
</div>
<div class="w-100 w-50-l flex flex-column flex-row-ns">
2019-10-21 14:09:56 +03:00
<div class="w-100 w-50-ns mr3-ns">
2020-07-03 11:36:59 +03:00
<GhFormGroup @errors= {{ this .settings .errors }} @hasValidated= {{ settings .hasValidated }} @property="stripePlans">
2019-10-11 11:20:30 +03:00
<label class="fw6 f8">Monthly price</label>
2019-10-16 22:35:06 +03:00
<div class="flex items-center justify-center mt1 gh-input-group gh-labs-price-label">
2020-01-16 18:14:03 +03:00
<GhTextInput
2020-06-29 20:37:11 +03:00
@value= {{ readonly this .stripePlans .monthly .amount }}
2020-01-16 18:14:03 +03:00
@type="number"
2020-07-03 11:36:59 +03:00
@input= {{ action ( mut this ._scratchStripeMonthlyAmount ) value = "target.value" }}
@focus-out= {{ action "validateStripePlans" }}
2020-01-16 18:14:03 +03:00
/>
2020-06-29 20:37:11 +03:00
<span class="gh-input-append"><span class="ttu"> {{ this .stripePlans .monthly .currency }} </span>/month</span>
2019-10-11 11:20:30 +03:00
</div>
2020-01-16 18:14:03 +03:00
</GhFormGroup>
2019-10-11 11:20:30 +03:00
</div>
2019-10-21 14:09:56 +03:00
<div class="w-100 w-50-ns ml2-ns">
2020-07-03 11:36:59 +03:00
<GhFormGroup @errors= {{ this .settings .errors }} @hasValidated= {{ settings .hasValidated }} @property="stripePlans">
2019-10-11 11:20:30 +03:00
<label class="fw6 f8">Yearly price</label>
2019-10-16 22:35:06 +03:00
<div class="flex items-center justify-center mt1 gh-input-group gh-labs-price-label">
2020-01-16 18:14:03 +03:00
<GhTextInput
2020-06-29 20:37:11 +03:00
@value= {{ readonly this .stripePlans .yearly .amount }}
2020-01-16 18:14:03 +03:00
@type="number"
2020-07-03 11:36:59 +03:00
@input= {{ action ( mut this ._scratchStripeYearlyAmount ) value = "target.value" }}
@focus-out= {{ action "validateStripePlans" }}
2020-01-16 18:14:03 +03:00
/>
2020-06-29 20:37:11 +03:00
<span class="gh-input-append"><span class="ttu"> {{ this .stripePlans .yearly .currency }} </span>/year</span>
2019-10-11 11:20:30 +03:00
</div>
2020-01-16 18:14:03 +03:00
</GhFormGroup>
2019-10-11 11:20:30 +03:00
</div>
</div>
2020-07-03 11:36:59 +03:00
<div class="w-100 w-50-l flex flex-column flex-row-ns">
<GhErrorMessage @errors= {{ settings .errors }} @property="stripePlans" class="w-100 red"/>
</div>
2019-10-11 11:20:30 +03:00
{{ / liquid-if }}
2019-10-09 13:02:56 +03:00
</section>
2020-10-22 13:39:00 +03:00
<div class="gh-setting-header">Access</div>
<section class="flex flex-column br3 shadow-1 bg-grouped-table mt1 pa5">
<div class="gh-setting-first">
<div class="gh-setting-content">
2019-10-16 11:27:46 +03:00
<h4 class="gh-setting-title">Allow free member signup</h4>
<p class="gh-setting-desc pa0 ma0">If disabled, members can only be signed up via payment checkout or API integration</p>
2019-10-11 11:20:30 +03:00
</div>
2020-10-22 13:39:00 +03:00
<div class="gh-setting-action">
2019-10-11 11:20:30 +03:00
<div class="for-switch">
2020-06-29 20:37:11 +03:00
<label class="switch" for="members-allow-self-signup" {{ action "toggleSelfSignup" bubbles = "false" }} >
<input type="checkbox" checked= {{ this .allowSelfSignup }} class="gh-input" onclick= {{ action "toggleSelfSignup" }} data-test-checkbox="members-allow-self-signup">
2019-10-11 11:20:30 +03:00
<span class="input-toggle-component mt1"></span>
</label>
</div>
2019-10-09 13:02:56 +03:00
</div>
</div>
2020-10-22 13:39:00 +03:00
<div class="gh-setting-last">
<div class="gh-setting-content">
2019-10-11 11:20:30 +03:00
<h4 class="gh-setting-title">Default post access</h4>
2019-10-16 11:27:46 +03:00
<p class="gh-setting-desc pa0 ma0">When a new post is created, who should have access to it?</p>
2019-10-11 11:20:30 +03:00
</div>
2020-10-22 13:39:00 +03:00
<div class="gh-setting-action">
2019-12-13 17:20:29 +03:00
<button type="button" class="gh-btn" {{ action ( toggle "membersPostAccessOpen" this ) }} data-test-toggle-memberspostaccess><span> {{ if this .membersPostAccessOpen "Close" "Expand" }} </span></button>
2019-10-09 13:02:56 +03:00
</div>
</div>
2019-10-16 11:27:46 +03:00
2019-12-13 17:20:29 +03:00
{{ # liquid-if this .membersPostAccessOpen }}
2019-10-16 11:27:46 +03:00
<div class="flex flex-column w-50 flex mt8">
2019-10-11 11:20:30 +03:00
<div class="gh-radio {{ if ( eq settings .defaultContentVisibility "public" ) "active" }} "
{{ action "setDefaultContentVisibility" "public" on = "click" }} >
<div class="gh-radio-button" data-test-publishmenu-unpublished-option></div>
<div class="gh-radio-content">
2019-10-16 11:27:46 +03:00
<div class="gh-radio-label">Public<br>
<small class="midgrey">All site visitors to your site, no login required</small></div>
2019-10-11 11:20:30 +03:00
</div>
</div>
2019-10-16 11:27:46 +03:00
2019-10-11 11:20:30 +03:00
<div class="gh-radio {{ if ( eq settings .defaultContentVisibility "members" ) "active" }} "
{{ action "setDefaultContentVisibility" "members" on = "click" }} >
<div class="gh-radio-button" data-test-publishmenu-published-option></div>
<div class="gh-radio-content">
2019-10-16 11:27:46 +03:00
<div class="gh-radio-label">Members only<br>
<small class="midgrey">All logged-in members</small></div>
2019-10-11 11:20:30 +03:00
</div>
</div>
2019-10-16 11:27:46 +03:00
2019-10-11 11:20:30 +03:00
<div class="gh-radio {{ if ( eq settings .defaultContentVisibility "paid" ) "active" }} "
{{ action "setDefaultContentVisibility" "paid" on = "click" }} >
<div class="gh-radio-button" data-test-publishmenu-published-option></div>
<div class="gh-radio-content">
2019-10-16 11:27:46 +03:00
<div class="gh-radio-label">Paid-members only<br>
<small class="midgrey">Only logged-in members with an active Stripe subscription</small></div>
2019-10-11 11:20:30 +03:00
</div>
2019-10-09 13:02:56 +03:00
</div>
</div>
2019-10-11 11:20:30 +03:00
{{ / liquid-if }}
2019-10-09 13:02:56 +03:00
</section>
2020-06-19 19:06:49 +03:00
</div>
2020-06-23 14:29:12 +03:00
{{ # if this .showDisconnectStripeConnectModal }}
<GhFullscreenModal @modal="disconnect-stripe"
@model= {{ hash
2020-06-29 20:37:11 +03:00
stripeConnectAccountName=this.stripeConnectAccountName
2020-06-23 14:29:12 +03:00
}}
@confirm= {{ action "disconnectStripeConnectIntegration" }}
@close= {{ action "closeDisconnectStripeModal" }}
@modifier="action wide" />
{{ / if }}
2020-09-24 09:46:18 +03:00
{{ # if this .showPortalSettings }}
<GhFullscreenModal @modal="portal-settings"
2020-10-22 13:39:00 +03:00
@model= {{ hash
openStripeSettings=(action "openStripeSettings")
}}
2020-09-24 09:46:18 +03:00
@close= {{ action "closePortalSettings" }}
2020-06-25 23:45:47 +03:00
@modifier="full-overlay portal-settings" />
2020-07-03 11:36:59 +03:00
{{ / if }}
2020-11-12 17:45:22 +03:00
2020-07-30 13:56:07 +03:00
{{ # if this .showLeaveSettingsModal }}
<GhFullscreenModal @modal="leave-settings"
@confirm= {{ action "leavePortalSettings" }}
@close= {{ action "closeLeaveSettingsModal" }}
@modifier="action wide" />
2020-10-22 13:39:00 +03:00
{{ / if }}