UX improved about mail and domains

This commit is contained in:
ekhae 2019-08-16 18:07:03 +00:00 committed by Alexandre Aubin
parent 71a21e2ba0
commit 8a69d23994
3 changed files with 7 additions and 10 deletions

View file

@ -203,11 +203,9 @@
data.password_min_length = PASSWORD_MIN_LENGTH;
c.view('user/user_create', data, function(){
var usernameField = $('#username');
usernameField.on('blur', function(){
usernameField.on('input', function(){
var emailField = $('#email');
if (emailField.val() == '') {
emailField.val(usernameField.val());
}
});
});
});
@ -225,9 +223,7 @@
c.params['mailbox_quota'] += "M";
}
else {c.params['mailbox_quota'] = 0;}
// Compute email field
c.params['mail'] = c.params['email'] + c.params['domain'];
c.params['domain']=c.params['domain'].slice(1);
c.api('POST', '/users', c.params.toHash(), function(data) {
c.redirect_to('#/users');

View file

@ -104,6 +104,7 @@
"domain_visit": "Visit",
"domain_visit_url": "Visit %s",
"domains": "Domains",
"email_info": "The main email adress must start with the username, nevertheless you can add additional email adresses (aliases) after creating the user.",
"enable": "Enable",
"enabled": "Enabled",
"error_modify_something": "You should modify something",

View file

@ -32,7 +32,7 @@
<label for="mail" class="col-sm-3 control-label">{{t 'user_email'}}</label>
<div class="clearfix visible-xs"></div>
<div class="col-sm-4 col-xs-6">
<input type="text" id="email" name="email" class="form-control" placeholder="johndoe" required>
<input type="text" id="email" name="email" class="form-control" placeholder="johndoe" data-toogle="tooltip" data-placement="top" title="{{t 'email_info'}}" disabled>
</div>
<div class="col-sm-5 col-xs-6">
<select class="form-control" name="domain">