mirror of
https://github.com/wekan/wekan.git
synced 2026-01-09 19:18:50 +01:00
wording change, email sending optimization, add texts to i18n
This commit is contained in:
parent
e3c3cc0d8d
commit
39f2837838
9 changed files with 74 additions and 50 deletions
|
|
@ -1,6 +1,6 @@
|
|||
Template.invitationCode.onRendered(() => {
|
||||
const strict = Settings.findOne().strict;
|
||||
if(!strict){
|
||||
const disableRegistration = Settings.findOne().disableRegistration;
|
||||
if(!disableRegistration){
|
||||
$('#invitationcode').hide();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
template(name="setting")
|
||||
.setting-content
|
||||
.content-title
|
||||
span Settings
|
||||
span {{_ 'settings'}}
|
||||
.content-body
|
||||
.side-menu
|
||||
ul
|
||||
li.active
|
||||
a.js-setting-menu(data-id="general-setting") System
|
||||
a.js-setting-menu(data-id="registration-setting") {{_ 'registration'}}
|
||||
li
|
||||
a.js-setting-menu(data-id="email-setting") Email
|
||||
a.js-setting-menu(data-id="email-setting") {{_ 'email'}}
|
||||
.main-body
|
||||
if loading.get
|
||||
+spinner
|
||||
|
|
@ -18,20 +18,20 @@ template(name="setting")
|
|||
+email
|
||||
|
||||
template(name="general")
|
||||
ul#general-setting.setting-detail
|
||||
ul#registration-setting.setting-detail
|
||||
li
|
||||
a.flex.js-toggle-strict-mode
|
||||
.materialCheckBox(class="{{#if currentSetting.strict}}is-checked{{/if}}")
|
||||
a.flex.js-toggle-registration
|
||||
.materialCheckBox(class="{{#if currentSetting.disableRegistration}}is-checked{{/if}}")
|
||||
|
||||
span Use Strict Mode
|
||||
span {{_ 'disable-self-registration'}}
|
||||
li
|
||||
.invite-people(class="{{#if currentSetting.strict}}{{else}}hide{{/if}}")
|
||||
.invite-people(class="{{#if currentSetting.disableRegistration}}{{else}}hide{{/if}}")
|
||||
ul
|
||||
li
|
||||
.title Invite People
|
||||
textarea#email-to-invite.form-control(rows='5', placeholder="Email Adresses")
|
||||
.title {{_ 'invite-people'}}
|
||||
textarea#email-to-invite.form-control(rows='5', placeholder="{{_ 'email-addresses'}}")
|
||||
li
|
||||
.title To board(s)
|
||||
.title {{_ 'to-boards'}}
|
||||
.bg-white
|
||||
each boards
|
||||
a.option.flex.js-toggle-board-choose(id= _id)
|
||||
|
|
@ -40,31 +40,30 @@ template(name="general")
|
|||
span= title
|
||||
|
||||
li
|
||||
button.js-email-invite.primary Invite
|
||||
button.js-email-invite.primary {{_ 'invite'}}
|
||||
|
||||
template(name='email')
|
||||
ul#email-setting.setting-detail
|
||||
li.smtp-form
|
||||
.title SMTP Host {{currentSetting.mailServer.port}}
|
||||
.description The address of the SMTP server that handles your emails.
|
||||
.title {{_ 'smtp-host'}}
|
||||
.description {{_ 'smtp-host-description'}}
|
||||
.form-group
|
||||
input.form-control#mail-server-host(type="text", placeholder="smtp.domain.com" value="{{currentSetting.mailServer.host}}")
|
||||
li.smtp-form
|
||||
.title SMTP Port
|
||||
.description The port your SMTP server uses for outgoing emails.
|
||||
.title {{_ 'smtp-port'}}
|
||||
.description {{_ 'smtp-port-description'}}
|
||||
.form-group
|
||||
input.form-control#mail-server-port(type="text", placeholder="25" value="{{currentSetting.mailServer.port}}")
|
||||
li.smtp-form
|
||||
.title SMTP user name
|
||||
.title {{_ 'smtp-username'}}
|
||||
.form-group
|
||||
input.form-control#mail-server-username(type="text", placeholder="user name" value="{{currentSetting.mailServer.username}}")
|
||||
input.form-control#mail-server-username(type="text", placeholder="{{_ 'username'}}" value="{{currentSetting.mailServer.username}}")
|
||||
li.smtp-form
|
||||
.title SMTP password
|
||||
.title {{_ 'smtp-password'}}
|
||||
.form-group
|
||||
input.form-control#mail-server-password(type="text", placeholder="password" value="{{currentSetting.mailServer.password}}")
|
||||
input.form-control#mail-server-password(type="text", placeholder="{{_ 'password'}}" value="{{currentSetting.mailServer.password}}")
|
||||
li.smtp-form
|
||||
.title From
|
||||
.Email address you want to use to send emails.
|
||||
.title {{_ 'send-from'}}
|
||||
.form-group
|
||||
input.form-control#mail-server-from(type="email", placeholder="no-reply@domain.com" value="{{currentSetting.mailServer.from}}")
|
||||
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ BlazeComponent.extendComponent({
|
|||
sort: ['title'],
|
||||
});
|
||||
},
|
||||
toggleStrictMode(){
|
||||
toggleRegistration(){
|
||||
this.setLoading(true);
|
||||
const isStrictMode = this.currentSetting().strict;
|
||||
Settings.update(Settings.findOne()._id, {$set:{strict: !isStrictMode}});
|
||||
const registrationClosed = this.currentSetting().disableRegistration;
|
||||
Settings.update(Settings.findOne()._id, {$set:{disableRegistration: !registrationClosed}});
|
||||
this.setLoading(false);
|
||||
if(isStrictMode){
|
||||
if(registrationClosed){
|
||||
$('.invite-people').slideUp();
|
||||
}else{
|
||||
$('.invite-people').slideDown();
|
||||
|
|
@ -58,7 +58,7 @@ BlazeComponent.extendComponent({
|
|||
$('.side-menu li.active').removeClass('active');
|
||||
target.parent().addClass('active');
|
||||
const targetID = target.data('id');
|
||||
this.generalSetting.set('general-setting' === targetID);
|
||||
this.generalSetting.set('registration-setting' === targetID);
|
||||
this.emailSetting.set('email-setting' === targetID);
|
||||
}
|
||||
},
|
||||
|
|
@ -74,7 +74,6 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
inviteThroughEmail(){
|
||||
this.setLoading(true);
|
||||
const emails = $('#email-to-invite').val().trim().split('\n').join(',').split(',');
|
||||
const boardsToInvite = [];
|
||||
$('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () {
|
||||
|
|
@ -86,12 +85,15 @@ BlazeComponent.extendComponent({
|
|||
validEmails.push(email.trim());
|
||||
}
|
||||
});
|
||||
Meteor.call('sendInvitation', validEmails, boardsToInvite, () => {
|
||||
// if (!err) {
|
||||
// TODO - show more info to user
|
||||
// }
|
||||
this.setLoading(false);
|
||||
});
|
||||
if (validEmails.length) {
|
||||
this.setLoading(true);
|
||||
Meteor.call('sendInvitation', validEmails, boardsToInvite, () => {
|
||||
// if (!err) {
|
||||
// TODO - show more info to user
|
||||
// }
|
||||
this.setLoading(false);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
saveMailServerInfo(){
|
||||
|
|
@ -116,7 +118,7 @@ BlazeComponent.extendComponent({
|
|||
|
||||
events(){
|
||||
return [{
|
||||
'click a.js-toggle-strict-mode': this.toggleStrictMode,
|
||||
'click a.js-toggle-registration': this.toggleRegistration,
|
||||
'click a.js-setting-menu': this.switchMenu,
|
||||
'click a.js-toggle-board-choose': this.checkBoard,
|
||||
'click button.js-email-invite': this.inviteThroughEmail,
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ template(name="settingHeaderBar")
|
|||
if currentUser
|
||||
a.setting-header-btn.settings.active
|
||||
i.fa(class="fa-cog")
|
||||
span {{_ 'option-setting'}}
|
||||
span {{_ 'settings'}}
|
||||
//TODO
|
||||
// a.setting-header-btn.people
|
||||
// i.fa(class="fa-users")
|
||||
// span {{_ 'option-people'}}
|
||||
// span {{_ 'people'}}
|
||||
|
||||
else
|
||||
a.setting-header-btn.js-log-in(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue