2021-10-04 16:00:41 +03:00
<section class="gh-canvas circle-bg" {{ 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"
2022-02-09 13:59:12 +03:00
{{ on-key "cmd+s" }}
2021-03-29 14:49:09 +03:00
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
2021-10-04 16:00:41 +03:00
<div class="gh-main-layout content-preview">
2021-05-17 14:01:12 +03:00
<div class="gh-setting-members-basicsform">
2022-01-04 11:52:58 +03:00
<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 $12 million per year, while <strong>Ghost takes 0% payment fees</strong>.</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
2022-01-27 14:40:11 +03:00
<div class="gh-setting-rich-dropdown">
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-09-01 18:58:35 +03:00
<div class="gh-setting-members-portal-mock {{ if ( feature "multipleProducts" ) "mock-enabled" }} ">
2021-05-25 11:40:17 +03:00
{{ # if ( or ( eq this .settings .membersSignupAccess 'none' ) this .switchFromNoneTask .isRunning ) }}
2022-02-19 01:36:01 +03:00
<div class="gh-setting-members-portal-disabled" data-test-portal-preview-disabled>
2021-05-19 19:58:06 +03:00
<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 }}
2022-02-19 01:36:01 +03:00
@onDestroyed= {{ this .portalPreviewDestroyed }}
data-test-iframe="portal-preview"/>
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-09-09 14:01:07 +03:00
{{ # if this .session .user .isAdmin }}
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>
2022-01-19 10:34:08 +03:00
<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>
2022-02-19 01:36:01 +03:00
<button type="button" class="gh-btn" {{ on "click" ( toggle "freeOpen" this ) }} data-test-button="toggle-free-settings"><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 }}
2022-02-19 01:36:01 +03:00
<div class="gh-setting-content-extended" data-test-free-settings-expanded>
2022-01-17 21:56:56 +03:00
{{ # if ( feature "multipleProducts" ) }}
2022-01-17 21:53:43 +03:00
<GhProductCard
@product= {{ this .freeProduct }}
2022-01-19 10:34:08 +03:00
@products= {{ this .products }}
2022-01-17 21:53:43 +03:00
@openEditProduct= {{ this .openEditProduct }}
/>
2022-01-17 21:56:56 +03:00
{{ / if }}
2022-01-31 14:36:40 +03:00
{{ # if ( or ( not ( feature "tierWelcomePages" ) ) ( not ( feature "multipleProducts" ) ) ) }}
2022-01-30 17:18:50 +03:00
<GhFormGroup @errors= {{ this .settings .errors }} @hasValidated= {{ this .settings .hasValidated }} @property="free-welcome-page">
<label for="freeWelcomePage">Welcome page</label>
<GhUrlInput
@id="freeWelcomePage"
@value= {{ readonly this .settings .membersFreeSignupRedirect }}
@baseUrl= {{ readonly this .siteUrl }}
@setResult= {{ this .setFreeSignupRedirect }}
@validateUrl= {{ this .validateFreeSignupRedirect }}
@placeholder= {{ readonly this .siteUrl }}
2022-02-19 01:36:01 +03:00
data-test-input="old-free-welcome-page"
2022-01-30 17:18:50 +03:00
/>
<GhErrorMessage
2022-02-02 20:09:02 +03:00
@errors= {{ this .settings .errors }}
2022-01-30 17:18:50 +03:00
@property="membersFreeSignupRedirect"
/>
<p>Redirect to this URL after signup for a free membership</p>
</GhFormGroup>
2022-02-08 07:01:23 +03:00
{{ else }}
<GhFormGroup>
<label for="welcomePage" class="fw6">Welcome page</label>
<GhUrlInput
@id="welcomePage"
@value= {{ readonly this .freeProduct .welcomePageURL }}
@baseUrl= {{ readonly this .siteUrl }}
@setResult= {{ this .setWelcomePageURL }}
@validateUrl= {{ this .validateWelcomePageURL }}
@placeholder= {{ readonly this .siteUrl }}
2022-02-19 01:36:01 +03:00
data-test-input="free-welcome-page"
2022-02-08 07:01:23 +03:00
/>
2022-02-08 11:39:39 +03:00
<p>Redirect to this URL after signup for a free membership</p>
2022-02-08 07:01:23 +03:00
</GhFormGroup>
2022-01-17 21:56:56 +03:00
{{ / if }}
2021-05-17 14:01:12 +03:00
</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-09-10 13:23:23 +03:00
<button type="button" class="stripe-connect {{ if ( or ( not this .session .user .isAdmin ) 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
2022-01-17 21:53:43 +03:00
@products= {{ this .paidProducts }}
2021-06-04 10:37:47 +03:00
@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>
{{ / if }}
2022-01-31 14:36:40 +03:00
{{ # if ( or ( not ( feature "tierWelcomePages" ) ) ( not ( feature "multipleProducts" ) ) ) }}
2022-01-30 17:18:50 +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= {{ this .setPaidSignupRedirect }}
@validateUrl= {{ this .validatePaidSignupRedirect }}
@placeholder= {{ readonly this .siteUrl }}
/>
<GhErrorMessage
2022-02-02 20:09:02 +03:00
@errors= {{ this .settings .errors }}
2022-01-30 17:18:50 +03:00
@property="membersPaidSignupRedirect"
/>
<p>Redirect to this URL after signup for premium membership</p>
</GhFormGroup>
2021-06-04 10:37:47 +03:00
{{ / if }}
2021-05-17 17:29:07 +03:00
{{ / 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 }}
2022-01-17 21:53:43 +03:00
{{ # if this .showProductModal }}
<GhFullscreenModal
@modal="product"
@model= {{ hash
product=this.productModel
2022-01-19 10:34:08 +03:00
products=this.products
2022-01-17 21:53:43 +03:00
}}
@confirm= {{ this .confirmProductSave }}
@close= {{ this .closeProductModal }}
@modifier="edit-product action wide" />
{{ / if }}
2021-06-21 11:51:48 +03:00
</section>