PesquisaUsuarios.html
6.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang="pt" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/LayoutPadrao}" xmlns:data="http://www.thymeleaf.org/extras/data">
<head>
<title>Protocolo MP - Pesquisa de usuários</title>
</head>
<body>
<section layout:fragment="conteudo">
<div class="page-header">
<div class="container-fluid">
<div class="row">
<div class="col-xs-10">
<h1>Pesquisa de usuários</h1>
</div>
<div class="col-xs-2">
<div class="aw-page-header-controls">
<a class="btn btn-success" th:href="@{/usuarios/novo}">
<i class="glyphicon glyphicon-plus-sign"></i>
<span class="hidden-xs hidden-sm">NOVO USUÁRIO</span>
</a>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<form method="GET" th:object="${usuarioFilter}" th:action="@{/usuarios}">
<div class="row">
<div class="form-group col-sm-4">
<label class="control-label" style="text-transform: uppercase" for="nome">Nome</label>
<input type="text" class="form-control" id="nome" size="50" autofocus="autofocus" th:field="*{nome}" />
</div>
<div class="form-group col-sm-4">
<label class="control-label" style="text-transform: uppercase" for="email">E-mail</label>
<input type="text" class="form-control" id="email" th:field="*{email}" maxlength="50" />
</div>
<div class="form-group col-sm-4">
<label class="control-label" style="text-transform: uppercase">Grupos</label>
<div>
<th:block th:each="grupo : ${grupos}">
<div class="checkbox checkbox-inline">
<input type="checkbox" th:value="${grupo.codigo}" th:field="*{grupos}" />
<label th:for="${#ids.prev('grupos')}" th:text="${grupo.nome}">Administrador</label>
</div>
</th:block>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">PESQUISAR</button>
</form>
<div class="aw-datatable-toolbar">
<button class="btn btn-default btn-xs js-status-btn disabled" data:status="ATIVAR" data:url="@{/usuarios/status}">
<span>Ativar</span>
</button>
<button class="btn btn-default btn-xs js-status-btn disabled" data:status="DESATIVAR" data:url="@{/usuarios/status}">
<span>Desativar</span>
</button>
</div>
<div class="table-responsive bw-tabela-simples">
<table class="table table-hover">
<thead>
<tr>
<th class="table-usuarios-col-status">
<div class="checkbox aw-checkbox-no-margin">
<input type="checkbox" class="js-selecao-todos" />
<label></label>
</div>
</th>
<th>Nome</th>
<th>E-mail</th>
<th>Grupo</th>
<th>Status</th>
<th class="table-col-acoes"></th>
</tr>
</thead>
<tbody>
<tr th:each="usuario : ${pagina.conteudo}">
<td>
<div class="checkbox aw-checkbox-no-margin" th:if="${#authentication.principal.usuario.codigo != usuario.codigo}">
<input type="checkbox" class="js-selecao" data:codigo="${usuario.codigo}">
<label></label>
</div>
</td>
<td th:text="${usuario.nome}"></td>
<td th:text="${usuario.email}"></td>
<td>
<span th:each="grupo : ${usuario.grupos}" th:text="|${grupo.nome}${grupoStat.last ? '' : ', '}|"></span>
</td>
<td>
<th:block th:if="${usuario.ativo}">
<span class="label label-success">Ativo</span>
</th:block>
<th:block th:if="${not usuario.ativo}">
<span class="label label-danger">Inativo</span>
</th:block>
</td>
<td class="text-center">
<a class="btn btn-link btn-xs" title="Editar" th:href="@{/usuarios/{codigo}(codigo=${usuario.codigo})}">
<i class="glyphicon glyphicon-pencil"></i>
</a>
<a class="btn btn-link btn-xs js-btn-excluir-usuario" title="Excluir" data:url="@{/usuarios/{codigo}(codigo=${usuario.codigo})}">
<i class="glyphicon glyphicon-remove"></i>
</a>
</td>
</tr>
<tr th:if="${pagina.vazia}">
<td colspan="6">Nenhum usuário encontrado</td>
</tr>
</tbody>
</table>
</div>
<protocolo:pagination page="${pagina}" />
</div>
</section>
<th:block layout:fragment="javascript-extra">
<script th:src="@{/javascripts/multiselecao.js}"></script>
<script th:src="@{/javascripts/usuarios.tabela-itens.js}"></script>
</th:block>
</body>
</html>