Added very basic subscription details in preview labs

refs https://github.com/TryGhost/Team/issues/2738
This commit is contained in:
Simon Backx 2023-03-15 14:54:41 +01:00
parent e2eba623dc
commit b8b0d1538e
4 changed files with 21 additions and 17 deletions

View File

@ -225,22 +225,20 @@
</GhFormGroup>
{{/unless}}
{{#if this.membersUtils.isMembersEnabled }}
<GhFormGroup class="gh-stack-item row">
<label for="capture-feedback" class="modal-fullsettings-title" data-test-toggle="showSubscriptionDetails">Show subscription details</label>
<div class="for-switch small">
<div class="container">
<input
type="checkbox"
id="capture-feedback"
checked={{@newsletter.showSubscriptionDetails}}
{{on "change" (fn this.onCheckboxChange "showSubscriptionDetails")}}
>
<button type="button" class="input-toggle-component" {{on "click" (fn this.toggleProperty "showSubscriptionDetails")}}></button>
</div>
<GhFormGroup class="gh-stack-item row">
<label for="capture-feedback" class="modal-fullsettings-title" data-test-toggle="showSubscriptionDetails">Show subscription details</label>
<div class="for-switch small">
<div class="container">
<input
type="checkbox"
id="capture-feedback"
checked={{@newsletter.showSubscriptionDetails}}
{{on "change" (fn this.onCheckboxChange "showSubscriptionDetails")}}
>
<button type="button" class="input-toggle-component" {{on "click" (fn this.toggleProperty "showSubscriptionDetails")}}></button>
</div>
</GhFormGroup>
{{/if}}
</div>
</GhFormGroup>
<GhFormGroup class="gh-stack-item row">
<label for="latest-posts" class="modal-fullsettings-title" data-test-toggle="feedbackEnabled">Share your latest posts</label>

View File

@ -5,7 +5,6 @@ import {inject as service} from '@ember/service';
export default class EditNewsletterDesignForm extends Component {
@service settings;
@service membersUtils;
imageExtensions = IMAGE_EXTENSIONS;

View File

@ -30,7 +30,7 @@
<h2 class="{{if (eq @newsletter.titleFontCategory "serif") "serif"}}">Your email newsletter</h2>
<div class="gh-members-emailpreview-meta {{if (eq @newsletter.titleAlignment "center") "center-aligned"}}">
<p>By {{or this.session.user.name this.session.user.email}}
<span>{{moment-format (moment-site-tz) "D MMM YYYY"}}</span>
<span>{{moment-format (moment-site-tz) "D MMM YYYY"}}</span>
{{#if this.showCommentCta}}
<span><a href="javascript:"> {{svg-jar "comments"}}</a></span>
{{/if}}
@ -74,6 +74,12 @@
</div>
{{/if}}
{{#if @newsletter.showSubscriptionDetails}}
<div class="gh-members-emailpreview-subscription-details">
Subscription details
</div>
{{/if}}
<div class="gh-members-emailpreview-footer">
<div class="gh-members-emailpreview-footercontent">
{{html-safe @newsletter.footerContent}}

View File

@ -6,6 +6,7 @@ export default class EditNewsletterPreview extends Component {
@service ghostPaths;
@service session;
@service settings;
@service membersUtils;
get showHeader() {
return (this.args.newsletter.showHeaderIcon && this.settings.icon)