0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Improved Update Notification

- adding a version number to the notification
- adding a link to the upgrade docs, to make this process easier.
This commit is contained in:
Hannah Wolfe 2014-08-06 00:48:44 +01:00
parent c4f74097f8
commit 03a46a0b24
2 changed files with 6 additions and 5 deletions

View file

@ -18,8 +18,8 @@ adminControllers = {
updateCheck().then(function () {
return updateCheck.showUpdateNotification();
}).then(function (updateAvailable) {
if (!updateAvailable) {
}).then(function (updateVersion) {
if (!updateVersion) {
return when.resolve();
}
@ -28,10 +28,11 @@ adminControllers = {
location: 'top',
dismissible: false,
status: 'persistent',
message: 'A new version of Ghost is available! Hot Damn. <a href="https://ghost.org/download">Upgrade now</a>'
message: '<a href="https://ghost.org/download">Ghost ' + updateVersion +
'</a> is available! Hot Damn. Please <a href="http://support.ghost.org/how-to-upgrade/">upgrade</a> now'
};
return api.notifications.browse().then(function (results) {
return api.notifications.browse({context: {internal: true}}).then(function (results) {
if (!_.some(results.notifications, { message: notification.message })) {
return api.notifications.add({ notifications: [notification] }, {context: {internal: true}});
}

View file

@ -210,7 +210,7 @@ function showUpdateNotification() {
}
if (display && display.value && currentVersion && semver.gt(display.value, currentVersion)) {
return when(true);
return when(currentVersion);
}
return when(false);
});