Skip to content

Commit b0091cc

Browse files
author
Michal Mladek
committed
Merge branch 'master' of https://github.com/SanomaCZ/ella-hope
2 parents aaf7f77 + 1c9c50a commit b0091cc

3 files changed

Lines changed: 16 additions & 18 deletions

File tree

ella_hope/app/login/ajax-setup.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ $.ajaxSetup({
2323
* @return {[type]} [description]
2424
*/
2525
$(document).ajaxError(function(e, xhr, settings, exception) {
26-
if (xhr.status == 401) {
27-
//console.log('ERROR - login needed');
28-
$('body').trigger('show-login');
29-
}
30-
else {
26+
if (xhr.status == 401 || xhr.status == 403) {
27+
if ($('div#login').length == 1) {
28+
// do nothing, cause we are already see login
29+
} else {
30+
$('body').trigger('show-login');
31+
}
32+
} else {
3133
//console.log('ajax error ' + xhr.status);
3234
}
3335
});

ella_hope/app/login/login.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,10 @@ steal(
9494

9595
// user login
9696
var loginResult = User.login(userData);
97-
97+
9898
// if login is not successful
9999
if (loginResult && loginResult.error) {
100100
$("#login-error").show();
101-
//FIXME: Use better solution but for now we use this
102-
//becouse of else multiple controllers is in action
103-
//and ajax are performed multiple times
104-
window.location = '/'
105101
}
106102
else {
107103
self.loginSuccess();

ella_hope/app/resources/locales/cz.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@
196196
"unknown": "No name"
197197
},
198198
"login": {
199-
"error": "Error",
200-
"wrong_user_pass": "Wrong username or password.",
201-
"login": "Login",
202-
"username": "Username",
203-
"password": "Password",
204-
"other": "Other...",
205-
"sign_in": "Sign In",
206-
"enter_url": "Enter url without ending /"
199+
"error": "Chyba",
200+
"wrong_user_pass": "Špatné uživatelské jméno nebo heslo",
201+
"login": "Přihlášení",
202+
"username": "Uživatelské jméno",
203+
"password": "Heslo",
204+
"other": "Jiné...",
205+
"sign_in": "Přihlásit",
206+
"enter_url": "Vložte URL bez koncového lomítka /"
207207
}
208208
}

0 commit comments

Comments
 (0)