mirror of
https://github.com/wekan/wekan.git
synced 2026-02-21 23:44:06 +01:00
Add change email address
Set allow email change in admin panel
This commit is contained in:
parent
57219df16a
commit
6a10257fd7
9 changed files with 153 additions and 4 deletions
|
|
@ -12,6 +12,8 @@ template(name="setting")
|
|||
a.js-setting-menu(data-id="registration-setting") {{_ 'registration'}}
|
||||
li
|
||||
a.js-setting-menu(data-id="email-setting") {{_ 'email'}}
|
||||
li
|
||||
a.js-setting-menu(data-id="account-setting") {{_ 'accounts'}}
|
||||
.main-body
|
||||
if loading.get
|
||||
+spinner
|
||||
|
|
@ -19,6 +21,8 @@ template(name="setting")
|
|||
+general
|
||||
else if emailSetting.get
|
||||
+email
|
||||
else if accountSetting.get
|
||||
+accountSettings
|
||||
|
||||
template(name="general")
|
||||
ul#registration-setting.setting-detail
|
||||
|
|
@ -80,3 +84,15 @@ template(name='email')
|
|||
|
||||
li
|
||||
button.js-save.primary {{_ 'save'}}
|
||||
|
||||
template(name='accountSettings')
|
||||
ul#account-setting.setting-detail
|
||||
li.smtp-form
|
||||
.title {{_ 'accounts-allowEmailChange'}}
|
||||
.form-group.flex
|
||||
input.form-control#accounts-allowEmailChange(type="radio" name="allowEmailChange" value="true" checked="{{#if allowEmailChange}}checked{{/if}}")
|
||||
span {{_ 'yes'}}
|
||||
input.form-control#accounts-allowEmailChange(type="radio" name="allowEmailChange" value="false" checked="{{#unless allowEmailChange}}checked{{/unless}}")
|
||||
span {{_ 'no'}}
|
||||
li
|
||||
button.js-accounts-save.primary {{_ 'save'}}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
Meteor.subscribe('setting');
|
||||
Meteor.subscribe('mailServer');
|
||||
Meteor.subscribe('accountSettings');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
|
|
@ -7,6 +8,7 @@ BlazeComponent.extendComponent({
|
|||
this.loading = new ReactiveVar(false);
|
||||
this.generalSetting = new ReactiveVar(true);
|
||||
this.emailSetting = new ReactiveVar(false);
|
||||
this.accountSetting = new ReactiveVar(false);
|
||||
},
|
||||
|
||||
setError(error) {
|
||||
|
|
@ -62,6 +64,7 @@ BlazeComponent.extendComponent({
|
|||
const targetID = target.data('id');
|
||||
this.generalSetting.set('registration-setting' === targetID);
|
||||
this.emailSetting.set('email-setting' === targetID);
|
||||
this.accountSetting.set('account-setting' === targetID);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -130,3 +133,22 @@ BlazeComponent.extendComponent({
|
|||
}];
|
||||
},
|
||||
}).register('setting');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
saveAllowEmailChange() {
|
||||
const allowEmailChange = ($('input[name=allowEmailChange]:checked').val() === 'true');
|
||||
AccountSettings.update('accounts-allowEmailChange', {
|
||||
$set: { 'booleanValue': allowEmailChange },
|
||||
});
|
||||
},
|
||||
|
||||
allowEmailChange() {
|
||||
return AccountSettings.findOne('accounts-allowEmailChange').booleanValue;
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'click button.js-accounts-save': this.saveAllowEmailChange,
|
||||
}];
|
||||
},
|
||||
}).register('accountSettings');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue