mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Added a logic to differentiate modal copy
This commit is contained in:
parent
8542d8bfcf
commit
bad9254eb9
4 changed files with 19 additions and 4 deletions
|
@ -12,7 +12,11 @@
|
|||
{{#if this.post.emailOnly}}
|
||||
Your email has been sent.
|
||||
{{else}}
|
||||
That's {{format-number this.postCount}} {{gh-pluralize this.postCount "post" without-count=true}} published.
|
||||
{{#if this.showPostCount}}
|
||||
That's {{format-number this.postCount}} {{gh-pluralize this.postCount "post" without-count=true}} published.
|
||||
{{else}}
|
||||
Opened from the analytics
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{else}}
|
||||
|
|
|
@ -17,6 +17,10 @@ export default class ModalPublishFlow extends ModalComponent {
|
|||
return this.model.postCount;
|
||||
}
|
||||
|
||||
get showPostCount() {
|
||||
return this.model.showPostCount;
|
||||
}
|
||||
|
||||
@action
|
||||
handleTwitter() {
|
||||
window.open(`https://twitter.com/intent/tweet?url=${encodeURI(this.post.url)}`, '_blank');
|
||||
|
|
|
@ -38,9 +38,11 @@
|
|||
<button class="gh-post-list-cta edit" {{on "click" this.fetchPostTask.perform}}>
|
||||
{{svg-jar "reload" title="Refresh post analytics"}}<span>Refresh</span>
|
||||
</button>
|
||||
<button class="gh-post-list-cta edit" {{on "click" this.togglePublishFlowModal}}>
|
||||
{{svg-jar "share" title="Share post"}}<span>Share</span>
|
||||
</button>
|
||||
{{#unless this.post.emailOnly}}
|
||||
<button class="gh-post-list-cta edit" {{on "click" this.togglePublishFlowModal}}>
|
||||
{{svg-jar "share" title="Share post"}}<span>Share</span>
|
||||
</button>
|
||||
{{/unless}}
|
||||
{{!-- <LinkTo @route="lexical-editor.edit" @models={{array this.post.displayName this.post.id}} class="gh-post-list-cta edit" title="">
|
||||
{{svg-jar "pen" title="Edit post"}}<span>Edit post</span>
|
||||
</LinkTo> --}}
|
||||
|
@ -266,7 +268,9 @@
|
|||
@model={{hash
|
||||
post=this.post
|
||||
postCount=this.postCount
|
||||
showPostCount=this.showPostCount
|
||||
}}
|
||||
@haha="haha"
|
||||
@close={{this.togglePublishFlowModal}}
|
||||
@modifier="action wide" />
|
||||
{{/if}}
|
|
@ -35,6 +35,7 @@ export default class Analytics extends Component {
|
|||
@tracked _post = null;
|
||||
@tracked showPublishFlowModal = false;
|
||||
@tracked postCount = null;
|
||||
@tracked showPostCount = false;
|
||||
displayOptions = DISPLAY_OPTIONS;
|
||||
|
||||
constructor() {
|
||||
|
@ -45,6 +46,7 @@ export default class Analytics extends Component {
|
|||
async checkPublishFlowModal() {
|
||||
if (localStorage.getItem('ghost-last-published-post')) {
|
||||
await this.fetchPostCountTask.perform();
|
||||
this.showPostCount = true;
|
||||
this.showPublishFlowModal = true;
|
||||
localStorage.removeItem('ghost-last-published-post');
|
||||
}
|
||||
|
@ -165,6 +167,7 @@ export default class Analytics extends Component {
|
|||
|
||||
@action
|
||||
togglePublishFlowModal() {
|
||||
this.showPostCount = false;
|
||||
this.showPublishFlowModal = !this.showPublishFlowModal;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue