feat: Semaine 8
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="https://unpkg.com/htmx.org@2.0.4"
|
||||
integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+"
|
||||
crossorigin="anonymous"></script>
|
||||
<title>Document</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; max-width: 700px; margin: 40px auto; padding: 0 20px; }
|
||||
h2 { color: #333; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th, td { padding: 10px 12px; border: 1px solid #ddd; text-align: left; }
|
||||
th { background: #f5f5f5; }
|
||||
tr.order--late { background: #fdf2f2; }
|
||||
tr.order--light_delay { background: #fff8e1; }
|
||||
tr.order--severe_delay { background: #fdf2f2; }
|
||||
.badge { padding: 3px 8px; border-radius: 3px; font-size: 12px; }
|
||||
.badge--warning { background: #f39c12; color: white; }
|
||||
.badge--success { background: #27ae60; color: white; }
|
||||
.badge--premium { background: #8e44ad; color: white; }
|
||||
button { padding: 6px 12px; cursor: pointer; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>🍕 Livr'Express</h1>
|
||||
</header>
|
||||
<main>
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>My Orders</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Restaurant</th>
|
||||
<th>Total Price</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for order in orders %}
|
||||
{% include "order_row.html" %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="4">No orders found.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock content %}
|
||||
@@ -0,0 +1,21 @@
|
||||
<tr>
|
||||
<td>{{ order.restaurant_name }}</td>
|
||||
<td>{{ order.total_amount }}</td>
|
||||
<td>
|
||||
{% if order.is_late %}
|
||||
<span class="badge badge--warning">Late</span>
|
||||
{% endif %}
|
||||
{% if order.free_delivery %}
|
||||
<span class="badge badge--success">Free Delivery</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if order.status == 'delivered' %}
|
||||
<span class="badge badge--success">Delivered</span>
|
||||
{% elif order.status == 'pending' %}
|
||||
<span class="badge badge--info">Pending</span>
|
||||
{% elif order.status == 'cancelled' %}
|
||||
<span class="badge badge--danger">Cancelled</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
Reference in New Issue
Block a user