create_account.html

 1   <div class="row">
 2       <div class="well col-sm-6 col-sm-offset-3">
 3           <#if error_code?has_content >
 4               <#assign typeClass = "class=\"error\"" />
 5   
 6               <#if error_code = "error_mandatory_fields">
 7               <div class="alert alert-danger">#i18n{module.mylutece.database.message.account.errorMandatoryFields}</div>
 8               <#if !(user.login?has_content)>
 9               <#assign classLogin = typeClass />
 10               </#if>
 11               <#if !(user.password?has_content)>
 12               <#assign classPassword = typeClass />
 13               </#if>
 14               <#if !(user.confirmation?has_content)>
 15               <#assign classConfirmation = typeClass />
 16               </#if>
 17               <#if !(user.lastName?has_content)>
 18               <#assign classLastName = typeClass />
 19               </#if>
 20               <#if !(user.firstName?has_content)>
 21               <#assign classFirstName = typeClass />
 22               </#if>
 23               <#if !(user.email?has_content)>
 24               <#assign classEmail = typeClass />
 25               </#if>
 26               </#if>
 27               <#if error_code = "error_confirmation_password">
 28               <div class="alert alert-danger">#i18n{module.mylutece.database.message.account.errorConfirmation}</div>
 29               <#assign classPassword = typeClass />
 30               <#assign classConfirmation = typeClass />
 31               </#if>
 32               <#if error_code = "error_login_already_exists">
 33               <div class="alert alert-danger">#i18n{module.mylutece.database.message.create_account.errorLogin}</div>
 34               <#assign classLogin = typeClass />
 35               </#if>
 36               <#if error_code = "error_syntax_email">
 37               <div class="alert alert-danger">#i18n{module.mylutece.database.message.account.errorBadEmail}</div>
 38               <#assign classEmail = typeClass />
 39               </#if>
 40               <#if error_code = "error_sending_email">
 41               <div class="alert alert-danger">#i18n{module.mylutece.database.message.create_account.errorSendingEmail}</div>
 42               </#if>
 43               <#if error_code = "error_captcha">
 44               <div class="alert alert-danger">#i18n{module.mylutece.database.message.create_account.errorCaptcha}</div>
 45               </#if>
 46               <#if error_code = "password_minimum_length">
 47               <div class="alert alert-danger">${password_minimum_length!}</div>
 48               <#assign classPassword = typeClass />
 49               <#assign classConfirmation = typeClass />
 50               </#if>
 51               <#if error_code = "password_format">
 52                   <div class="alert alert-danger">${password_format_message!!}</div>
 53                   <#assign classPassword = typeClass />
 54                   <#assign classConfirmation = typeClass />
 55               </#if>
 56           </#if>
 57   
 58           <#if action_successful?has_content>
 59               <form role="form" id="createAccount" name="createAccount" action="${action_successful}" method="post">
 60                   <fieldset>
 61                       <legend>#i18n{module.mylutece.database.xpage.create_account.pageTitle}</legend>
 62                       <p class="lead">#i18n{module.mylutece.database.message.create_account.success}</p>
 63                       <div class="form-actions">
 64                           <input class="btn btn-primary btn-sm" id="button-return" type="submit" name="BtnBack" value="#i18n{module.mylutece.database.xpage.account.btnBack}" />
 65                       </div>
 66                   </fieldset>
 67               </form>
 68           <#elseif action_validation_email?has_content>
 69               <form role="form" id="createAccount" name="createAccount" action="${action_validation_email}" method="post">
 70                   <fieldset>
 71                       <legend>#i18n{module.mylutece.database.xpage.create_account.pageTitle}</legend>
 72                       <p class="lead">#i18n{module.mylutece.database.message.create_account.validation.email}</p>
 73                       <input class="btn btn-primary btn-sm" id="button-return" type="submit" name="BtnBack" value="#i18n{module.mylutece.database.xpage.account.btnBack}" />
 74                   </fieldset>	
 75               </form>
 76           <#elseif action_validation_success?has_content>
 77               <form role="form" id="createAccount" name="createAccount" action="${action_validation_success}" method="post">
 78                   <fieldset>
 79                       <legend>#i18n{module.mylutece.database.xpage.create_account.pageTitle}</legend>
 80                       <p class="lead">#i18n{module.mylutece.database.message.create_account.validation.success}</p>
 81                       <input class="btn btn-primary btn-sm" id="button-return" type="submit" name="BtnBack" value="#i18n{module.mylutece.database.xpage.account.btnBack}" />
 82                   </fieldset>
 83               </form>
 84           <#else>
 85               <form role="form" id="createAccount" name="createAccount" action="jsp/site/plugins/mylutece/modules/database/DoCreateAccount.jsp" method="post">
 86                   <fieldset>
 87                       <legend>#i18n{module.mylutece.database.xpage.create_account.pageTitle}</legend>
 88                       <input type="hidden" name="plugin_name" value="${plugin_name}" />
 89   
 90                       <#if show_input_login>
 91                       <div class="form-group">
 92                           <label for="login">#i18n{module.mylutece.database.xpage.create_account.login} * : </label>
 93                           <input class="form-control" type="text" ${classLogin?if_exists} name="login" maxlength="100" size="35" tabindex="1" value="${(user.login)?if_exists}" />
 94                       </div>
 95                       </#if>
 96                       <div class="form-group">
 97                           <label for="email">#i18n{module.mylutece.database.xpage.create_account.eMail} * : </label>
 98                           <input class="form-control" type="text" ${classEmail?if_exists} name="email" maxlength="100" size="35" tabindex="2" value="${(user.email)?if_exists}" />
 99                       </div>
 100                       <div class="form-group">
 101                           <label for="password">#i18n{module.mylutece.database.xpage.create_account.password} * : </label>
 102                           <input class="form-control" type="password" ${classPassword?if_exists} id="password" name="password" maxlength="100" size="35" tabindex="3" value="" />
 103                           <div id="status">
 104                               #i18n{portal.users.create_user.passwordComplexity} : 
 105                           </div>
 106                           <div id="progressbar" class="progress progress-striped" style="width:220px;">
 107                               <div id="progress" ><div id="complexity">0%</div></div>
 108                           </div>
 109                       </div>
 110                       <div class="form-group">
 111                           <label for="confirmation">#i18n{module.mylutece.database.xpage.create_account.confirmation} * : </label>
 112                           <input class="form-control" type="password" ${classConfirmation?if_exists} name="confirmation_password" maxlength="100" size="35" tabindex="4" value="" />
 113                       </div>
 114                       <div class="form-group">
 115                           <label for="first_name">#i18n{module.mylutece.database.xpage.create_account.firstName} * : </label>
 116                           <input class="form-control" type="text" ${classFirstName?if_exists} name="first_name" maxlength="100" size="35" tabindex="5" value="${(user.firstName)?if_exists}" />
 117                       </div>
 118                       <div class="form-group">
 119                           <label for="last_name">#i18n{module.mylutece.database.xpage.create_account.lastName} * : </label>
 120                           <input class="form-control" type="text" ${classLastName?if_exists} name="last_name" maxlength="100" size="35" tabindex="6"  value="${(user.lastName)?if_exists}" />
 121                       </div>
 122                       <#if jcaptcha?exists>
 123                       <div class="form-group">
 124                           ${jcaptcha}
 125                       </div>
 126                       </#if>				
 127                       <button class="btn btn-primary btn-sm" id="button-subscribe" type="submit" name="createAccountBtn" >
 128                           #i18n{module.mylutece.database.xpage.create_account.btnCreateAccount}
 129                       </button>
 130                       <button class="btn btn-default btn-sm" id="button-return" type="button" name="back" onclick="javascript:history.go(-1)" >
 131                           #i18n{module.mylutece.database.xpage.account.btnBack}
 132                       </button>
 133                   </fieldset>
 134               </form>
 135           </#if>
 136       </div>
 137   </div>
 138   
 139   
 140   <script src="js/jquery.complexify.js"></script>
 141   <script>
 142       $(document).ready(function() {
 143           $("#password").complexify({}, function(valid, complexity) {
 144               if (!valid) {
 145                   $('#progress').css({'width': complexity + '%'}).removeClass('bar bar-success').addClass('bar bar-danger');
 146               } else {
 147                   $('#progress').css({'width': complexity + '%'}).removeClass('bar bar-danger').addClass('bar bar-success');
 148               }
 149               $('#complexity').html(Math.round(complexity) + '%');
 150           });
 151       });
 152   </script>