forked from gabriellsh/frontend-intern-challange
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
192 lines (182 loc) · 11.2 KB
/
index.html
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="https://fonts.googleapis.com/css?family=Biryani|Raleway" rel="stylesheet">
<title>CRUD</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" integrity="sha384-gfdkjb5BdAXd+lj+gudLWI+BXq4IuLW5IT+brZEZsLFm++aCMlF1V92rMkPaX4PP"
crossorigin="anonymous">
<link rel="stylesheet" type="text/css" media="screen" href="css/custom.css" />
</head>
<body>
<video autoplay loop id="video-background">
<source src="img/Busy-People.mp4" type="video/mp4">
</video>
<section>
<div class="container">
<header class="text-center pt-5">
<img class="" src="img/logo-atv2.png" />
</header>
<div class="row px-lg-2 pt-4">
<!-- Modal do form de inserção -->
<div class="modal fade" id="create-modal" tabindex="-1" role="dialog" aria-labelledby="create-modal"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Inserir</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="#" id="create">
<div class="form-row">
<div class="form-group col-12">
<label for="c-nome">Nome:</label>
<input id="c-nome" class="form-control needs-validation" type="text" name="nome" required>
<small id="passwordHelpBlock" class="form-text text-muted">
Obrigatório
</small>
</div>
<div class="form-group col-12">
<label for="c-email">E-mail:</label>
<input id="c-email" class="form-control needs-validation" type="email" name="email" required>
<small id="passwordHelpBlock" class="form-text text-muted">
Obrigatório
</small>
</div>
<div class="form-group col-12 col-lg-6">
<label for="c-telefone">Telefone:</label>
<input id="c-telefone" class="form-control" type="tel" name="telefone">
</div>
<div class="form-group col-12 col-lg-6">
<label for="c-data-nasc">Data de nascimento:</label>
<input id="c-data-nasc" class="form-control" type="date" name="nascimento">
</div>
<div class="form-group col-12">
<label for="c-cidade-nasc">Cidade onde nasceu:</label>
<input id="c-cidade-nasc" class="form-control" type="text" name="cidade">
</div>
<div class="form-group col-12">
<input class="btn btn-secondary" type="reset" value="Limpar">
<button id="c-submit" class="btn btn-primary" type="submit" data-dismiss="modal">Enviar</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Menu de busca (e botão que abre o modal de inserção) -->
<div class="col-12 pb-2">
<form action="#" id="read">
<div class="form-inline">
<div class="col-2 my-1">
<button type="button" class="btn btn-primary f-left" data-toggle="modal" data-target="#create-modal">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="col-12 offset-lg-2 col-lg-6 my-1">
<input id="r-search" placeholder="Buscar..." class="form-control w-100" type="search">
</div>
<div class="col-8 col-sm-5 col-lg-2 my-1">
<select class="custom-select float-lg-right" id="search-options">
<!-- Busca por nome por default -->
<option value="nome" selected>Nome</option>
<option value="email">Email</option>
<option value="telefone">Telefone</option>
<option value="cidade">Cidade</option>
<option value="nascimento">Nascimento</option>
</select>
</div>
<div class="col-4 col-sm-7 my-1 d-lg-none">
<input id="r-submit" class="btn btn-primary float-right" type="submit" value="Buscar">
</div>
</div>
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<!-- Onde será gerada a tabela -->
<div class="col-12">
<div class="table-responsive mt-2">
<table id="table-list" class="table">
</table>
</div>
</div>
</div>
<!-- Modal do form de update -->
<div class="modal fade" id="update-modal" tabindex="-1" role="dialog" aria-labelledby="update-modal"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Editar</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form id="update">
<div class="form-row">
<div class="form-group col-12">
<label for="u-nome">Nome:</label>
<input id="u-nome" class="form-control" type="text" name="nome" required>
<small id="passwordHelpBlock" class="form-text text-muted">
Obrigatório
</small>
</div>
<div class="form-group col-12">
<label for="u-email">E-mail:</label>
<input id="u-email" class="form-control" type="email" name="email" required>
<small id="passwordHelpBlock" class="form-text text-muted">
Obrigatório
</small>
</div>
<div class="form-group col-12 col-lg-6">
<label for="u-telefone">Telefone:</label>
<input id="u-telefone" class="form-control" type="tel" name="telefone">
</div>
<div class="form-group col-12 col-lg-6">
<label for="u-data-nasc">Data de nascimento:</label>
<input id="u-data-nasc" class="form-control" type="date" name="nascimento">
</div>
<div class="form-group col-12">
<label for="u-cidade-nasc">Cidade onde nasceu:</label>
<input id="u-cidade-nasc" class="form-control" type="text" name="cidade">
</div>
<div class="form-group col-12">
<input class="btn btn-secondary" type="reset" value="Limpar">
<button id="u-submit" class="btn btn-primary" type="submit" data-dismiss="modal">Enviar</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
</div>
</div>
</section>
<!-- CDN do jquery, popper e bootstrap -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<!-- Modulo para popular a tabela (usado pra testes) -->
<!-- Instrução dentro do construtor do MyCrud -->
<script src="js/populate.js"></script>
<!-- Meu arquivo -->
<script src="js/crud.js"></script>
</body>
</html>