From 8a69d239944967bc6c0a3bfe6342ca82c44b800b Mon Sep 17 00:00:00 2001 From: ekhae Date: Fri, 16 Aug 2019 18:07:03 +0000 Subject: [PATCH] UX improved about mail and domains --- src/js/yunohost/controllers/users.js | 10 +++------- src/locales/en.json | 1 + src/views/user/user_create.ms | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/js/yunohost/controllers/users.js b/src/js/yunohost/controllers/users.js index 7a26ce37..fe70d9d7 100644 --- a/src/js/yunohost/controllers/users.js +++ b/src/js/yunohost/controllers/users.js @@ -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()); - } + 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'); diff --git a/src/locales/en.json b/src/locales/en.json index a55f6b9d..33c9f225 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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", diff --git a/src/views/user/user_create.ms b/src/views/user/user_create.ms index f326c3fe..6334e42d 100644 --- a/src/views/user/user_create.ms +++ b/src/views/user/user_create.ms @@ -32,12 +32,12 @@
- -
+ +