Update "update banner" for 5.0

no refs.
- "Update banner" needed to be improved to drive more traffic
This commit is contained in:
Peter Zimon 2022-11-15 17:27:58 +01:00 committed by Daniel Lockyer
parent e8548af861
commit 02851a671d
No known key found for this signature in database
3 changed files with 34 additions and 7 deletions

View File

@ -16,6 +16,7 @@ export default class ApplicationController extends Controller {
@service router;
@service session;
@service settings;
@service store;
@service ui;
@reads('config.hostSettings.update.enabled')
@ -47,6 +48,20 @@ export default class ApplicationController extends Controller {
&& !router.currentRouteName.match(/(signin|signup|setup|reset)/);
}
get ownerUserNameOrEmail() {
let user = this.store.peekAll('user').findBy('isOwnerOnly', true);
if (user) {
if (user.name) {
return user.name;
} else if (user.email) {
return user.email;
}
}
return null;
}
@action
openUpdateTab() {
const updateWindow = window.open('', '_blank');

View File

@ -2078,7 +2078,7 @@ section.gh-ds h2 {
display: flex;
align-items: center;
justify-content: center;
background: #15171A;
background: linear-gradient(90deg, var(--purple) 0%, var(--pink) 100%);;
color: rgba(255, 255, 255, 0.95);
padding: 14px;
}

View File

@ -1,12 +1,24 @@
<GhApp>
<GhSkipLink @anchor=".gh-main">Skip to main content</GhSkipLink>
{{#if (and this.session.user.isOwnerOnly this.showUpdateLink)}}
{{#if (and this.session.user.isAdmin this.showUpdateLink)}}
<aside class="gh-update-banner">
<div class="gh-alert-content">
Your site is ready for a major update!
</div>
<a href="#" {{on "click" this.openUpdateTab}}>Update to Ghost 5.0 &rarr;</a>
{{#if this.session.user.isOwnerOnly}}
<div class="gh-alert-content">
You're missing out on new features, update by January 31st.
</div>
<a href="#" {{on "click" this.openUpdateTab}}>Update to Ghost 5.0 &rarr;</a>
{{else}}
<div class="gh-alert-content">
Your Ghost install is ready for a major update!
{{#if this.ownerUserNameOrEmail}}
{{this.ownerUserNameOrEmail}}
{{else}}
Your Site Owner
{{/if}}
will need to log in to do this.
</div>
{{/if}}
</aside>
{{/if}}
@ -65,4 +77,4 @@
<div id="unsplash-selector-wormhole"></div>
<EpmModalContainer />
<EmberLoadRemover />
<EmberLoadRemover />