0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Display basic info in PSM once an email has been sent

This commit is contained in:
Kevin Ansfield 2019-11-08 17:07:47 +07:00
parent 43feb624b7
commit 682c5e4190
3 changed files with 77 additions and 57 deletions

View file

@ -13,9 +13,9 @@ export default Model.extend({
submittedAtUTC: attr('moment-utc'), submittedAtUTC: attr('moment-utc'),
uuid: attr('string'), uuid: attr('string'),
createdAtUTC: attr('string'), createdAtUTC: attr('moment-utc'),
createdBy: attr('string'), createdBy: attr('string'),
updatedAtUTC: attr('string'), updatedAtUTC: attr('moment-utc'),
updatedBy: attr('string'), updatedBy: attr('string'),
post: belongsTo('post') post: belongsTo('post')

View file

@ -0,0 +1,10 @@
/* eslint-disable camelcase */
import ApplicationSerializer from 'ghost-admin/serializers/application';
export default ApplicationSerializer.extend({
attrs: {
createdAtUTC: {key: 'created_at'},
updatedAtUTC: {key: 'updated_at'},
submittedAtUTC: {key: 'submitted_at'}
}
});

View file

@ -5,12 +5,21 @@
</div> </div>
<div class="settings-menu-content settings-menu-email"> <div class="settings-menu-content settings-menu-email">
{{#if post.email}}
{{!-- Mail has already been sent --}}
<p>Subject: {{this.post.email.subject}}</p>
<p>Status: {{this.post.email.status}}</p>
<p>Sent on: {{gh-format-post-time this.post.email.createdAtUTC}}</p>
<p>Sent to {{pluralize this.post.email.emailCount "member"}}</p>
{{else}}
{{!-- Mail not sent yet --}}
{{#if mailgunError}} {{#if mailgunError}}
<p class="gh-box gh-box-warning settings-menu-mailgun-warning"> <p class="gh-box gh-box-warning settings-menu-mailgun-warning">
{{svg-jar "info" class="w5 h5 fill-yellow nl1"}} {{svg-jar "info" class="w5 h5 fill-yellow nl1"}}
You need to configure Mailgun in {{#link-to "settings.labs" data-test-nav="labs"}}Labs → Members settings{{/link-to}} to enable email newsletters. You need to configure Mailgun in {{#link-to "settings.labs" data-test-nav="labs"}}Labs → Members settings{{/link-to}} to enable email newsletters.
</p> </p>
{{/if}} {{/if}}
<form {{action "discardEnter" on="submit"}}> <form {{action "discardEnter" on="submit"}}>
{{#gh-form-group errors=post.errors hasValidated=post.hasValidated property="emailSubject"}} {{#gh-form-group errors=post.errors hasValidated=post.hasValidated property="emailSubject"}}
<label for="og-title">Subject</label> <label for="og-title">Subject</label>
@ -66,4 +75,5 @@
</div> </div>
</div> </div>
</form> </form>
{{/if}}
</div> </div>