NovoUsuario.html 7.69 KB
<!DOCTYPE html>
<html lang="pt" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />

        <title>Protocolo MP - Cadastro Novo Usuário</title>

        <link rel="stylesheet" type="text/css" th:href="@{/layout/stylesheets/vendors.min.css}" />
        <link rel="stylesheet" type="text/css" th:href="@{/layout/stylesheets/dipla.min.css}" />
        <link rel="stylesheet" type="text/css" th:href="@{/layout/stylesheets/application.css}" />
        <link rel="stylesheet" type="text/css" th:href="@{/layout/stylesheets/estilo-governo.css}" />

        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
            <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
          <![endif]-->
    </head>


    <body class="aw-layout-simple-page">
        <!-- HTML da Barra do governo /-->
        <th:block th:replace="layout/fragments/barra-governo"></th:block>
        <!-- HTML do Cabeçcalho do governo /-->
        <th:block th:replace="layout/fragments/cabecalho-governo"></th:block>

        <div class="aw-layout-simple-page__container">
            <form th:action="@{/usuarios/auto-cadastro}" method="POST" th:object="${usuario}" class="uppercase" autocomplete="off">

                <protocolo:message />

                <div class="aw-simple-panel">
                    <!--<img alt="dipla" th:src="@{/images/brasao-brasil.png}" width="80px" height="80px" />-->

                    <div class="aw-simple-panel__message">
                        <h2>Cadastro de Novo Usuário</h2>
                    </div>

                    <div th:if="${not #strings.isEmpty(mensagem)}">
                        <p>Um e-mail foi encaminhado para a validação de usuário.</p>
                        <p>Verifique as informações repassadas para obter o acesso.</p>
                    </div>

                    <div class="aw-simple-panel__box" th:if="${#strings.isEmpty(mensagem)}">

                        <div class="row">
                            <div class="form-group  col-sm-12  bw-required" brewer:classforerror="nome">
                                <input type="text" class="form-control nome" id="nome" th:field="*{nome}" size="50" autofocus="autofocus" placeholder="Nome" />
                            </div>
                        </div>


                        <div class="row">
                            <div class="form-group  col-sm-12 nome" brewer:classforerror="nome">
                                <input type="text" class="form-control nome" id="nome_social" th:field="*{nome_social}" size="50" autofocus="autofocus" placeholder="Nome Social" />
                            </div>
                        </div>

                        <div class="row">
                            <div class="form-group  col-sm-12 bw-required" brewer:classforerror="telefone">
                                <input type="text" class="form-control  js-phone-number" id="telefone" placeholder="Telefone" th:field="*{telefone}" />
                            </div>
                        </div>
                        <div class="row">                            
                            <div class="form-group  col-sm-12 bw-required" brewer:classforerror="email">
                                <input type="text" class="form-control email" id="email" th:field="*{email}" placeholder="E-Mail" maxlength="50" />
                            </div>
                        </div>

                        <div class="row">
                            <div class="form-group  col-sm-12 bw-required" brewer:classforerror="senha">
                                <input id="senha" type="password" class="form-control" placeholder="Senha" th:field="*{senha}" />
                            </div>
                        </div>
                        <div class="row">                            
                            <div class="form-group  col-sm-12 bw-required" brewer:classforerror="senha-confirmacao">
                                <input id="senha-confirmacao" type="password" class="form-control" placeholder="Confirmação da Senha" th:field="*{confirmacaoSenha}"/>
                            </div>
                        </div>
                        <div class="row">
                            <input type="hidden" name="grupos" th:value="2">
                        </div>
                        <div class="row justify-content-md-center">
							<div th:if="${erroCaptch}">
					            <div class="aw-simple-panel__message  is-error" th:text="${erroCaptchMsg}"></div>
					        </div>
                        	<div align="center" class=" form-group g-recaptcha col" th:attr="data-sitekey=${@captchaService.getReCaptchaSite()}" ></div>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn  btn-primary  btn-lg  aw-btn-full-width">SALVAR</button>
                        </div> 
                        
                    </div>     
                    <div class="aw-simple-panel__message">
                        <table class="table  table-hover">
                            <tbody>
                                <tr class="js-cliente-pesquisa-rapida">
                                    <td>
                                        <a th:href="@{/login}">
                                            <span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> VOLTAR
                                        </a>
                                    </td>                                                            
                                </tr>
                            </tbody>
                        </table>                                                                        
                    </div>
                </div>
            </form>
        </div>

        <!-- Rodape dinamico do governo federal /-->
        <div id="footer-brasil" class="footer-governo"></div>
     	<script src="https://www.google.com/recaptcha/api.js" async defer></script>
     	
        <script th:src="@{/layout/vendors/jquery/jquery.js}"></script>
        <script th:src="@{/layout/javascripts/vendors.min.js}"></script>
        <script th:src="@{/javascripts/vendors/jquery.mask.min.js}"></script>
        <script th:src="@{/layout/javascripts/dipla.js}"></script>
        <script th:src="@{/layout/javascripts/usuario.esqueci-senha.js}"></script>

        <!-- JS da Barra do governo /-->
        <script defer="defer" src="//barra.brasil.gov.br/barra.js" type="text/javascript"></script>
    </body>
</html>

<script type="application/javascript">

     $( document ).ready(function() {
        $('.nome').keyup(function(){
            $(this).val($(this).val().toUpperCase());
        });
 
        $('.email').keyup(function(){
            $(this).val($(this).val().toLowerCase());
        });
    });
     
     register(event){
   	    event.preventDefault();
   	 
   	    var formData= $('form').serialize();
   	    $.post(serverContext + "user/registration", formData, function(data){
   	        if(data.message == "success") {
   	        }
   	    })
   	    .fail(function(data) {
   	        grecaptcha.reset();
   	         
   	        if(data.responseJSON.error == "InvalidReCaptcha"){ 
   	            $("#captchaError").show().html(data.responseJSON.message);
   	        }
   	    }
   	}
</script>