mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Updated confirm publish button text
no issue - button text changed to include the post type and time of publish - the button text has become more complex than a static string so the logic was moved into a getter on the confirm component backing class
This commit is contained in:
parent
a4c1f2f7e0
commit
f9ce41620a
@ -1,5 +1,5 @@
|
||||
<div class="gh-publish-title">
|
||||
<div class="green">Ready, set, publish.</div>
|
||||
<div class="green">Ready, set, publish.</div>
|
||||
<div>Share it with the world.</div>
|
||||
</div>
|
||||
<p class="gh-publish-confirmation">
|
||||
@ -57,7 +57,7 @@
|
||||
<div class="gh-publish-cta">
|
||||
<GhTaskButton
|
||||
@task={{@saveTask}}
|
||||
@buttonText={{@publishOptions.selectedPublishTypeOption.confirmButton}}
|
||||
@buttonText={{this.confirmButtonText}}
|
||||
@runningText={{if @publishOptions.willOnlyEmail "Sending" "Publishing"}}
|
||||
@successText={{if @publishOptions.willOnlyEmail "Sent" "Published"}}
|
||||
@class="gh-btn gh-btn-pulse gh-btn-large"
|
||||
|
@ -0,0 +1,30 @@
|
||||
import Component from '@glimmer/component';
|
||||
import moment from 'moment';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default class PublishFlowOptions extends Component {
|
||||
@service settings;
|
||||
|
||||
get confirmButtonText() {
|
||||
const publishType = this.args.publishOptions.publishType;
|
||||
|
||||
let buttonText = '';
|
||||
|
||||
if (publishType === 'publish+send') {
|
||||
buttonText = 'Publish & send';
|
||||
} else if (publishType === 'publish') {
|
||||
buttonText = `Publish ${this.args.publishOptions.post.displayName}`;
|
||||
} else if (publishType === 'send') {
|
||||
buttonText = 'Send email';
|
||||
}
|
||||
|
||||
if (this.args.publishOptions.isScheduled) {
|
||||
const scheduleMoment = moment.tz(this.args.publishOptions.scheduledAtUTC, this.settings.get('timezone'));
|
||||
buttonText += `, on ${scheduleMoment.format('MMMM Do')}`;
|
||||
} else {
|
||||
buttonText += ', right now';
|
||||
}
|
||||
|
||||
return buttonText;
|
||||
}
|
||||
}
|
@ -92,18 +92,15 @@ export class PublishOptions {
|
||||
value: 'publish+send', // internal
|
||||
label: 'Publish and email', // shown in expanded options
|
||||
display: 'Publish and email', // shown in option title
|
||||
confirmButton: 'Yes, publish and send', // shown in confirm step
|
||||
disabled: this.emailDisabled
|
||||
}, {
|
||||
value: 'publish',
|
||||
label: 'Publish only',
|
||||
display: 'Publish',
|
||||
confirmButton: 'Yes, publish on site'
|
||||
display: 'Publish'
|
||||
}, {
|
||||
value: 'send',
|
||||
label: 'Email only',
|
||||
display: 'Email',
|
||||
confirmButton: 'Yes, send by email',
|
||||
disabled: this.emailDisabled
|
||||
}];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user