Removed flash, renamed file, unbroken logout / login request notifications

Closes #354
* Reintroduced the redirect functionality (not logged in, tries to go to `/settings/user/`, is sent to `/login/` with info notification, after login user is taken to `/settings/user/)
* Reintroduced the "Successfully logged out" message
* Added middleware to scrub passive notifications from `ghost.notifications` after one use basically mimicing client side passive notifications
* Removed flash from everywhere. Even from package.json.
* Renamed flashed.hbs to notifications.hbs, modified default.hbs accordingly
* Added function to parse GET variables on client side
This commit is contained in:
Gabor Javorszky 2013-08-20 00:40:09 +01:00
parent d39d43bc47
commit 2f6098d653
2 changed files with 19 additions and 3 deletions

View File

@ -99,8 +99,22 @@
} }
return message; return message;
} },
// Getting URL vars
getUrlVariables: function () {
var vars = [],
hash,
hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'),
i;
for (i = 0; i < hashes.length; i += 1) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
}); });
/** /**

View File

@ -45,14 +45,16 @@
submitHandler: function (event) { submitHandler: function (event) {
event.preventDefault(); event.preventDefault();
var email = this.$el.find('.email').val(), var email = this.$el.find('.email').val(),
password = this.$el.find('.password').val(); password = this.$el.find('.password').val(),
redirect = this.getUrlVariables().r;
$.ajax({ $.ajax({
url: '/ghost/login/', url: '/ghost/login/',
type: 'POST', type: 'POST',
data: { data: {
email: email, email: email,
password: password password: password,
redirect: redirect
}, },
success: function (msg) { success: function (msg) {
window.location.href = msg.redirect; window.location.href = msg.redirect;