Skip to content

Commit 67cbed2

Browse files
committed
Major UI improvements
1 parent f782f01 commit 67cbed2

File tree

4 files changed

+70
-7
lines changed

4 files changed

+70
-7
lines changed

src/main/java/com/kafkastream/web/EventsRestController.java renamed to src/main/java/com/kafkastream/archived/EventsRestController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.kafkastream.web;
1+
package com.kafkastream.archived;
22

33
import com.kafkastream.dto.CustomerOrderDTO;
44
import com.kafkastream.model.Customer;

src/main/java/com/kafkastream/web/EventsController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ public String getAllOrders(Model model)
7070
return "orders";
7171
}
7272

73-
@GetMapping("/customer-orders/all")
73+
@GetMapping(value = {"/customer-orders","/customer-orders/all"})
7474
public String getAllCustomersOrders(Model model)
7575
{
76-
model.addAttribute("customer-orders",customRestTemplateService.getAllCustomersOrders());
76+
model.addAttribute("customerorders",customRestTemplateService.getAllCustomersOrders());
7777
return "customer-orders";
7878
}
7979

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html>
2+
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Customer Orders List</title>
6+
7+
<!-- Bootstrap CSS -->
8+
<link href="css/bootstrap.min.css" rel="stylesheet">
9+
10+
<!-- Bootstrap JS -->
11+
<script src="js/jquery.slim.min.js"></script>
12+
<script src="js/popper.min.js"></script>
13+
<script src="js/bootstrap.min.js"></script>
14+
</head>
15+
<body>
16+
<div class="container container-fluid">
17+
<h1> Customer Orders List</h1>
18+
<br/> <br/>
19+
<table class="table table-bordered">
20+
<thead class="font-weight-bold">
21+
<tr>
22+
<td> Customer Id</td>
23+
<td> First Name</td>
24+
<td> Last Name</td>
25+
<td> Email</td>
26+
<td> Phone</td>
27+
<td> Order Id</td>
28+
<td> Item Name</td>
29+
<td> Order Place</td>
30+
<td> Purchase Time</td>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
<tr th:if="${customerorders.empty}">
35+
<td colspan="2"> No Customers Available </td>
36+
</tr>
37+
<tr th:each="customerorder: ${customerorders}">
38+
<td th:text="${customerorder.customerId}"></td>
39+
<td th:text="${customerorder.firstName}">/td>
40+
<td th:text="${customerorder.lastName}"></td>
41+
<td th:text="${customerorder.email}"></td>
42+
<td th:text="${customerorder.phone}"></td>
43+
<td th:text="${customerorder.orderId}">/td>
44+
<td th:text="${customerorder.orderItemName}"></td>
45+
<td th:text="${customerorder.orderPlace}"></td>
46+
<td th:text="${customerorder.orderPurchaseTime}"></td>
47+
</tr>
48+
</tbody>
49+
</table>
50+
51+
<br/> <br/>
52+
<p>
53+
<a href="/home" th:href="@{/}">Home</a>
54+
</p>
55+
</div>
56+
</body>
57+
</html>

src/main/resources/templates/home.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,33 @@
1313
<script src="js/bootstrap.min.js"></script>
1414
</head>
1515
<body>
16-
<br/> <br/>
16+
1717
<div class="container container-fluid" style="margin-bottom: 50px">
1818
<h1> Home</h1>
1919

20+
<br/>
21+
<h4>Customer Orders</h4>
22+
<div class="card">
23+
<div class="card-body"><a href="customer-orders">Customer Orders</a></div>
24+
</div>
25+
2026
<br/> <br/>
21-
<h4>Customer Management</h4>
27+
<h4>Customers</h4>
2228
<div class="card">
2329
<div class="card-body"><a href="customers">Customers</a></div>
2430
<div class="card-footer"><a href="create-customer">Create New Customer</a></div>
2531
</div>
2632

2733
<br/> <br/>
28-
<h4>Order Management</h4>
34+
<h4>Orders</h4>
2935
<div class="card">
3036
<div class="card-body"><a href="orders">Orders</a></div>
3137
<div class="card-footer"><a href="create-order">Create New Order</a></div>
3238
</div>
3339

3440

3541
<br/> <br/>
36-
<h4>Greetings Management</h4>
42+
<h4>Greetings</h4>
3743
<div class="card">
3844
<div class="card-body"><a href="greetings">Greetings</a></div>
3945
<div class="card-footer"><a href="create-greeting">Create New Greeting</a></div>

0 commit comments

Comments
 (0)