Spaces:
Sleeping
Sleeping
Update templates/order_history.html
Browse files- templates/order_history.html +28 -75
templates/order_history.html
CHANGED
|
@@ -4,86 +4,39 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Order History</title>
|
| 7 |
-
<!-- Bootstrap CSS -->
|
| 8 |
-
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 9 |
<style>
|
| 10 |
-
body {
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
max-width: 800px;
|
| 16 |
-
margin: 40px auto;
|
| 17 |
-
background-color: white;
|
| 18 |
-
padding: 20px;
|
| 19 |
-
border-radius: 10px;
|
| 20 |
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 21 |
-
}
|
| 22 |
-
.order-item {
|
| 23 |
-
border: 1px solid #ddd;
|
| 24 |
-
padding: 15px;
|
| 25 |
-
border-radius: 8px;
|
| 26 |
-
margin-bottom: 15px;
|
| 27 |
-
background-color: #fffaf0;
|
| 28 |
-
}
|
| 29 |
-
.order-title {
|
| 30 |
-
font-size: 1.2rem;
|
| 31 |
-
font-weight: bold;
|
| 32 |
-
color: #c04e01;
|
| 33 |
-
}
|
| 34 |
-
.order-details {
|
| 35 |
-
font-size: 0.9rem;
|
| 36 |
-
color: #6c757d;
|
| 37 |
-
}
|
| 38 |
-
.total-bill {
|
| 39 |
-
font-weight: bold;
|
| 40 |
-
color: #2b9348;
|
| 41 |
-
}
|
| 42 |
-
.back-btn {
|
| 43 |
-
display: block;
|
| 44 |
-
width: 100%;
|
| 45 |
-
margin-top: 20px;
|
| 46 |
-
padding: 10px;
|
| 47 |
-
background-color: #007bff;
|
| 48 |
-
color: white;
|
| 49 |
-
text-align: center;
|
| 50 |
-
border-radius: 5px;
|
| 51 |
-
text-decoration: none;
|
| 52 |
-
font-weight: bold;
|
| 53 |
-
}
|
| 54 |
-
.back-btn:hover {
|
| 55 |
-
background-color: #0056b3;
|
| 56 |
-
}
|
| 57 |
</style>
|
| 58 |
</head>
|
| 59 |
<body>
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
<
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
{% for order in orders %}
|
| 66 |
-
<
|
| 67 |
-
<
|
| 68 |
-
<
|
| 69 |
-
<
|
| 70 |
-
<
|
| 71 |
-
<
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
<ul>
|
| 75 |
-
{% for item in order.items %}
|
| 76 |
-
<li>{{ item }}</li> <!-- Each line from Order_Details__c is displayed here -->
|
| 77 |
-
{% endfor %}
|
| 78 |
-
</ul>
|
| 79 |
-
</div>
|
| 80 |
{% endfor %}
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
<a href="/menu" class="back-btn">Back to Menu</a>
|
| 86 |
-
</div>
|
| 87 |
-
|
| 88 |
</body>
|
| 89 |
</html>
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Order History</title>
|
|
|
|
|
|
|
| 7 |
<style>
|
| 8 |
+
body { font-family: Arial, sans-serif; margin: 20px; }
|
| 9 |
+
h2 { text-align: center; }
|
| 10 |
+
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
|
| 11 |
+
th, td { border: 1px solid black; padding: 8px; text-align: left; }
|
| 12 |
+
th { background-color: #f2f2f2; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
</style>
|
| 14 |
</head>
|
| 15 |
<body>
|
| 16 |
+
<h2>Order History</h2>
|
| 17 |
+
{% if orders %}
|
| 18 |
+
<table>
|
| 19 |
+
<tr>
|
| 20 |
+
<th>Date</th>
|
| 21 |
+
<th>Order Details</th>
|
| 22 |
+
<th>Total Amount</th>
|
| 23 |
+
<th>Discount</th>
|
| 24 |
+
<th>Total Bill</th>
|
| 25 |
+
<th>Status</th>
|
| 26 |
+
</tr>
|
| 27 |
{% for order in orders %}
|
| 28 |
+
<tr>
|
| 29 |
+
<td>{{ order['CreatedDate'][:10] }}</td>
|
| 30 |
+
<td>{{ order['Order_Details__c'] }}</td>
|
| 31 |
+
<td>${{ order['Total_Amount__c'] }}</td>
|
| 32 |
+
<td>${{ order['Discount__c'] }}</td>
|
| 33 |
+
<td>${{ order['Total_Bill__c'] }}</td>
|
| 34 |
+
<td>{{ order['Order_Status__c'] }}</td>
|
| 35 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
{% endfor %}
|
| 37 |
+
</table>
|
| 38 |
+
{% else %}
|
| 39 |
+
<p>No past orders found.</p>
|
| 40 |
+
{% endif %}
|
|
|
|
|
|
|
|
|
|
| 41 |
</body>
|
| 42 |
</html>
|