mirror of
https://github.com/wekan/wekan.git
synced 2026-01-18 15:35:29 +01:00
Delete user feature
This commit is contained in:
parent
11a91bfc78
commit
cdef8a33e4
6 changed files with 62 additions and 2 deletions
|
|
@ -107,5 +107,8 @@ template(name="editUserPopup")
|
|||
label
|
||||
| {{_ 'password'}}
|
||||
input.js-profile-password(type="password")
|
||||
div.buttonsContainer
|
||||
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||
div
|
||||
input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}")
|
||||
|
||||
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ Template.peopleRow.helpers({
|
|||
|
||||
Template.editUserPopup.onCreated(function() {
|
||||
this.authenticationMethods = new ReactiveVar([]);
|
||||
this.errorMessage = new ReactiveVar('');
|
||||
|
||||
Meteor.call('getAuthenticationsEnabled', (_, result) => {
|
||||
if (result) {
|
||||
|
|
@ -129,6 +130,9 @@ Template.editUserPopup.helpers({
|
|||
const selected = Users.findOne(userId).authenticationMethod;
|
||||
return selected === 'ldap';
|
||||
},
|
||||
errorMessage() {
|
||||
return Template.instance().errorMessage.get();
|
||||
},
|
||||
});
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
|
|
@ -220,4 +224,9 @@ Template.editUserPopup.events({
|
|||
});
|
||||
} else Popup.close();
|
||||
},
|
||||
|
||||
'click #deleteButton'() {
|
||||
Users.remove(this.userId);
|
||||
Popup.close();
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,3 +34,15 @@ table
|
|||
|
||||
button
|
||||
min-width: 60px;
|
||||
|
||||
.content-wrapper
|
||||
margin-top: 10px
|
||||
|
||||
.buttonsContainer
|
||||
display: flex
|
||||
|
||||
input
|
||||
margin: 0
|
||||
|
||||
div
|
||||
margin: auto
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ template(name="editProfilePopup")
|
|||
input.js-profile-email(type="email" value="{{emails.[0].address}}")
|
||||
else
|
||||
input.js-profile-email(type="email" value="{{emails.[0].address}}" readonly)
|
||||
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||
div.buttonsContainer
|
||||
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||
div
|
||||
input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}")
|
||||
|
||||
template(name="changePasswordPopup")
|
||||
+atForm(state='changePwd')
|
||||
|
|
|
|||
|
|
@ -95,6 +95,11 @@ Template.editProfilePopup.events({
|
|||
});
|
||||
} else Popup.back();
|
||||
},
|
||||
'click #deleteButton'() {
|
||||
Users.remove(Meteor.userId());
|
||||
Popup.close();
|
||||
AccountsTemplates.logout();
|
||||
},
|
||||
});
|
||||
|
||||
// XXX For some reason the useraccounts autofocus isnt working in this case.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue