mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Updated welcome page location for free membership
refs https://github.com/TryGhost/Team/issues/1168 - moved free tier welcome page url from product card to main screen
This commit is contained in:
parent
7a07c431fc
commit
f341edb02d
3 changed files with 57 additions and 18 deletions
|
@ -99,25 +99,25 @@
|
|||
<p class="response w-100"><span class="red">{{this.stripePlanError}}</span></p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{#if (feature "tierWelcomePages")}}
|
||||
<GhFormGroup>
|
||||
<label for="welcomePage" class="fw6">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@id="welcomePage"
|
||||
@value={{readonly this.model.product.welcomePageURL}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setWelcomePageURL}}
|
||||
@validateUrl={{this.validateWelcomePageURL}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
/>
|
||||
{{#if this.isFreeProduct}}
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
{{else}}
|
||||
<p>Redirect to this URL after signup for premium membership</p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{#if (feature "tierWelcomePages")}}
|
||||
<GhFormGroup>
|
||||
<label for="welcomePage" class="fw6">Welcome page</label>
|
||||
<GhUrlInput
|
||||
@id="welcomePage"
|
||||
@value={{readonly this.model.product.welcomePageURL}}
|
||||
@baseUrl={{readonly this.siteUrl}}
|
||||
@setResult={{this.setWelcomePageURL}}
|
||||
@validateUrl={{this.validateWelcomePageURL}}
|
||||
@placeholder={{readonly this.siteUrl}}
|
||||
/>
|
||||
{{#if this.isFreeProduct}}
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
{{else}}
|
||||
<p>Redirect to this URL after signup for premium membership</p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<h4 class="gh-main-section-header small bn">Benefits</h4>
|
||||
|
|
|
@ -33,6 +33,7 @@ export default class MembersAccessController extends Controller {
|
|||
@tracked productModel = null;
|
||||
@tracked paidSignupRedirect;
|
||||
@tracked freeSignupRedirect;
|
||||
@tracked welcomePageURL;
|
||||
@tracked stripeMonthlyAmount = 5;
|
||||
@tracked stripeYearlyAmount = 50;
|
||||
@tracked currency = 'usd';
|
||||
|
@ -142,6 +143,11 @@ export default class MembersAccessController extends Controller {
|
|||
this.freeSignupRedirect = url;
|
||||
}
|
||||
|
||||
@action
|
||||
setWelcomePageURL(url) {
|
||||
this.welcomePageURL = url;
|
||||
}
|
||||
|
||||
@action
|
||||
validatePaidSignupRedirect() {
|
||||
return this._validateSignupRedirect(this.paidSignupRedirect, 'membersPaidSignupRedirect');
|
||||
|
@ -152,6 +158,23 @@ export default class MembersAccessController extends Controller {
|
|||
return this._validateSignupRedirect(this.freeSignupRedirect, 'membersFreeSignupRedirect');
|
||||
}
|
||||
|
||||
@action
|
||||
validateWelcomePageURL() {
|
||||
const siteUrl = this.siteUrl;
|
||||
|
||||
if (this.welcomePageURL === undefined) {
|
||||
// Not initialised
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.welcomePageURL.href.startsWith(siteUrl)) {
|
||||
const path = this.welcomePageURL.href.replace(siteUrl, '');
|
||||
this.freeProduct.welcomePageURL = path;
|
||||
} else {
|
||||
this.freeProduct.welcomePageURL = this.welcomePageURL.href;
|
||||
}
|
||||
}
|
||||
|
||||
@action
|
||||
validateStripePlans({updatePortalPreview = true} = {}) {
|
||||
this.stripePlanError = undefined;
|
||||
|
@ -354,6 +377,7 @@ export default class MembersAccessController extends Controller {
|
|||
return;
|
||||
}
|
||||
const result = yield this.settings.save();
|
||||
yield this.freeProduct.save();
|
||||
this.updatePortalPreview(options);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -113,6 +113,21 @@
|
|||
/>
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
</GhFormGroup>
|
||||
{{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}}
|
||||
/>
|
||||
{{#if this.isFreeProduct}}
|
||||
<p>Redirect to this URL after signup for a free membership</p>
|
||||
{{/if}}
|
||||
</GhFormGroup>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/liquid-if}}
|
||||
|
|
Loading…
Add table
Reference in a new issue