-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
58 lines (41 loc) · 1000 Bytes
/
Copy pathadmin.html
File metadata and controls
58 lines (41 loc) · 1000 Bytes
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
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Admin Panel</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-4">
<h2>Admin Panel</h2>
<hr>
<h3>Products</h3>
<table class="table">
<tr>
<th>Name</th>
<th>Stock</th>
<th>Action</th>
</tr>
<tr th:each="p : ${products}">
<td th:text="${p.title}"></td>
<td th:text="${p.stock}"></td>
<td>
<form action="/restock" method="post">
<input type="hidden" name="id" th:value="${p.id}">
<button class="btn btn-success btn-sm">Restock +10</button>
</form>
</td>
</tr>
</table>
<hr>
<h3>Users & Purchase History</h3>
<div th:each="u : ${users}" class="mb-3">
<p><strong th:text="${u.name}"></strong></p>
<ul>
<li th:each="p : ${u.purchasedProducts}" th:text="${p.title}"></li>
</ul>
<p>Points: <span th:text="${u.loyaltyPoints}"></span></p>
</div>
<a href="/" class="btn btn-dark">Back to Store</a>
</div>
</body>
</html>