diff --git a/backend/web/static/base.js b/backend/web/static/base.js index 3499d5fe83ee651be147a294349aa5584a0773a1..2c5d21afd5a216566c840c0748d557573e2badb5 100644 --- a/backend/web/static/base.js +++ b/backend/web/static/base.js @@ -356,19 +356,29 @@ function getFormElement(node, context) { } if (name == 'email' || name == 'traits.email') { + var label; + var disable; + if (context == 'settings') { + disable = true; + label = 'Changing your e-mail address is not supported at this point.'; + } else { + disable = false; + label = 'Please provide your e-mail address. We will send a recovery link to that e-mail address.'; + } return getFormInput( 'email', name, value, 'E-mail address', 'Please enter your e-mail address here', - 'Please provide your e-mail address. We will send a recovery link to that e-mail address.', + label, messages, + disable, ); } if (name == 'traits.username') { - return getFormInput('name', name, value, 'Username', 'Please provide an username', null, messages); + return getFormInput('name', name, value, 'Username', 'Please provide a username', null, messages); } if (name == 'traits.name') { @@ -465,10 +475,13 @@ function getFormElement(node, context) { // param placeHolder: Label to display in field if empty // param help: Additional help text, displayed below the field in small font // param messages: Message about failed input -function getFormInput(type, name, value, label, placeHolder, help, messages) { +function getFormInput(type, name, value, label, placeHolder, help, messages, disable) { if (typeof help == 'undefined' || help == null) { help = ''; } + if (typeof disable == 'undefined') { + disable = false; + } console.log('Messages: ', messages); // Id field for help element @@ -496,6 +509,9 @@ function getFormInput(type, name, value, label, placeHolder, help, messages) { if (placeHolder) { element += 'placeholder="' + placeHolder + '" '; } + if (disable) { + element += 'disabled '; + } element += '>'; if (help) {