mirror of
https://github.com/wekan/wekan.git
synced 2026-02-17 21:48:07 +01:00
Display message when user wants to choose existing username (Fixes: #16)
This commit is contained in:
parent
4dc0ec07b8
commit
69fbd31abc
3 changed files with 14 additions and 4 deletions
|
|
@ -27,6 +27,8 @@ template(name="editProfilePopup")
|
||||||
input.js-profile-fullname(type="text" value=profile.fullname autofocus)
|
input.js-profile-fullname(type="text" value=profile.fullname autofocus)
|
||||||
label
|
label
|
||||||
| {{_ 'username'}}
|
| {{_ 'username'}}
|
||||||
|
span.error.hide.username-taken
|
||||||
|
| {{_ 'error-username-taken'}}
|
||||||
input.js-profile-username(type="text" value=username)
|
input.js-profile-username(type="text" value=username)
|
||||||
label
|
label
|
||||||
| {{_ 'initials'}}
|
| {{_ 'initials'}}
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,18 @@ Template.editProfilePopup.events({
|
||||||
'profile.fullname': fullname,
|
'profile.fullname': fullname,
|
||||||
'profile.initials': initials,
|
'profile.initials': initials,
|
||||||
}});
|
}});
|
||||||
// XXX We should report the error to the user.
|
|
||||||
if (username !== Meteor.user().username) {
|
if (username !== Meteor.user().username) {
|
||||||
Meteor.call('setUsername', username);
|
Meteor.call('setUsername', username, function(error) {
|
||||||
}
|
const messageElement = tpl.$('.username-taken');
|
||||||
Popup.back();
|
if (error) {
|
||||||
|
messageElement.show();
|
||||||
|
} else {
|
||||||
|
messageElement.hide();
|
||||||
|
Popup.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else Popup.back();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,7 @@
|
||||||
"error-user-doesNotExist": "This user does not exist",
|
"error-user-doesNotExist": "This user does not exist",
|
||||||
"error-user-notAllowSelf": "This action on self is not allowed",
|
"error-user-notAllowSelf": "This action on self is not allowed",
|
||||||
"error-user-notCreated": "This user is not created",
|
"error-user-notCreated": "This user is not created",
|
||||||
|
"error-username-taken": "This username is already taken",
|
||||||
"export-board": "Export board",
|
"export-board": "Export board",
|
||||||
"filter": "Filter",
|
"filter": "Filter",
|
||||||
"filter-cards": "Filter Cards",
|
"filter-cards": "Filter Cards",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue