mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
Improved scheduled status text in posts list
closes https://github.com/TryGhost/Ghost/issues/11965 - fixes scheduled posts always showing "and sent" - updates status text to match that shown in the editor for scheduled posts
This commit is contained in:
parent
8f8fcfc8bb
commit
be0a6d58a0
@ -18,7 +18,7 @@
|
||||
{{/if}}
|
||||
|
||||
{{#if @post.isScheduled}}
|
||||
– <span class="gh-schedule-time">Will be published and sent {{gh-format-post-time @post.publishedAtUTC scheduled=true}}</span>
|
||||
– <span class="gh-schedule-time">Will be published {{this.scheduledText}}</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
</p>
|
||||
@ -39,7 +39,7 @@
|
||||
{{/if}}
|
||||
|
||||
{{#if @post.isPublished}}
|
||||
<span class="gh-content-status-published nowrap" title="Post has been sent by email">
|
||||
<span class="gh-content-status-published nowrap">
|
||||
Published
|
||||
</span>
|
||||
{{/if}}
|
||||
@ -52,11 +52,11 @@
|
||||
</span>
|
||||
{{else}}
|
||||
{{#if @post.isScheduled}}
|
||||
<span data-tooltip="To be sent by email" class="gh-content-status-emailed scheduled">
|
||||
<span title="To be send by email" data-tooltip="To be sent by email" class="gh-content-status-emailed scheduled">
|
||||
{{svg-jar "send-email" class="stroke-green-d2"}}
|
||||
</span>
|
||||
{{else}}
|
||||
<span data-tooltip="Sent by email" class="gh-content-status-emailed">
|
||||
<span title="Sent by email" data-tooltip="Sent by email" class="gh-content-status-emailed">
|
||||
{{svg-jar "send-email" class="stroke-midgrey"}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
@ -1,10 +1,30 @@
|
||||
import Component from '@glimmer/component';
|
||||
import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default class GhPostsListItemComponent extends Component {
|
||||
@service session;
|
||||
@service settings;
|
||||
|
||||
get authorNames() {
|
||||
return this.args.post.authors.map(author => author.name || author.email).join(', ');
|
||||
}
|
||||
|
||||
get scheduledText() {
|
||||
let {post} = this.args;
|
||||
let text = [];
|
||||
|
||||
if (post.sendEmailWhenPublished) {
|
||||
let paid = post.visibility === 'paid';
|
||||
text.push(`and sent to ${paid ? 'paid' : 'all'} members`);
|
||||
}
|
||||
|
||||
let formattedTime = formatPostTime(
|
||||
post.publishedAtUTC,
|
||||
{timezone: this.settings.get('timezone'), scheduled: true}
|
||||
);
|
||||
text.push(formattedTime);
|
||||
|
||||
return text.join(' ');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user