-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCategoryTable.html
421 lines (415 loc) · 13.6 KB
/
CategoryTable.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
<!DOCTYPE html>
<html>
<head>
<title>Tabela de categorias | IVM Manager</title>
<meta
name="description"
content="Projeto de Bases de Dados (LEIC-A 2021/22) - Grupo 123"
/>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Bootstrap CSS-->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<!-- Favicons -->
<link
rel="apple-touch-icon"
sizes="180x180"
href="./static/icons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./static/icons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="./static/icons/favicon-16x16.png"
/>
<link rel="manifest" href="static/icons/site.webmanifest" />
<link
rel="mask-icon"
href="./static/icons/safari-pinned-tab.svg"
color="#5bbad5"
/>
<meta name="msapplication-TileColor" content="#2d89ef" />
<meta name="theme-color" content="#ffffff" />
<style>
/* Hide Scrollbar */
html {
overflow-x: hidden;
}
/* Fonts */
@font-face {
font-family: "Klavika-Light";
src: url("./static/fonts/klavika-light.otf");
}
.k-l {
font-family: "Klavika-Light";
}
@font-face {
font-family: "Klavika-Medium";
src: url("./static/fonts/klavika-medium.otf");
}
.k-m {
font-family: "Klavika-Medium";
}
@font-face {
font-family: "Klavika-Medium-Italic";
src: url("./static/fonts/klavika-medium-italic.otf");
}
.k-m-i {
font-family: "Klavika-Medium-Italic";
}
a.btn-primary:link,
a.btn-primary:visited {
background-color: rgb(5, 161, 230) !important;
border-color: #05a1e6 !important;
}
a.btn-primary:hover {
background-color: #0480b8 !important;
border-color: #0480b8 !important;
box-shadow: 0 0 15px 3px rgba(255, 255, 255, 0.1) !important;
}
table {
border-collapse: collapse;
width: 60%;
}
td,
th {
text-align: left;
padding: 5px;
border-right: 1.5px solid rgb(255, 255, 255, 0.5);
}
tr:nth-child(even) {
background-color: rgba(255, 255, 255, 0.25);
}
</style>
<!-- Vectors-->
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
style="display: none"
>
<symbol id="left-arrow" viewBox="0 0 16 16">
<path
d="M12 8a.5.5 0 0 1-.5.5H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H11.5a.5.5 0 0 1 .5.5z"
/>
</symbol>
<symbol id="right-arrow" viewBox="0 0 16 16">
<path
d="M4 8a.5.5 0 0 1 .5-.5h5.793L8.146 5.354a.5.5 0 1 1 .708-.708l3 3a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708-.708L10.293 8.5H4.5A.5.5 0 0 1 4 8z"
/>
</symbol>
<symbol id="cross" viewBox="0 0 16 16">
<path
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"
/>
</symbol>
<symbol id="plus" viewBox="0 0 16 16">
<path
d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"
/>
</symbol>
<symbol id="person" viewBox="0 0 16 16">
<path
d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"
/>
</symbol>
</svg>
</head>
<!--##########################################################################################################################-->
<body
class="d-flex flex-column min-vh-100"
background="./static/images/tecnico.png"
style="color: rgb(255, 255, 255)"
>
<!-- Top row -->
<div class="row" style="background-color: rgba(60, 60, 60, 0.8)">
<div class="col-sm-4">
<div class="d-flex justify-content-center">
<img
style="margin-top: 20px; margin-bottom: 20px"
src="./static/images/tecnico.svg"
alt="Instituto Superior Técnico"
width="150"
/>
</div>
</div>
<div class="col-sm-8">
<div style="margin-left: 30px; margin-top: 17.5px; margin-bottom: 25px">
<h3 class="k-m-i">IVM Manager</h3>
<h4 class="k-l" style="line-height: 10px">
Gestão de máquinas de venda inteligentes
</h4>
</div>
</div>
</div>
<!-- Functionality -->
<div class="text-center k-l">
{% if simple_c_rows and super_c_rows %}
<div>
<a href="../{{ FILENAME }}/" class="mt-4 btn btn-primary">
<svg class="bi" width="24" height="24" fill="white">
<use xlink:href="#left-arrow" />
</svg>
</a>
<a href="#" class="mt-4 btn btn-primary disabled">
Inserir e remover categorias e subcategorias
</a>
<a class="mt-4 btn disabled">
<svg class="bi" width="24" height="24" fill="white">
<use xlink:href="#right-arrow" />
</svg>
</a>
<a href="#" class="mt-4 btn btn-primary disabled"
>Tabela de categorias</a
>
<a href="category_independent" class="mt-4 btn btn-primary"
>Inserir categoria independente</a
>
</div>
<h3 class="mt-3 k-m" style="text-shadow: 2px 2px #0480b8">
Tabela de categorias
</h3>
<table
style="background-color: rgba(60, 60, 60, 0.8); margin: auto"
class="mt-3 mb-5 k-l"
>
<thead>
<tr style="background-color: rgba(255, 255, 255, 0.25)">
<th><div class="ms-3 mt-2 mb-2">Categoria</div></th>
<th><div class="ms-3 mt-2 mb-2">Inserir subcategoria</div></th>
<th style="border-right: 0px">
<div class="ms-3 mt-2 mb-2">Remover</div>
</th>
</tr>
</thead>
<tbody>
{% for record in super_c_rows %}
<tr>
<td>
<div class="d-flex">
<div class="p-2 k-m">
<div
class="spinner-grow spinner-grow-sm text-success me-1"
style="
background-color: rgba(0, 255, 0, 0.5);
height: 10px;
width: 10px;
margin-bottom: 2px;
"
></div>
{{ record[0] }}
</div>
<div class="ms-auto p-2" style="line-height: 0px">
<span class="badge bg-warning" style="color: black"
>Super Categoria</span
>
</div>
</div>
</td>
<td>
<form
class="form-inline"
action="category_add_to_super"
method="post"
style="color: black"
>
<div class="row d-flex justify-content-center">
<div
class="input-group input-group-sm col-3"
style="width: 250px"
>
<span class="input-group-text" id="inputGroup-sizing-sm"
>Nome</span
>
<input
type="text"
class="form-control"
id="inputGroup-sizing-sm"
placeholder="Subcategoria"
name="simple_c_name"
/>
<input
type="hidden"
name="super_c_name"
value="{{ record[0] }}"
/>
</div>
<button
type="submit"
class="btn btn-primary btn-sm col-2"
style="width: 50px"
>
<svg class="bi" width="20" height="20" fill="white">
<use xlink:href="#plus" />
</svg>
</button>
</div>
</form>
</td>
<td style="border-right: 0px">
<div class="d-flex justify-content-center">
<a
href="category_remove?c_name={{ record[0] }}"
class="btn btn-danger btn-sm"
style="width: 50px"
>
<svg class="bi" width="20" height="20" fill="white">
<use xlink:href="#cross" />
</svg>
</a>
</div>
</td>
</tr>
{% endfor %} {% for record in simple_c_rows %}
<tr>
<td>
<div class="d-flex">
<div class="p-2 k-m">
<div
class="spinner-grow spinner-grow-sm text-success me-1"
style="
background-color: rgba(0, 255, 0, 0.5);
height: 10px;
width: 10px;
margin-bottom: 2px;
"
></div>
{{ record[0] }}
</div>
<div class="ms-auto p-2" style="line-height: 0px">
<span class="badge bg-dark" style="color: white"
>Categoria Simples</span
>
</div>
</div>
</td>
<td>
<form
class="form-inline"
action="category_add_to_super"
method="post"
style="color: black"
>
<div class="row d-flex justify-content-center">
<div
class="input-group input-group-sm col-3"
style="width: 250px"
>
<span class="input-group-text" id="inputGroup-sizing-sm"
>Nome</span
>
<input
type="text"
class="form-control"
id="inputGroup-sizing-sm"
placeholder="Subcategoria"
name="simple_c_name"
/>
<input
type="hidden"
name="super_c_name"
value="{{ record[0] }}"
/>
</div>
<button
type="submit"
class="btn btn-primary btn-sm col-2"
style="width: 50px"
>
<svg class="bi" width="20" height="20" fill="white">
<use xlink:href="#plus" />
</svg>
</button>
</div>
</form>
</td>
<td style="border-right: 0px">
<div class="d-flex justify-content-center">
<a
href="category_remove?c_name={{ record[0] }}"
class="btn btn-danger btn-sm"
style="width: 50px"
>
<svg class="bi" width="20" height="20" fill="white">
<use xlink:href="#cross" />
</svg>
</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h3 class="mt-3 k-m" style="text-shadow: 2px 2px red">
Erro: Não foi possível obter os dados da base de dados!
</h3>
{% endif %}
</div>
<!-- Bottom row -->
<div class="row mt-auto" style="background-color: rgba(60, 60, 60, 0.8)">
<div class="col-sm-5">
<div
class="k-m"
style="margin-top: 30px; margin-bottom: 30px; margin-left: 30px"
>
<h5 class="k-m-i">Intelligent Vending Machine Manager™</h5>
<h6 class="k-m">
Projeto de Bases de Dados (LEIC-A 21/22) - Grupo 123
</h6>
<h6 class="k-l" style="color: rgb(170, 170, 170)">
© Instituto Superior Técnico, 2022
</h6>
</div>
</div>
<div class="col-sm-2"></div>
<div class="col-sm-5">
<div
class="k-m"
style="margin-top: 30px; margin-bottom: 30px; margin-left: 30px"
>
<h5 class="k-m">Feito com 💙 por:</h5>
<div class="k-m">
<svg
class="bi"
width="20"
height="20"
fill="white"
style="margin-right: 5px"
>
<use xlink:href="#person" /></svg
>Inês Oliveira         
<svg
class="bi"
width="20"
height="20"
fill="white"
style="margin-right: 5px"
>
<use xlink:href="#person" /></svg
>João Cardoso         
<svg
class="bi"
width="20"
height="20"
fill="white"
style="margin-right: 5px"
>
<use xlink:href="#person" /></svg
>José João Ferreira
</div>
</div>
</div>
</div>
</body>
</html>