mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +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(() => {
|
Template.invitationCode.onRendered(() => {
|
||||||
const strict = Settings.findOne().strict;
|
const disableRegistration = Settings.findOne().disableRegistration;
|
||||||
if(!strict){
|
if(!disableRegistration){
|
||||||
$('#invitationcode').hide();
|
$('#invitationcode').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
template(name="setting")
|
template(name="setting")
|
||||||
.setting-content
|
.setting-content
|
||||||
.content-title
|
.content-title
|
||||||
span Settings
|
span {{_ 'settings'}}
|
||||||
.content-body
|
.content-body
|
||||||
.side-menu
|
.side-menu
|
||||||
ul
|
ul
|
||||||
li.active
|
li.active
|
||||||
a.js-setting-menu(data-id="general-setting") System
|
a.js-setting-menu(data-id="registration-setting") {{_ 'registration'}}
|
||||||
li
|
li
|
||||||
a.js-setting-menu(data-id="email-setting") Email
|
a.js-setting-menu(data-id="email-setting") {{_ 'email'}}
|
||||||
.main-body
|
.main-body
|
||||||
if loading.get
|
if loading.get
|
||||||
+spinner
|
+spinner
|
||||||
|
|
@ -18,20 +18,20 @@ template(name="setting")
|
||||||
+email
|
+email
|
||||||
|
|
||||||
template(name="general")
|
template(name="general")
|
||||||
ul#general-setting.setting-detail
|
ul#registration-setting.setting-detail
|
||||||
li
|
li
|
||||||
a.flex.js-toggle-strict-mode
|
a.flex.js-toggle-registration
|
||||||
.materialCheckBox(class="{{#if currentSetting.strict}}is-checked{{/if}}")
|
.materialCheckBox(class="{{#if currentSetting.disableRegistration}}is-checked{{/if}}")
|
||||||
|
|
||||||
span Use Strict Mode
|
span {{_ 'disable-self-registration'}}
|
||||||
li
|
li
|
||||||
.invite-people(class="{{#if currentSetting.strict}}{{else}}hide{{/if}}")
|
.invite-people(class="{{#if currentSetting.disableRegistration}}{{else}}hide{{/if}}")
|
||||||
ul
|
ul
|
||||||
li
|
li
|
||||||
.title Invite People
|
.title {{_ 'invite-people'}}
|
||||||
textarea#email-to-invite.form-control(rows='5', placeholder="Email Adresses")
|
textarea#email-to-invite.form-control(rows='5', placeholder="{{_ 'email-addresses'}}")
|
||||||
li
|
li
|
||||||
.title To board(s)
|
.title {{_ 'to-boards'}}
|
||||||
.bg-white
|
.bg-white
|
||||||
each boards
|
each boards
|
||||||
a.option.flex.js-toggle-board-choose(id= _id)
|
a.option.flex.js-toggle-board-choose(id= _id)
|
||||||
|
|
@ -40,31 +40,30 @@ template(name="general")
|
||||||
span= title
|
span= title
|
||||||
|
|
||||||
li
|
li
|
||||||
button.js-email-invite.primary Invite
|
button.js-email-invite.primary {{_ 'invite'}}
|
||||||
|
|
||||||
template(name='email')
|
template(name='email')
|
||||||
ul#email-setting.setting-detail
|
ul#email-setting.setting-detail
|
||||||
li.smtp-form
|
li.smtp-form
|
||||||
.title SMTP Host {{currentSetting.mailServer.port}}
|
.title {{_ 'smtp-host'}}
|
||||||
.description The address of the SMTP server that handles your emails.
|
.description {{_ 'smtp-host-description'}}
|
||||||
.form-group
|
.form-group
|
||||||
input.form-control#mail-server-host(type="text", placeholder="smtp.domain.com" value="{{currentSetting.mailServer.host}}")
|
input.form-control#mail-server-host(type="text", placeholder="smtp.domain.com" value="{{currentSetting.mailServer.host}}")
|
||||||
li.smtp-form
|
li.smtp-form
|
||||||
.title SMTP Port
|
.title {{_ 'smtp-port'}}
|
||||||
.description The port your SMTP server uses for outgoing emails.
|
.description {{_ 'smtp-port-description'}}
|
||||||
.form-group
|
.form-group
|
||||||
input.form-control#mail-server-port(type="text", placeholder="25" value="{{currentSetting.mailServer.port}}")
|
input.form-control#mail-server-port(type="text", placeholder="25" value="{{currentSetting.mailServer.port}}")
|
||||||
li.smtp-form
|
li.smtp-form
|
||||||
.title SMTP user name
|
.title {{_ 'smtp-username'}}
|
||||||
.form-group
|
.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
|
li.smtp-form
|
||||||
.title SMTP password
|
.title {{_ 'smtp-password'}}
|
||||||
.form-group
|
.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
|
li.smtp-form
|
||||||
.title From
|
.title {{_ 'send-from'}}
|
||||||
.Email address you want to use to send emails.
|
|
||||||
.form-group
|
.form-group
|
||||||
input.form-control#mail-server-from(type="email", placeholder="no-reply@domain.com" value="{{currentSetting.mailServer.from}}")
|
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'],
|
sort: ['title'],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
toggleStrictMode(){
|
toggleRegistration(){
|
||||||
this.setLoading(true);
|
this.setLoading(true);
|
||||||
const isStrictMode = this.currentSetting().strict;
|
const registrationClosed = this.currentSetting().disableRegistration;
|
||||||
Settings.update(Settings.findOne()._id, {$set:{strict: !isStrictMode}});
|
Settings.update(Settings.findOne()._id, {$set:{disableRegistration: !registrationClosed}});
|
||||||
this.setLoading(false);
|
this.setLoading(false);
|
||||||
if(isStrictMode){
|
if(registrationClosed){
|
||||||
$('.invite-people').slideUp();
|
$('.invite-people').slideUp();
|
||||||
}else{
|
}else{
|
||||||
$('.invite-people').slideDown();
|
$('.invite-people').slideDown();
|
||||||
|
|
@ -58,7 +58,7 @@ BlazeComponent.extendComponent({
|
||||||
$('.side-menu li.active').removeClass('active');
|
$('.side-menu li.active').removeClass('active');
|
||||||
target.parent().addClass('active');
|
target.parent().addClass('active');
|
||||||
const targetID = target.data('id');
|
const targetID = target.data('id');
|
||||||
this.generalSetting.set('general-setting' === targetID);
|
this.generalSetting.set('registration-setting' === targetID);
|
||||||
this.emailSetting.set('email-setting' === targetID);
|
this.emailSetting.set('email-setting' === targetID);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -74,7 +74,6 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
inviteThroughEmail(){
|
inviteThroughEmail(){
|
||||||
this.setLoading(true);
|
|
||||||
const emails = $('#email-to-invite').val().trim().split('\n').join(',').split(',');
|
const emails = $('#email-to-invite').val().trim().split('\n').join(',').split(',');
|
||||||
const boardsToInvite = [];
|
const boardsToInvite = [];
|
||||||
$('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () {
|
$('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () {
|
||||||
|
|
@ -86,12 +85,15 @@ BlazeComponent.extendComponent({
|
||||||
validEmails.push(email.trim());
|
validEmails.push(email.trim());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Meteor.call('sendInvitation', validEmails, boardsToInvite, () => {
|
if (validEmails.length) {
|
||||||
// if (!err) {
|
this.setLoading(true);
|
||||||
// TODO - show more info to user
|
Meteor.call('sendInvitation', validEmails, boardsToInvite, () => {
|
||||||
// }
|
// if (!err) {
|
||||||
this.setLoading(false);
|
// TODO - show more info to user
|
||||||
});
|
// }
|
||||||
|
this.setLoading(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
saveMailServerInfo(){
|
saveMailServerInfo(){
|
||||||
|
|
@ -116,7 +118,7 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
events(){
|
events(){
|
||||||
return [{
|
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-setting-menu': this.switchMenu,
|
||||||
'click a.js-toggle-board-choose': this.checkBoard,
|
'click a.js-toggle-board-choose': this.checkBoard,
|
||||||
'click button.js-email-invite': this.inviteThroughEmail,
|
'click button.js-email-invite': this.inviteThroughEmail,
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ template(name="settingHeaderBar")
|
||||||
if currentUser
|
if currentUser
|
||||||
a.setting-header-btn.settings.active
|
a.setting-header-btn.settings.active
|
||||||
i.fa(class="fa-cog")
|
i.fa(class="fa-cog")
|
||||||
span {{_ 'option-setting'}}
|
span {{_ 'settings'}}
|
||||||
//TODO
|
//TODO
|
||||||
// a.setting-header-btn.people
|
// a.setting-header-btn.people
|
||||||
// i.fa(class="fa-users")
|
// i.fa(class="fa-users")
|
||||||
// span {{_ 'option-people'}}
|
// span {{_ 'people'}}
|
||||||
|
|
||||||
else
|
else
|
||||||
a.setting-header-btn.js-log-in(
|
a.setting-header-btn.js-log-in(
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,16 @@ FlowRouter.route('/import', {
|
||||||
|
|
||||||
FlowRouter.route('/setting', {
|
FlowRouter.route('/setting', {
|
||||||
name: 'setting',
|
name: 'setting',
|
||||||
|
triggersEnter: [
|
||||||
|
AccountsTemplates.ensureSignedIn,
|
||||||
|
() => {
|
||||||
|
Session.set('currentBoard', null);
|
||||||
|
Session.set('currentCard', null);
|
||||||
|
|
||||||
|
Filter.reset();
|
||||||
|
EscapeActions.executeAll();
|
||||||
|
},
|
||||||
|
],
|
||||||
action() {
|
action() {
|
||||||
BlazeLayout.render('defaultLayout', {
|
BlazeLayout.render('defaultLayout', {
|
||||||
headerBar: 'settingHeaderBar',
|
headerBar: 'settingHeaderBar',
|
||||||
|
|
|
||||||
|
|
@ -326,8 +326,21 @@
|
||||||
"what-to-do": "What do you want to do?",
|
"what-to-do": "What do you want to do?",
|
||||||
"admin-panel": "Admin Panel",
|
"admin-panel": "Admin Panel",
|
||||||
"system-setting": "System Setting",
|
"system-setting": "System Setting",
|
||||||
"option-setting": "Settings",
|
"settings": "Settings",
|
||||||
"option-people": "People",
|
"people": "People",
|
||||||
|
"registration": "Registration",
|
||||||
|
"disable-self-registration": "Disable Self-Registration",
|
||||||
|
"invite": "Invite",
|
||||||
|
"invite-people": "Invite People",
|
||||||
|
"to-boards": "To board(s)",
|
||||||
|
"email-addresses":"Email Addresses",
|
||||||
|
"smtp-host-description": "The address of the SMTP server that handles your emails.",
|
||||||
|
"smtp-port-description": "The port your SMTP server uses for outgoing emails.",
|
||||||
|
"smtp-host": "SMTP Host",
|
||||||
|
"smtp-port": "SMTP Port",
|
||||||
|
"smtp-username": "Username",
|
||||||
|
"smtp-password": "Password",
|
||||||
|
"send-from": "From",
|
||||||
"invitation-code": "Invitation Code",
|
"invitation-code": "Invitation Code",
|
||||||
"email-invite-register-subject": "__inviter__ sent you an invitation",
|
"email-invite-register-subject": "__inviter__ sent you an invitation",
|
||||||
"email-invite-register-text": "Dear __user__,\n\n__inviter__ invites you to Wekan for collaborations.\n\nPlease follow the link below:\n__url__\n\nAnd your invitation code is: __icode__\n\nThanks.\n",
|
"email-invite-register-text": "Dear __user__,\n\n__inviter__ invites you to Wekan for collaborations.\n\nPlease follow the link below:\n__url__\n\nAnd your invitation code is: __icode__\n\nThanks.\n",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
Settings = new Mongo.Collection('settings');
|
Settings = new Mongo.Collection('settings');
|
||||||
|
|
||||||
Settings.attachSchema(new SimpleSchema({
|
Settings.attachSchema(new SimpleSchema({
|
||||||
strict: {
|
disableRegistration: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
'mailServer.username': {
|
'mailServer.username': {
|
||||||
|
|
@ -23,7 +23,7 @@ Settings.attachSchema(new SimpleSchema({
|
||||||
'mailServer.from': {
|
'mailServer.from': {
|
||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
optional: true,
|
||||||
defaultValue: 'Kanban',
|
defaultValue: 'Wekan',
|
||||||
},
|
},
|
||||||
createdAt: {
|
createdAt: {
|
||||||
type: Date,
|
type: Date,
|
||||||
|
|
@ -56,7 +56,7 @@ if (Meteor.isServer) {
|
||||||
const setting = Settings.findOne({});
|
const setting = Settings.findOne({});
|
||||||
if(!setting){
|
if(!setting){
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const defaultSetting = {strict: false, mailServer: {
|
const defaultSetting = {disableRegistration: false, mailServer: {
|
||||||
username: '', password:'', host: '', port:'', from: '',
|
username: '', password:'', host: '', port:'', from: '',
|
||||||
}, createdAt: now, modifiedAt: now};
|
}, createdAt: now, modifiedAt: now};
|
||||||
Settings.insert(defaultSetting);
|
Settings.insert(defaultSetting);
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ if (Meteor.isServer) {
|
||||||
if (user._id === inviter._id) throw new Meteor.Error('error-user-notAllowSelf');
|
if (user._id === inviter._id) throw new Meteor.Error('error-user-notAllowSelf');
|
||||||
} else {
|
} else {
|
||||||
if (posAt <= 0) throw new Meteor.Error('error-user-doesNotExist');
|
if (posAt <= 0) throw new Meteor.Error('error-user-doesNotExist');
|
||||||
if (Settings.findOne().strict) throw new Meteor.Error('error-user-notCreated');
|
if (Settings.findOne().disableRegistration) throw new Meteor.Error('error-user-notCreated');
|
||||||
const email = username;
|
const email = username;
|
||||||
username = email.substring(0, posAt);
|
username = email.substring(0, posAt);
|
||||||
const newUserId = Accounts.createUser({ username, email });
|
const newUserId = Accounts.createUser({ username, email });
|
||||||
|
|
@ -395,8 +395,8 @@ if (Meteor.isServer) {
|
||||||
user.isAdmin = true;
|
user.isAdmin = true;
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
const strict = Settings.findOne().strict;
|
const disableRegistration = Settings.findOne().disableRegistration;
|
||||||
if (!strict) {
|
if (!disableRegistration) {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -484,8 +484,8 @@ if (Meteor.isServer) {
|
||||||
Users.after.insert((userId, doc) => {
|
Users.after.insert((userId, doc) => {
|
||||||
|
|
||||||
//invite user to corresponding boards
|
//invite user to corresponding boards
|
||||||
const strict = Settings.findOne().strict;
|
const disableRegistration = Settings.findOne().disableRegistration;
|
||||||
if (strict) {
|
if (disableRegistration) {
|
||||||
const user = Users.findOne(doc._id);
|
const user = Users.findOne(doc._id);
|
||||||
const invitationCode = InvitationCodes.findOne({code: user.profile.icode, valid:true});
|
const invitationCode = InvitationCodes.findOne({code: user.profile.icode, valid:true});
|
||||||
if (!invitationCode) {
|
if (!invitationCode) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
Meteor.publish('setting', () => {
|
Meteor.publish('setting', () => {
|
||||||
return Settings.find({}, {fields:{strict: 1}});
|
return Settings.find({}, {fields:{disableRegistration: 1}});
|
||||||
});
|
});
|
||||||
|
|
||||||
Meteor.publish('mailServer', function () {
|
Meteor.publish('mailServer', function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue