diff --git a/ghost/admin/app/controllers/lexical-editor.js b/ghost/admin/app/controllers/lexical-editor.js index 99b89e437a..e5be98f698 100644 --- a/ghost/admin/app/controllers/lexical-editor.js +++ b/ghost/admin/app/controllers/lexical-editor.js @@ -115,6 +115,11 @@ export default class LexicalEditorController extends Controller { showSettingsMenu = false; hostLimitError = null; + /** + * Flag used to determine if we should return to the analytics page or to the posts/pages overview + */ + fromAnalytics = false; + // koenig related properties wordcount = null; diff --git a/ghost/admin/app/routes/lexical-editor.js b/ghost/admin/app/routes/lexical-editor.js index 1d02b67f3a..bb569816f4 100644 --- a/ghost/admin/app/routes/lexical-editor.js +++ b/ghost/admin/app/routes/lexical-editor.js @@ -25,6 +25,16 @@ export default AuthenticatedRoute.extend({ this.ui.set('isFullScreen', true); }, + setupController(controller, model, transition) { + if (transition.from?.name === 'posts.analytics') { + controller.fromAnalytics = true; + } + }, + + resetController(controller) { + controller.fromAnalytics = false; + }, + deactivate() { this._super(...arguments); this.ui.set('isFullScreen', false); diff --git a/ghost/admin/app/templates/lexical-editor.hbs b/ghost/admin/app/templates/lexical-editor.hbs index 7fe59cdbd5..ffec81cfcf 100644 --- a/ghost/admin/app/templates/lexical-editor.hbs +++ b/ghost/admin/app/templates/lexical-editor.hbs @@ -16,23 +16,35 @@ >
{{#if this.ui.isFullScreen}} - - - {{svg-jar "arrow-left"}} - {{capitalize (pluralize this.post.displayName)}} - - + {{#if this.fromAnalytics }} + + + {{svg-jar "arrow-left"}} + Analytics + + + {{else}} + + + {{svg-jar "arrow-left"}} + {{capitalize (pluralize this.post.displayName)}} + + + {{/if}} + {{/if}} + {{#if (or (not this.ui.isFullScreen) (not this.fromAnalytics) this.post.didEmailFail) }} +
+ + + +
{{/if}} -
- - - -