Skip to content

Commit

Permalink
add mask telefone e add regras de exportar e filtrar fichas
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeuCamurca committed Aug 20, 2020
1 parent 3055fe7 commit cf4a759
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/seminario/security/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ protected void configure(HttpSecurity http) throws Exception{
.antMatchers(HttpMethod.GET, "/").hasAnyRole("ADMIN","USER")
.antMatchers(HttpMethod.GET, "/fichas").hasAnyRole("ADMIN","USER")
.antMatchers("/fichas/{id}").hasAnyRole("ADMIN","USER")
.antMatchers(HttpMethod.GET, "/paroquias").hasAnyRole("ADMIN","USER")
.antMatchers(HttpMethod.GET, "/exportar").hasAnyRole("ADMIN","USER")
.antMatchers(HttpMethod.GET,"/cadastrarFicha").hasRole("ADMIN")
.antMatchers(HttpMethod.GET,"/deletar/{id}").hasRole("ADMIN")
.antMatchers(HttpMethod.POST,"/cadastrarFicha").hasRole("ADMIN")
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/templates/usuarios.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,20 @@ <h5 class="modal-title" style="color: black; font-weight: bold;">ATUALIZAR USUÁ
$('#telefone').mask(behavior, options);
</script>

<script type="text/javascript">
//mascara do telefone
var behavior = function(val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000'
: '(00) 0000-00009';
}, options = {
onKeyPress : function(val, e, field, options) {
field.mask(behavior.apply({}, arguments), options);
}
};

$('#telefone_edit').mask(behavior, options);
</script>

<script type="text/javascript">
$("#form_add").on('submit', function (event) {
event.preventDefault();
Expand Down

0 comments on commit cf4a759

Please sign in to comment.