2021-05-18 16:42:37 +03:00
<section class="gh-canvas gh-setting-members-canvas" {{ did-insert this .setup }} >
2021-05-17 14:35:31 +03:00
<GhCanvasHeader class="gh-canvas-header gh-setting-members-header">
2021-03-29 14:49:09 +03:00
<h2 class="gh-canvas-title" data-test-screen-title>
<LinkTo @route="settings">Settings</LinkTo>
<span> {{ svg-jar "arrow-right" }} </span>
2021-05-14 16:33:18 +03:00
Membership
2021-03-29 14:49:09 +03:00
</h2>
<section class="view-actions">
2021-04-14 21:02:36 +03:00
<GhTaskButton
2021-05-17 14:01:12 +03:00
@buttonText="Save"
2021-03-29 14:49:09 +03:00
@task= {{ this .saveSettingsTask }}
@successText="Saved"
@runningText="Saving"
@class="gh-btn gh-btn-primary gh-btn-icon"
data-test-button="save-settings"
/>
</section>
</GhCanvasHeader>
2021-05-17 10:58:15 +03:00
<section class="view-container settings-debug">
2021-05-17 14:01:12 +03:00
<div class="gh-setting-members-basics">
<div class="gh-setting-members-basicsform">
<p class="intro">Fund your work with subscription revenue. Connect your Stripe account and offer premium content to your audience. Our creators are already making over $2 million per year, while Ghost takes 0% payment fees.</p>
2021-05-18 12:09:42 +03:00
<hr>
<div>
<section class="gh-expandable gh-setting-members-portalcta">
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Portal Settings</h4>
<p class="gh-expandable-description">
Customize members modal signup flow
</p>
</div>
<button type="button" class="gh-btn gh-btn-green" {{ on "click" this .openPortalSettings }} data-test-toggle="portal-settings">
<span>Customise Portal →</span>
</button>
2021-05-17 14:01:12 +03:00
</div>
</div>
2021-05-18 12:09:42 +03:00
</section>
2021-05-17 14:40:08 +03:00
2021-05-18 12:09:42 +03:00
<div class="gh-setting-members-access">
2021-05-18 15:59:47 +03:00
<Settings::MembersSubscriptionAccess @onChange= {{ this .updatePortalPreview }} />
2021-05-18 12:09:42 +03:00
<Settings::MembersDefaultPostAccess />
</div>
2021-05-17 14:01:12 +03:00
</div>
2021-05-17 10:58:15 +03:00
</div>
2021-05-17 14:01:12 +03:00
<div class="gh-setting-members-portalpreview">
2021-05-17 14:35:31 +03:00
<div class="gh-setting-members-portal-mock">
2021-05-18 15:59:47 +03:00
{{ # if ( eq this .settings .membersSignupAccess 'none' ) }}
PORTAL DISABLED
{{ else }}
2021-05-18 18:36:18 +03:00
<GhSiteIframe
@src= {{ this .portalPreviewUrl }}
@invisibleUntilLoaded= {{ true }} />
2021-05-18 15:59:47 +03:00
{{ / if }}
2021-05-17 14:35:31 +03:00
</div>
2021-05-17 10:58:15 +03:00
</div>
</div>
2021-05-17 14:01:12 +03:00
<div class="gh-setting-members-tierscontainer">
<div class="gh-settings-members-tiersheader">
<h4 class="gh-main-section-header small bn">Membership tiers</h4>
2021-05-17 18:14:38 +03:00
<button type="button" class="gh-btn gh-btn-outline gh-btn-stripe-status {{ if this .settings .stripeConnectAccountId "connected" "" }} " {{ action ( toggle "showStripeConnect" this ) }} >
<span>
{{ if this .settings .stripeConnectAccountId "Connected to Stripe" "Stripe not connected" }}
</span>
2021-05-17 14:01:12 +03:00
</button>
</div>
<section class="gh-expandable">
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Free</h4>
<p class="gh-expandable-description">Free membership signup settings</p>
</div>
2021-05-17 14:40:08 +03:00
<button type="button" class="gh-btn" {{ on "click" ( toggle "freeOpen" this ) }} data-test-toggle-pub-info><span> {{ if this .freeOpen "Close" "Expand" }} </span></button>
2021-05-17 14:01:12 +03:00
</div>
<div class="gh-expandable-content">
{{ # liquid-if this .freeOpen }}
<div class="gh-setting-content-extended">
<GhFormGroup @errors= {{ this .settings .errors }} @hasValidated= {{ this .settings .hasValidated }} @property="free-welcome-page">
<label for="freeWelcomePage">Welcome page</label>
2021-05-17 17:29:07 +03:00
<GhUrlInput
2021-05-17 14:01:12 +03:00
@id="freeWelcomePage"
2021-05-17 17:29:07 +03:00
@value= {{ readonly this .settings .membersFreeSignupRedirect }}
@baseUrl= {{ readonly this .siteUrl }}
@setResult= {{ action "setFreeSignupRedirect" }}
@validateUrl= {{ action "validateFreeSignupRedirect" }}
@placeholder= {{ readonly this .siteUrl }}
/>
<GhErrorMessage
@errors= {{ settings .errors }}
@property="membersFreeSignupRedirect"
2021-05-17 14:01:12 +03:00
/>
<p>Redirect to this URL after signup for a free membership</p>
</GhFormGroup>
</div>
{{ / liquid-if }}
</div>
</div>
</section>
<section class="gh-expandable">
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Premium</h4>
<p class="gh-expandable-description">Customise prices and premium signup options</p>
</div>
2021-05-17 18:14:38 +03:00
{{ # if this .settings .stripeConnectAccountId }}
<button type="button" class="gh-btn" {{ action ( toggle "paidOpen" this ) }} data-test-toggle-pub-info><span> {{ if this .paidOpen "Close" "Expand" }} </span></button>
{{ else }}
<button type="button" class="stripe-connect" {{ action ( toggle "showStripeConnect" this ) }} >
<span>Connect with Stripe</span>
</button>
{{ / if }}
2021-05-17 14:01:12 +03:00
</div>
<div class="gh-expandable-content">
{{ # liquid-if this .paidOpen }}
<div class="gh-setting-content-extended">
2021-05-17 17:29:07 +03:00
{{ # if this .fetchDefaultProduct .isRunning }}
Loading...
{{ else }}
<GhFormGroup @errors= {{ this .settings .errors }} @hasValidated= {{ this .settings .hasValidated }} @property="prices">
<div class="gh-settings-members-pricelabelcont">
<label for="monthlyPrice">Prices</label>
<span>– </span>
<div>
2021-05-17 19:12:49 +03:00
<span class="gh-setting-members-currency gh-select">
<div class="gh-setting-members-currencylabel">
<span> {{ this .currency }} </span>
{{ svg-jar "arrow-down-small" }}
</div>
2021-05-17 17:29:07 +03:00
<OneWaySelect
@value= {{ this .selectedCurrency }}
id="currency"
name="currency"
@options= {{ readonly this .allCurrencies }}
@optionValuePath="value"
@optionLabelPath="label"
@update= {{ this .setStripePlansCurrency }}
/>
</span>
</div>
2021-05-17 14:01:12 +03:00
</div>
2021-05-17 17:29:07 +03:00
<div class="gh-setting-members-prices">
<div class="gh-input-group">
<GhTextInput
@id="monthlyPrice"
@value= {{ readonly this .stripeMonthlyAmount }}
@type="number"
@input= {{ action ( mut this .stripeMonthlyAmount ) value = "target.value" }}
@focus-out= {{ action "validateStripePlans" }}
/>
<span class="gh-input-append"><span class="ttu"> {{ this .currency }} </span>/month</span>
</div>
<div class="gh-input-group">
<GhTextInput
@id="yearlyPrice"
@value= {{ readonly this .stripeYearlyAmount }}
@type="number"
@input= {{ action ( mut this .stripeYearlyAmount ) value = "target.value" }}
@focus-out= {{ action "validateStripePlans" }}
@placeholder=''
data-test-title-input= {{ true }}
/>
<span class="gh-input-append"><span class="ttu"> {{ this .currency }} </span>/month</span>
</div>
2021-05-17 14:01:12 +03:00
</div>
2021-05-17 17:29:07 +03:00
{{ # if this .stripePlanError }}
<p class="response w-100 red"> {{ this .stripePlanError }} </p>
{{ / if }}
</GhFormGroup>
2021-05-17 14:01:12 +03:00
2021-05-17 17:29:07 +03:00
<GhFormGroup @errors= {{ this .settings .errors }} @hasValidated= {{ this .settings .hasValidated }} @property="paid-welcome-page">
<label for="paidWelcomePage">Welcome page</label>
<GhUrlInput
@value= {{ readonly this .settings .membersPaidSignupRedirect }}
@baseUrl= {{ readonly this .siteUrl }}
@setResult= {{ action "setPaidSignupRedirect" }}
@validateUrl= {{ action "validatePaidSignupRedirect" }}
@placeholder= {{ readonly this .siteUrl }}
/>
<GhErrorMessage
@errors= {{ settings .errors }}
@property="membersPaidSignupRedirect"
/>
<p>Redirect to this URL after signup for premium membership</p>
</GhFormGroup>
{{ / if }}
2021-05-17 14:01:12 +03:00
</div>
{{ / liquid-if }}
</div>
</div>
</section>
2021-05-14 16:33:18 +03:00
</div>
2021-03-29 14:49:09 +03:00
</section>
2021-05-17 14:40:08 +03:00
{{ # if this .showLeaveRouteModal }}
2021-03-29 14:49:09 +03:00
<GhFullscreenModal
@modal="leave-settings"
@confirm= {{ this .confirmLeave }}
@close= {{ this .cancelLeave }}
@modifier="action wide"
/>
{{ / if }}
2021-05-17 14:40:08 +03:00
2021-05-17 10:58:15 +03:00
{{ # if this .showPortalSettings }}
<GhFullscreenModal @modal="portal-settings"
@model= {{ hash
2021-05-17 14:40:08 +03:00
openStripeSettings=this.openStripeSettings
2021-05-17 10:58:15 +03:00
}}
2021-05-17 14:40:08 +03:00
@close= {{ this .closePortalSettings }}
2021-05-17 10:58:15 +03:00
@modifier="full-overlay portal-settings" />
{{ / if }}
2021-05-17 14:40:08 +03:00
{{ # if this .showLeavePortalModal }}
<GhFullscreenModal
@modal="leave-settings"
@confirm= {{ this .confirmClosePortalSettings }}
@close= {{ this .cancelClosePortalSettings }}
@modifier="action wide"
/>
{{ / if }}
2021-05-18 15:59:47 +03:00
2021-05-17 18:14:38 +03:00
{{ # if this .showStripeConnect }}
<GhFullscreenModal
@modal="stripe-connect"
@close= {{ action "closeStripeConnect" }}
@modifier="action wide stripe-connect {{ if this .settings .stripeConnectAccountId "stripe-connected" "" }} " />
{{ / if }}
2021-03-29 14:49:09 +03:00
</section>