-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
629 lines (563 loc) · 27.6 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
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Link to css file -->
<link rel="stylesheet" href="styles/main.css">
<!-- Link icons Material Design -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Title for the web -->
<title>API Crud Manager</title>
<!-- Import to Firebase library -->
<script src="https://www.gstatic.com/firebasejs/9.0.2/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.2/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.2/firebase-database-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.2/firebase-storage-compat.js"></script>
<!-- library to get the unique ID -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/node-uuid/1.4.7/uuid.min.js"></script>
<!-- import library of the dialog alert SweetAlert -->
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
</head>
<body>
<!-- Header -->
<header>
<nav class="navbar" role="navigation" aria-label="main navigation">
<!-- Name and link to the home -->
<div class="navbar-brand">
<a class="navbar-item" href="/">
<span class="titleIcon material-icons md-35"> api </span>
<span class="titleText">Api Manager</span>
</a>
</div>
<!-- user login -->
<div id="loginUser">
<div id="textContainerLogin">
<label id="userName" for="name"></label>
<p></p>
<label id="SecurityLevel" for="SecurityLevel"></label>
<a id="logoutLink" onclick="logoutSession()">LogOut</a>
</div>
<div id="userAvatar">
<img id="userAvatarIMG" class="circular--square" src=" ">
</div>
</div>
</nav>
</header>
<!-- Main Content -->
<main class="main-content" >
<div class="crud-container" >
<!-- Panel for put the title, search-field and insert new product -->
<div id="main-control">
<!-- left side => title -->
<div id="title-table">
<h1><span class="material-icons md-18"> push_pin </span>Products list</h1>
</div>
<!-- center side => search-field -->
<div id="search-field">
<input id="search-field-input" onkeyup="tableSearchFilter()" class="input" type="text" placeholder="Search...">
</div>
<!-- right side => insert-new-product -->
<div id="addnewProduct-btn">
<button class="button is-success" id="insertProduct">
<span class="material-icons md-24"> note_add </span>
<span> Add Product</span>
</button>
</div>
</div>
<!-- div to wrapp the table and control the scroll -->
<div id="table-Container">
<!-- Tabla -->
<table class="table">
<thead id="table-products-headers" class="table-header">
<tr class="main-header">
<th class="header-order-by" style="border-radius: 1rem 0 0 0;">#</th>
<th class="header-order-by">Name <span class="material-icons md-18"></span></th>
<th class="header-order-by">Origin <span class="material-icons md-18"></span></th>
<th class="header-order-by">Price <span class="material-icons md-18"></span></th>
<th class="header-order-by">Discount <span class="material-icons md-18"></span></th>
<th class="header-order-by">MOQ</th>
<th class="header-order-by">Category <span class="material-icons md-18"></span></th>
<th class="header-order-by">Sales Unit <span class="material-icons md-18"></span></th>
<th class="header-order-by" style="border-radius: 0 1rem 0 0;">Options</th>
</tr>
</thead>
<tbody id="products-table"></tbody>
</table>
</div>
</div>
</main>
<!-- Card to insert new product -->
<div class="modal" id="modal-insert-product">
<div class="modal-background"></div>
<div class="modal-card">
<!-- header of the Card to insert new product -->
<header class="modal-card-head">
<p class="modal-card-title">
<span class="titleIcon material-icons md-24"> double_arrow </span>
Insert new product
</p>
<button class="delete" aria-label="close" id="closeRegisterModal"></button>
</header>
<section class="modal-card-body">
<!-- Content ... -->
<form id="newProduct-form">
<!-- field product name -->
<div class="field">
<label class="label">Name *</label>
<div class="control">
<input class="input" type="text" id="productName" placeholder="Product Name">
</div>
</div>
<!-- field origin -->
<div class="field">
<label class="label">Origin *</label>
<div class="control">
<input class="input" type="text" id="origin" placeholder="Origin">
</div>
</div>
<!-- table to share the space between Price, MOQ, Discount-->
<table class="table" style="margin-bottom: 0rem !important;">
<tbody>
<tr>
<!-- style to use all space of the field -->
<th style="padding: 0rem 0rem 1rem 0rem;">
<!-- field price -->
<div class="field">
<label class="label">Price *</label>
<div class="control">
<input class="input" type="number" step="0.01" id="price" placeholder="Price">
</div>
</div>
</th>
<!-- style to use all space of the field -->
<th style="padding: 0rem 1rem 0rem 1rem;">
<!-- field MOQ -->
<div class="field">
<label class="label">MOQ *</label>
<div class="control">
<input class="input" type="number" id="MOQ" placeholder="Min Quantity Order">
</div>
</div>
</th>
<!-- style to use all space of the field -->
<th style="padding: 0rem 0rem 1rem 0rem;">
<!-- field discount -->
<div class="field">
<label class="label">Discount *</label>
<div class="control">
<input class="input" type="number" id="discount" placeholder="Discount">
</div>
</div>
</th>
</tr>
</tbody>
</table>
<!-- table to share the space between category, sales unit -->
<table style="margin-bottom: 1rem;">
<th>
<!-- Category -->
<div class="field">
<label class="label">Category *</label>
<div class="control">
<div class="select">
<select id="category">
<option>Select category</option>
<option value="1">Fruits</option>
<option value="2">Vergetables</option>
<option value="3">Fresh Herbs</option>
<option value="4">Dried Fruits and Nusts</option>
<option value="5">Mushrooms</option>
<option value="0">Others</option>
</select>
</div>
</div>
</div>
</th>
<th style="padding: 0 0 0 1rem;">
<!-- Sales Unit -->
<div class="field">
<label class="label">Sales Unit *</label>
<div class="control">
<div class="select">
<select id="salesUnit">
<option>Select option</option>
<option>Unit</option>
<option>Kg</option>
<option>g</option>
<option>Bunsh</option>
</select>
</div>
</div>
</div>
</th>
</table>
<!-- complement to show the checkBoxs for: Available, Disable and InSeason -->
<fieldset>
<legend> Choose you features...</legend>
<!-- Control check Available -->
<div class="switch" style="display: flex;">
<label style="padding-right: 10px;">Available</label>
<input type="checkbox" id="isAvailableCheck" checked>
</div>
<!-- Control check disable -->
<div class="switch" style="display: flex;">
<label style="padding-right: 10px;">Disable</label>
<input type="checkbox" id="isDisableCheck">
</div>
<!-- Control check Season -->
<div class="switch" style="display: flex;">
<label style="padding-right: 10px;">Season</label>
<input type="checkbox" id="inSeasonCheck">
</div>
</fieldset>
<!-- Description Field -->
<div class="field">
<label class="label">Description</label>
<div class="control">
<textarea class="textarea" id="description" placeholder="Product Description..."></textarea>
</div>
</div>
<!-- Complement to select and show product image -->
<div class="image-selector">
<div class="container">
<div class="wrapper">
<div onclick="defaultBtnActive()" class="image">
<img id="Image-load" src=" " alt="">
</div>
<div class="content">
<div class="icon"><span class="material-icons md-48"> cloud_upload </span></div>
<div class="text">No file chosen, yet!</div>
</div>
<div id="cancel-btn"><span class="material-icons md-18"> close </span></div>
<div class="fileName">File name here</div>
</div>
<input id="default-btn" type="file" hidden accept="image/png, image/jpg">
<button type="button" onclick="defaultBtnActive()" id="custom-btn">Choose a file</button>
</div>
</div>
</section>
<!-- Footer of the form to insert new product -->
<footer class="modal-card-foot">
<button type="submit" class="button is-success">
<span class="material-icons md-24"> save </span>
<span> Insert </span>
</button>
</form>
</footer>
</div>
</div>
<!-- Card to Update product -->
<div class="modal" id="modal-update-product">
<div class="modal-background"></div>
<div class="modal-card">
<!-- header of the Card to insert new product -->
<header class="modal-card-head">
<p class="modal-card-title">
<span class="titleIcon material-icons md-24"> double_arrow </span>
Update product
</p>
<button class="delete" aria-label="close" id="closeUpdateModal"></button>
</header>
<!-- section of the form to wrap all form -->
<section class="modal-card-body">
<!-- Content ... -->
<form id="updateProduct-form">
<!-- field product name -->
<div class="field">
<label class="label">Name *</label>
<div class="control">
<input class="input" type="text" id="productName" placeholder="Product Name">
</div>
</div>
<!-- field origin -->
<div class="field">
<label class="label">Origin *</label>
<div class="control">
<input class="input" type="text" id="origin" placeholder="Origin">
</div>
</div>
<!-- table to share the space between Price, MOQ, Discount-->
<table class="table" style="margin-bottom: 0rem !important;">
<tbody>
<tr>
<!-- style to use all space of the field -->
<th style="padding: 0rem 0rem 1rem 0rem;">
<!-- field price -->
<div class="field">
<label class="label">Price *</label>
<div class="control">
<input class="input" type="number" step="0.01" id="price" placeholder="Price">
</div>
</div>
</th>
<!-- style to use all space of the field -->
<th style="padding: 0rem 1rem 0rem 1rem;">
<!-- field MOQ -->
<div class="field">
<label class="label">MOQ *</label>
<div class="control">
<input class="input" type="number" id="MOQ" placeholder="Min Quantity Order">
</div>
</div>
</th>
<!-- style to use all space of the field -->
<th style="padding: 0rem 0rem 1rem 0rem;">
<!-- field discount -->
<div class="field">
<label class="label">Discount *</label>
<div class="control">
<input class="input" type="number" id="discount" placeholder="Discount">
</div>
</div>
</th>
</tr>
</tbody>
</table>
<!-- table to share the space between category, sales unit -->
<table style="margin-bottom: 1rem;">
<th>
<!-- Category -->
<div class="field">
<label class="label">Category *</label>
<div class="control">
<div class="select">
<select id="category">
<option>Select category</option>
<option value="1">Fruits</option>
<option value="2">Vergetables</option>
<option value="3">Fresh Herbs</option>
<option value="4">Dried Fruits and Nusts</option>
<option value="5">Mushrooms</option>
<option value="0">Others</option>
</select>
</div>
</div>
</div>
</th>
<th style="padding: 0 0 0 1rem;">
<!-- Sales Unit -->
<div class="field">
<label class="label">Sales Unit *</label>
<div class="control">
<div class="select">
<select id="salesUnit">
<option>Select option</option>
<option>Unit</option>
<option>Kg</option>
<option>g</option>
<option>Bunsh</option>
</select>
</div>
</div>
</div>
</th>
</table>
<!-- complement to show the checkBoxs for: Available, Disable and InSeason -->
<fieldset>
<legend> Choose you features...</legend>
<!-- Control check Available -->
<div class="switch" style="display: flex;">
<label style="padding-right: 10px;">Available</label>
<input type="checkbox" id="isAvailableCheck-update">
</div>
<!-- Control check disable -->
<div class="switch" style="display: flex;">
<label style="padding-right: 10px;">Disable</label>
<input type="checkbox" id="isDisableCheck-update">
</div>
<!-- Control check Season -->
<div class="switch" style="display: flex;">
<label style="padding-right: 10px;">Season</label>
<input type="checkbox" id="inSeasonCheck-update">
</div>
</fieldset>
<!-- Description Field -->
<div class="field">
<label class="label">Description</label>
<div class="control">
<textarea class="textarea" id="description" placeholder="Product Description..."></textarea>
</div>
</div>
<!-- Complement to select and show product image -->
<div class="image-selector">
<div class="container">
<div class="wrapper">
<div onclick="defaultBtnActive()" class="image">
<img id="Image-load-udate-form" src=" " alt="">
</div>
<div class="content">
<div class="icon"><span class="material-icons md-48"> cloud_upload </span></div>
<div class="text">No file chosen, yet!</div>
</div>
<div id="cancel-btn"><span class="material-icons md-18"> close </span></div>
<div class="fileName">File name here</div>
</div>
<input id="default-btn" type="file" hidden accept="image/png, image/jpg">
<button type="button" onclick="defaultBtnActive()" id="custom-btn">Choose a file</button>
</div>
</div>
</section>
<!-- Footer of the form to insert new product -->
<footer class="modal-card-foot">
<button type="submit" class="button is-success">
<span class="material-icons md-24"> save </span>
<span> Update </span>
</button>
</form>
</footer>
</div>
</div>
<!-- card for implement product details -->
<div class="modal" id="modal-show-details">
<div class="modal-background"></div>
<div class="modal-card">
<!-- header of the modal -->
<header class="modal-card-head">
<p class="modal-card-title">
<span class="titleIcon material-icons md-24"> double_arrow </span>
Product Details
</p>
<button class="delete" aria-label="close" id="closeShowDetailsModal">
</header>
<!-- main container -->
<div id="main-seccion-product-details">
<!-- Seccion for the Imagen of product -->
<div id="imageSeccion">
<img id="productImage-FormDetails" src="https://firebasestorage.googleapis.com/v0/b/grocerystore-justjump.appspot.com/o/ImageStore%2Ffruit_red_apple.jpg?alt=media&token=0733a1b9-0cb6-495f-8f48-82b7f6ab1974">
</div>
<!-- seccion for the product Information -->
<div id="informationSeccion">
<!-- Product name and category -->
<div id="" style="display: flex; width: 100%;">
<div style="width: 50%;">
<!-- container of label product name -->
<div style="display: contents; width: 50%;">
<label style="font-size: 12px;">Product Name:</label>
<hr id="lineUnderProductName"/>
</div>
</div>
<div style="width: 50%; display: flex; justify-content: end;">
<!-- container of the category label -->
<div>
<label id="labelCategory-FormDetails"></label>
</div>
</div>
</div>
<!-- container of product name -->
<div>
<label id="productName-formDetails">Washington Apple</label>
</div>
<!-- container of description of product -->
<div>
<p id="description-formDetails"></p>
</div>
<!-- container of MOQ, Discount and price -->
<div id="container-value">
<div id="MOQ-formDetails"></div>
<div id="showDiscount">
<label id="price-formDetails"></label>
<label id="discount-formDetails"></label>
</div>
<div> <label id="finalPrice-formDetails">1,98 £</label> </div>
</div>
<!-- container spacer red line -->
<div style="display: flex; justify-content: center;">
<hr id="separeLine"/>
</div>
<div style="padding-top: 20px; padding-bottom: 20px; font-size: 12px; color: #829ba7">
<!-- information of the origin of the product -->
<div style="display: flex;">
<label>Origin </label> <p id="origin-formDetails"></p>
</div>
<!-- date when the product was inserted -->
<div style="display: flex;">
<label>Date of inserted: </label> <p id="dateInserted-formDetails"></p>
</div>
<!-- seccion to show the property Season, Available, Disable -->
<div id="containerCheckbox">
<!-- InSeason -->
<div style="display: flex;">
<label>In Season: </label> <p class="checkboxes" id="inSeason-formDetails"></p>
</div>
<!-- isAvailable -->
<div style="display: flex;">
<label>Is Available: </label> <p class="checkboxes" id="isAvailable-formDetails"></p>
</div>
<!-- isDisable -->
<div style="display: flex;">
<label>Is Disable: </label> <p class="checkboxes" id="isDisable-formDetails"></p>
</div>
</div>
</div>
<!-- Container of products IDs -->
<div style="font-size: 12px; padding-left: 1.5rem; color: #829ba7">
<!-- IDProduct -->
<div style="display: flex;">
<label class="checkboxes">IDProduct: </label> <p id="IDProduct-formDetails"></p>
</div>
<!-- UID -->
<div style="display: flex;">
<label class="checkboxes">UID: </label> <p id="UID-formDetails"></p>
</div>
</div>
</div>
</div>
<!-- button to close the modal -->
<button type="submit" id="buttonCloseModalDetails" class="button is-success">
<span> Close </span>
</button>
</div>
</div>
<!-- card for implement login user-->
<div class="modal" id="modal-user-auth">
<div class="modal-background"></div>
<div class="modal-card">
<!-- header of the Card to show details product -->
<header class="modal-card-head">
<p style="text-align: center;" class="modal-card-title">Login</p>
</header>
<section class="modal-card-body">
<!-- Content ... -->
<form id="user-auth-form" style="padding-right: 8rem; padding-left: 8rem;">
<div style="width: 100%; height: 120px; display: flex; justify-content: center; align-content: center; align-items: center;">
<img src="https://firebasestorage.googleapis.com/v0/b/grocerystore-justjump.appspot.com/o/IconsWeb%2Fadd-friend.png?alt=media&token=01a8a68f-0308-4daa-a1e7-874c6fae7152" style="width: 120px;">
</div>
<div class="field">
<label class="label">User (Email)</label>
<div class="control has-icons-left">
<input id="emailUserForm" class="input" type="text" placeholder="example@test.com">
<span class="icon is-small is-left">
<span class="material-icons md-18">person</span>
</span>
</div>
</div>
<div class="field">
<label class="label">Password</label>
<div class="control has-icons-left">
<input id="passwordUserForm" class="input" type="password" type="text" placeholder="Password...">
<span class="icon is-small is-left">
<span class="material-icons md-18">lock</span>
</span>
</div>
</div>
<div style="display: flex; justify-content: end; align-items: center;">
<label class="checkbox">
<input id="saveSession" type="checkbox">
Keep me signed in
</label>
</div>
</section>
<footer class="modal-card-foot" style="justify-content: right;">
<button type="submit" class="button is-success">
<span> Login </span>
</button>
</form>
</footer>
</div>
</div>
<!-- Link to Js files -->
<script src="js/app.js"></script>
</body>
</html>