mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Moved default post access from Payments to Access screen (#1879)
refs https://github.com/TryGhost/Team/issues/579 - updated access section on Payments screen to only show when not running developer experiments - added default post access settings to Access screen Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
This commit is contained in:
parent
f92532d51c
commit
4f10e611b0
3 changed files with 63 additions and 1 deletions
|
@ -216,6 +216,7 @@
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{#unless (enable-developer-experiments)}}
|
||||||
<div class="gh-main-section">
|
<div class="gh-main-section">
|
||||||
<h4 class="gh-main-section-header small bn">Access</h4>
|
<h4 class="gh-main-section-header small bn">Access</h4>
|
||||||
<section class="gh-expandable">
|
<section class="gh-expandable">
|
||||||
|
@ -277,6 +278,7 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
{{/unless}}
|
||||||
|
|
||||||
{{#if this.showDisconnectStripeConnectModal}}
|
{{#if this.showDisconnectStripeConnectModal}}
|
||||||
<GhFullscreenModal @modal="disconnect-stripe"
|
<GhFullscreenModal @modal="disconnect-stripe"
|
||||||
|
|
|
@ -8,6 +8,7 @@ export default class MembersAccessController extends Controller {
|
||||||
@service settings;
|
@service settings;
|
||||||
|
|
||||||
@tracked showLeaveSettingsModal = false;
|
@tracked showLeaveSettingsModal = false;
|
||||||
|
@tracked membersPostAccessOpen = false;
|
||||||
|
|
||||||
leaveRoute(transition) {
|
leaveRoute(transition) {
|
||||||
if (this.settings.get('hasDirtyAttributes')) {
|
if (this.settings.get('hasDirtyAttributes')) {
|
||||||
|
@ -30,6 +31,16 @@ export default class MembersAccessController extends Controller {
|
||||||
this.leaveSettingsTransition = null;
|
this.leaveSettingsTransition = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
toggleMembersPostAccess() {
|
||||||
|
this.membersPostAccessOpen = !this.membersPostAccessOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
setDefaultContentVisibility(value) {
|
||||||
|
this.settings.set('defaultContentVisibility', value);
|
||||||
|
}
|
||||||
|
|
||||||
@task({drop: true})
|
@task({drop: true})
|
||||||
*saveSettingsTask() {
|
*saveSettingsTask() {
|
||||||
return yield this.settings.save();
|
return yield this.settings.save();
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
Access
|
Access
|
||||||
</h2>
|
</h2>
|
||||||
<section class="view-actions">
|
<section class="view-actions">
|
||||||
<GhTaskButton @buttonText="Save settings"
|
<GhTaskButton
|
||||||
|
@buttonText="Save settings"
|
||||||
@task={{this.saveSettingsTask}}
|
@task={{this.saveSettingsTask}}
|
||||||
@successText="Saved"
|
@successText="Saved"
|
||||||
@runningText="Saving"
|
@runningText="Saving"
|
||||||
|
@ -17,7 +18,55 @@
|
||||||
</GhCanvasHeader>
|
</GhCanvasHeader>
|
||||||
|
|
||||||
<section class="view-container settings-debug">
|
<section class="view-container settings-debug">
|
||||||
|
<section class="gh-expandable">
|
||||||
|
<div class="gh-expandable-block">
|
||||||
|
<div class="gh-expandable-header">
|
||||||
|
<div>
|
||||||
|
<h4 class="gh-expandable-title">Default post access</h4>
|
||||||
|
<p class="gh-expandable-description">When a new post is created, who should have access to it?</p>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="gh-btn" {{on "click" this.toggleMembersPostAccess}} data-test-toggle="members-post-access"><span>{{if this.membersPostAccessOpen "Close" "Expand"}}</span></button>
|
||||||
|
</div>
|
||||||
|
<div class="gh-expandable-content">
|
||||||
|
{{#liquid-if this.membersPostAccessOpen}}
|
||||||
|
<div class="flex flex-column w-50 flex">
|
||||||
|
<div
|
||||||
|
class="gh-radio {{if (eq this.settings.defaultContentVisibility "public") "active"}}"
|
||||||
|
{{on "click" (fn this.setDefaultContentVisibility "public")}}
|
||||||
|
>
|
||||||
|
<div class="gh-radio-button"></div>
|
||||||
|
<div class="gh-radio-content">
|
||||||
|
<div class="gh-radio-label">Public<br>
|
||||||
|
<small class="midgrey">All site visitors to your site, no login required</small></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="gh-radio {{if (eq this.settings.defaultContentVisibility "members") "active"}}"
|
||||||
|
{{on "click" (fn this.setDefaultContentVisibility "members")}}
|
||||||
|
>
|
||||||
|
<div class="gh-radio-button"></div>
|
||||||
|
<div class="gh-radio-content">
|
||||||
|
<div class="gh-radio-label">Members only<br>
|
||||||
|
<small class="midgrey">All logged-in members</small></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="gh-radio {{if (eq this.settings.defaultContentVisibility "paid") "active"}}"
|
||||||
|
{{on "click" (fn this.setDefaultContentVisibility "paid")}}
|
||||||
|
>
|
||||||
|
<div class="gh-radio-button"></div>
|
||||||
|
<div class="gh-radio-content">
|
||||||
|
<div class="gh-radio-label">Paid-members only<br>
|
||||||
|
<small class="midgrey">Only logged-in members with an active Stripe subscription</small></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/liquid-if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{#if this.showLeaveSettingsModal}}
|
{{#if this.showLeaveSettingsModal}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue