From 272f1eddaf24b8f6ea77aa12f15d57d4d9804d95 Mon Sep 17 00:00:00 2001 From: Paul Adam Davis Date: Wed, 29 Apr 2015 21:54:53 +0100 Subject: [PATCH] Move upgrade notification to /settings/about/ Refs #5071 - Move the Upgrade notification from the top of the screen to the About page --- core/client/app/controllers/settings/about.js | 12 ++++++++++++ core/client/app/styles/components/notifications.scss | 9 +++++++++ core/client/app/templates/settings/about.hbs | 5 ++++- core/server/controllers/admin.js | 7 +++---- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 core/client/app/controllers/settings/about.js diff --git a/core/client/app/controllers/settings/about.js b/core/client/app/controllers/settings/about.js new file mode 100644 index 0000000000..405fc1244b --- /dev/null +++ b/core/client/app/controllers/settings/about.js @@ -0,0 +1,12 @@ +import Ember from 'ember'; +var SettingsAboutController = Ember.Controller.extend({ + updateNotificationCount: 0, + + actions: { + updateNotificationChange: function (count) { + this.set('updateNotificationCount', count); + } + } +}); + +export default SettingsAboutController; diff --git a/core/client/app/styles/components/notifications.scss b/core/client/app/styles/components/notifications.scss index 9c8b231b12..c281513225 100644 --- a/core/client/app/styles/components/notifications.scss +++ b/core/client/app/styles/components/notifications.scss @@ -215,4 +215,13 @@ // Hide extra space taken up by update notification .update-available main { bottom: 56px; +} + +.notification-upgrade { + color: $red; + + a { + color: $red; + text-decoration: underline; + } } \ No newline at end of file diff --git a/core/client/app/templates/settings/about.hbs b/core/client/app/templates/settings/about.hbs index 57b3683949..b233a0ccc6 100644 --- a/core/client/app/templates/settings/about.hbs +++ b/core/client/app/templates/settings/about.hbs @@ -11,7 +11,10 @@ v{{model.version}} -

A free, open, simple publishing platform

+ {{gh-notifications location="settings-about-upgrade" notify="updateNotificationChange"}} + {{#unless updateNotificationCount}} +

A free, open, simple publishing platform

+ {{/unless}}
diff --git a/core/server/controllers/admin.js b/core/server/controllers/admin.js index ee44be65c7..44ddba038e 100644 --- a/core/server/controllers/admin.js +++ b/core/server/controllers/admin.js @@ -33,12 +33,11 @@ adminControllers = { } var notification = { - type: 'success', - location: 'top', + type: 'upgrade', + location: 'settings-about-upgrade', dismissible: false, status: 'persistent', - message: 'Ghost ' + updateVersion + - ' is available! Hot Damn. Please upgrade now' + message: 'Ghost ' + updateVersion + ' is available! Hot Damn. Click here to upgrade.' }; return api.notifications.browse({context: {internal: true}}).then(function (results) {