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>
2021-05-25 12:09:13 +03:00
<button type="button" class="gh-btn gh-btn-green" disabled= {{ eq this .settings .membersSignupAccess "none" }} {{ on "click" this .openPortalSettings }} data-test-toggle="portal-settings">
2021-06-09 18:28:19 +03:00
<span>Customize Portal →</span>
2021-05-18 12:09:42 +03:00
</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-20 16:43:04 +03:00
<Settings::MembersSubscriptionAccess @onChange= {{ this .membersSubscriptionAccessChanged }} />
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-25 11:40:17 +03:00
{{ # if ( or ( eq this .settings .membersSignupAccess 'none' ) this .switchFromNoneTask .isRunning ) }}
2021-05-19 19:58:06 +03:00
<div class="gh-setting-members-portal-disabled">
<span class="lightgrey"> {{ svg-jar "portal-logo-stroke" }} </span>
<h4>Portal disabled</h4>
<p>Change your Subscription Access setting to re-enable Portal</p>
</div>
2021-05-18 15:59:47 +03:00
{{ else }}
2021-05-18 18:36:18 +03:00
<GhSiteIframe
2021-05-24 21:14:31 +03:00
scrolling="no"
2021-05-18 18:36:18 +03:00
@src= {{ this .portalPreviewUrl }}
2021-05-24 16:03:08 +03:00
@invisibleUntilLoaded="portal-ready"
2021-05-27 15:20:37 +03:00
@onInserted= {{ this .portalPreviewInserted }}
2021-05-18 20:26:07 +03:00
@onDestroyed= {{ this .portalPreviewDestroyed }} />
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-08-17 12:54:12 +03:00
{{ # if this .session .user .isOwnerOnly }}
2021-05-19 22:24:13 +03:00
<button type="button" class="gh-btn gh-btn-outline gh-btn-stripe-status {{ if this .isConnectDisallowed "disabled" }} {{ if this .settings .stripeConnectAccountId "connected" "" }} " {{ on "click" this .openStripeConnect }} >
2021-05-17 18:14:38 +03:00
<span>
{{ if this .settings .stripeConnectAccountId "Connected to Stripe" "Stripe not connected" }}
</span>
2021-05-17 14:01:12 +03:00
</button>
2021-08-17 12:54:12 +03:00
{{ / if }}
2021-05-17 14:01:12 +03:00
</div>
<section class="gh-expandable">
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Free</h4>
2021-05-19 19:07:25 +03:00
<p class="gh-expandable-description">Free member sign up settings</p>
2021-05-17 14:01:12 +03:00
</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 }}
2021-05-20 16:31:51 +03:00
@setResult= {{ this .setFreeSignupRedirect }}
@validateUrl= {{ this .validateFreeSignupRedirect }}
2021-05-17 17:29:07 +03:00
@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>
2021-05-19 19:07:25 +03:00
<p class="gh-expandable-description">Set prices and paid member sign up settings</p>
2021-05-17 14:01:12 +03:00
</div>
2021-05-17 18:14:38 +03:00
{{ # if this .settings .stripeConnectAccountId }}
2021-05-20 16:31:51 +03:00
<button type="button" class="gh-btn" {{ on "click" ( toggle "paidOpen" this ) }} data-test-toggle-pub-info><span> {{ if this .paidOpen "Close" "Expand" }} </span></button>
2021-05-17 18:14:38 +03:00
{{ else }}
2021-08-17 12:54:12 +03:00
<button type="button" class="stripe-connect {{ if ( or ( not this .session .user .isOwnerOnly ) this .isConnectDisallowed ) "disabled" }} " {{ on "click" this .openStripeConnect }} >
2021-05-17 18:14:38 +03:00
<span>Connect with Stripe</span>
</button>
{{ / if }}
2021-05-17 14:01:12 +03:00
</div>
2021-05-19 17:26:45 +03:00
{{ # if this .isConnectDisallowed }}
<div class="gh-setting-nossl">
<div class="gh-setting-nossl-container">
<span class="red"> {{ svg-jar "shield-lock" }} </span>
<h4>Your site is not secured</h4>
<p>Paid memberships through Ghost can only be run on sites secured by SSL (HTTPS vs. HTTP). More information on adding a free SSL Certificate to your Ghost site can be <a href="https://ghost.org/integrations/lets-encrypt/" target="_blank" rel="noopener noreferrer">found here</a>.</p>
</div>
</div>
{{ / if }}
2021-05-17 14:01:12 +03:00
<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 }}
2021-06-09 13:44:36 +03:00
{{ # if ( feature "multipleProducts" ) }}
2021-06-04 10:37:47 +03:00
<GhMembershipProductsAlpha
@products= {{ this .products }}
@confirmProductSave= {{ this .confirmProductSave }}
/>
{{ 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>
<span class="gh-setting-members-currency gh-select">
<div class="gh-setting-members-currencylabel">
<span> {{ this .currency }} </span>
{{ svg-jar "arrow-down-small" }}
</div>
<OneWaySelect
@value= {{ this .selectedCurrency }}
id="currency"
name="currency"
@options= {{ readonly this .allCurrencies }}
@optionValuePath="value"
@optionLabelPath="label"
@update= {{ this .setStripePlansCurrency }}
/>
</span>
</div>
2021-05-17 17:29:07 +03:00
</div>
2021-06-04 10:37:47 +03:00
<div class="gh-setting-members-prices">
2021-05-17 17:29:07 +03:00
2021-06-04 10:37:47 +03:00
<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= {{ this .validateStripePlans }}
@placeholder=''
data-test-title-input= {{ true }}
/>
<span class="gh-input-append"><span class="ttu"> {{ this .currency }} </span>/year</span>
</div>
2021-05-17 17:29:07 +03:00
</div>
2021-06-04 10:37:47 +03:00
{{ # if this .stripePlanError }}
<p class="response w-100"><span class="red"> {{ this .stripePlanError }} </span></p>
{{ / if }}
</GhFormGroup>
2021-05-17 14:01:12 +03:00
2021-06-04 10:37:47 +03:00
{{ / if }}
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 }}
2021-05-20 16:31:51 +03:00
@setResult= {{ this .setPaidSignupRedirect }}
@validateUrl= {{ this .validatePaidSignupRedirect }}
2021-05-17 17:29:07 +03:00
@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-19 17:36:46 +03:00
preloadTask=this.saveSettingsTask
2021-05-19 22:24:13 +03:00
openStripeSettings=this.openStripeConnect
2021-06-21 11:51:48 +03:00
products=this.products
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"
2021-05-20 16:31:51 +03:00
@close= {{ this .closeStripeConnect }}
2021-05-20 19:20:49 +03:00
@modifier="action wide stripe-connect" />
2021-05-17 18:14:38 +03:00
{{ / if }}
2021-06-21 11:51:48 +03:00
</section>