add popup to confirm deleting one account

This commit is contained in:
guillaume 2019-07-30 11:42:43 +02:00
parent 7cc1ffcab2
commit 84ba42f42e
4 changed files with 12 additions and 6 deletions

View file

@ -243,8 +243,8 @@ Template.editUserPopup.events({
} else Popup.close(); } else Popup.close();
}, },
'click #deleteButton'() { 'click #deleteButton': Popup.afterConfirm('userDelete', function() {
Users.remove(this.userId); Users.remove(this.userId);
Popup.close(); Popup.close();
}, }),
}); });

View file

@ -82,3 +82,8 @@ template(name="changeSettingsPopup")
| {{_ 'show-cards-minimum-count'}} | {{_ 'show-cards-minimum-count'}}
input#show-cards-count-at.inline-input.left(type="number" value="#{showCardsCountAt}" min="0" max="99" onkeydown="return false") input#show-cards-count-at.inline-input.left(type="number" value="#{showCardsCountAt}" min="0" max="99" onkeydown="return false")
input.js-apply-show-cards-at.left(type="submit" value="{{_ 'apply'}}") input.js-apply-show-cards-at.left(type="submit" value="{{_ 'apply'}}")
template(name="userDeletePopup")
p {{_ 'delete-user-confirm-popup'}}
button.js-confirm.negate.full(type="submit") {{_ 'delete'}}

View file

@ -104,11 +104,11 @@ Template.editProfilePopup.events({
}); });
} else Popup.back(); } else Popup.back();
}, },
'click #deleteButton'() { 'click #deleteButton': Popup.afterConfirm('userDelete', function() {
Users.remove(Meteor.userId());
Popup.close(); Popup.close();
Users.remove(Meteor.userId());
AccountsTemplates.logout(); AccountsTemplates.logout();
}, }),
}); });
// XXX For some reason the useraccounts autofocus isnt working in this case. // XXX For some reason the useraccounts autofocus isnt working in this case.

View file

@ -722,5 +722,6 @@
"act-almostdue": "was reminding the current due (__timeValue__) of __card__ is approaching", "act-almostdue": "was reminding the current due (__timeValue__) of __card__ is approaching",
"act-pastdue": "was reminding the current due (__timeValue__) of __card__ is past", "act-pastdue": "was reminding the current due (__timeValue__) of __card__ is past",
"act-duenow": "was reminding the current due (__timeValue__) of __card__ is now", "act-duenow": "was reminding the current due (__timeValue__) of __card__ is now",
"act-atUserComment": "You were mentioned in [__board__] __card__" "act-atUserComment": "You were mentioned in [__board__] __card__",
"delete-user-confirm-popup": "Are you sure you want to delete this account? There is no undo."
} }