mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
parent
cecb07f6e2
commit
4fdc730913
2 changed files with 8 additions and 1 deletions
|
@ -100,11 +100,13 @@ NavigationController = Ember.Controller.extend({
|
||||||
blogUrl = this.get('config').blogUrl,
|
blogUrl = this.get('config').blogUrl,
|
||||||
blogUrlRegex = new RegExp('^' + blogUrl + '(.*)', 'i'),
|
blogUrlRegex = new RegExp('^' + blogUrl + '(.*)', 'i'),
|
||||||
navItems = this.get('navigationItems'),
|
navItems = this.get('navigationItems'),
|
||||||
|
message = 'One of your navigation items has an empty label. ' +
|
||||||
|
'<br /> Please enter a new label or delete the item before saving.',
|
||||||
match;
|
match;
|
||||||
|
|
||||||
// Don't save if there's a blank label.
|
// Don't save if there's a blank label.
|
||||||
if (navItems.find(function (item) { return !item.get('isComplete') && !item.get('last');})) {
|
if (navItems.find(function (item) { return !item.get('isComplete') && !item.get('last');})) {
|
||||||
self.notifications.showErrors(['One of your navigation items has an empty label.<br>Please enter a new label or delete the item before saving.']);
|
self.notifications.showErrors([message.htmlSafe()]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,11 @@ ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, Shortcut
|
||||||
|
|
||||||
sessionAuthenticationFailed: function (error) {
|
sessionAuthenticationFailed: function (error) {
|
||||||
if (error.errors) {
|
if (error.errors) {
|
||||||
|
// These are server side errors, which can be marked as htmlSafe
|
||||||
|
error.errors.forEach(function (err) {
|
||||||
|
err.message = err.message.htmlSafe();
|
||||||
|
});
|
||||||
|
|
||||||
this.notifications.showErrors(error.errors);
|
this.notifications.showErrors(error.errors);
|
||||||
} else {
|
} else {
|
||||||
// connection errors don't return proper status message, only req.body
|
// connection errors don't return proper status message, only req.body
|
||||||
|
|
Loading…
Add table
Reference in a new issue