mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge branch 'Akuket-master'
This commit is contained in:
commit
d2ea240ed4
7 changed files with 44 additions and 8 deletions
|
@ -243,8 +243,8 @@ Template.editUserPopup.events({
|
|||
} else Popup.close();
|
||||
},
|
||||
|
||||
'click #deleteButton'() {
|
||||
'click #deleteButton': Popup.afterConfirm('userDelete', function() {
|
||||
Users.remove(this.userId);
|
||||
Popup.close();
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
|
|
@ -113,6 +113,14 @@ template(name='accountSettings')
|
|||
span {{_ 'yes'}}
|
||||
input.wekan-form-control#accounts-allowUserNameChange(type="radio" name="allowUserNameChange" value="false" checked="{{#unless allowUserNameChange}}checked{{/unless}}")
|
||||
span {{_ 'no'}}
|
||||
li
|
||||
li.accounts-form
|
||||
.title {{_ 'accounts-allowUserDelete'}}
|
||||
.form-group.flex
|
||||
input.wekan-form-control#accounts-allowUserDelete(type="radio" name="allowUserDelete" value="true" checked="{{#if allowUserDelete}}checked{{/if}}")
|
||||
span {{_ 'yes'}}
|
||||
input.wekan-form-control#accounts-allowUserDelete(type="radio" name="allowUserDelete" value="false" checked="{{#unless allowUserDelete}}checked{{/unless}}")
|
||||
span {{_ 'no'}}
|
||||
li
|
||||
button.js-accounts-save.primary {{_ 'save'}}
|
||||
|
||||
|
|
|
@ -233,12 +233,17 @@ BlazeComponent.extendComponent({
|
|||
$('input[name=allowEmailChange]:checked').val() === 'true';
|
||||
const allowUserNameChange =
|
||||
$('input[name=allowUserNameChange]:checked').val() === 'true';
|
||||
const allowUserDelete =
|
||||
$('input[name=allowUserDelete]:checked').val() === 'true';
|
||||
AccountSettings.update('accounts-allowEmailChange', {
|
||||
$set: { booleanValue: allowEmailChange },
|
||||
});
|
||||
AccountSettings.update('accounts-allowUserNameChange', {
|
||||
$set: { booleanValue: allowUserNameChange },
|
||||
});
|
||||
AccountSettings.update('accounts-allowUserDelete', {
|
||||
$set: { booleanValue: allowUserDelete },
|
||||
});
|
||||
},
|
||||
|
||||
allowEmailChange() {
|
||||
|
@ -247,6 +252,9 @@ BlazeComponent.extendComponent({
|
|||
allowUserNameChange() {
|
||||
return AccountSettings.findOne('accounts-allowUserNameChange').booleanValue;
|
||||
},
|
||||
allowUserDelete() {
|
||||
return AccountSettings.findOne('accounts-allowUserDelete').booleanValue;
|
||||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
|
|
|
@ -55,8 +55,9 @@ template(name="editProfilePopup")
|
|||
input.js-profile-email(type="email" value="{{emails.[0].address}}" readonly)
|
||||
div.buttonsContainer
|
||||
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||
div
|
||||
input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}")
|
||||
if allowUserDelete
|
||||
div
|
||||
input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}")
|
||||
|
||||
template(name="changePasswordPopup")
|
||||
+atForm(state='changePwd')
|
||||
|
@ -82,3 +83,8 @@ template(name="changeSettingsPopup")
|
|||
| {{_ 'show-cards-minimum-count'}}
|
||||
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'}}")
|
||||
|
||||
|
||||
template(name="userDeletePopup")
|
||||
p {{_ 'delete-user-confirm-popup'}}
|
||||
button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
|
||||
|
|
|
@ -35,6 +35,9 @@ Template.editProfilePopup.helpers({
|
|||
allowUserNameChange() {
|
||||
return AccountSettings.findOne('accounts-allowUserNameChange').booleanValue;
|
||||
},
|
||||
allowUserDelete() {
|
||||
return AccountSettings.findOne('accounts-allowUserDelete').booleanValue;
|
||||
},
|
||||
});
|
||||
|
||||
Template.editProfilePopup.events({
|
||||
|
@ -104,11 +107,11 @@ Template.editProfilePopup.events({
|
|||
});
|
||||
} else Popup.back();
|
||||
},
|
||||
'click #deleteButton'() {
|
||||
Users.remove(Meteor.userId());
|
||||
'click #deleteButton': Popup.afterConfirm('userDelete', function() {
|
||||
Popup.close();
|
||||
Users.remove(Meteor.userId());
|
||||
AccountsTemplates.logout();
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
// XXX For some reason the useraccounts autofocus isnt working in this case.
|
||||
|
|
|
@ -722,5 +722,7 @@
|
|||
"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-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.",
|
||||
"accounts-allowUserDelete": "Allow users to self delete their account"
|
||||
}
|
||||
|
|
|
@ -68,6 +68,15 @@ if (Meteor.isServer) {
|
|||
},
|
||||
},
|
||||
);
|
||||
AccountSettings.upsert(
|
||||
{ _id: 'accounts-allowUserDelete' },
|
||||
{
|
||||
$setOnInsert: {
|
||||
booleanValue: false,
|
||||
sort: 0,
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue