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

View file

@ -104,6 +104,7 @@
"domain_visit": "Visit", "domain_visit": "Visit",
"domain_visit_url": "Visit %s", "domain_visit_url": "Visit %s",
"domains": "Domains", "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", "enable": "Enable",
"enabled": "Enabled", "enabled": "Enabled",
"error_modify_something": "You should modify something", "error_modify_something": "You should modify something",

View file

@ -32,12 +32,12 @@
<label for="mail" class="col-sm-3 control-label">{{t 'user_email'}}</label> <label for="mail" class="col-sm-3 control-label">{{t 'user_email'}}</label>
<div class="clearfix visible-xs"></div> <div class="clearfix visible-xs"></div>
<div class="col-sm-4 col-xs-6"> <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>
<div class="col-sm-5 col-xs-6"> <div class="col-sm-5 col-xs-6">
<select class="form-control" name="domain"> <select class="form-control" name="domain">
{{#domains}} {{#domains}}
<option>@{{.}}</option> <option>@{{.}}</option>
{{/domains}} {{/domains}}
</select> </select>
</div> </div>