Update templates/admin.html
Browse files- templates/admin.html +24 -43
templates/admin.html
CHANGED
|
@@ -4,49 +4,31 @@
|
|
| 4 |
<div class="bg-white rounded-lg shadow-lg p-8">
|
| 5 |
<h2 class="text-3xl font-bold text-center mb-8">Admin Dashboard</h2>
|
| 6 |
|
| 7 |
-
<!-- Statistics -->
|
| 8 |
-
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
|
| 9 |
-
<div class="bg-blue-100 p-6 rounded-lg text-center">
|
| 10 |
-
<h3 class="text-2xl font-bold text-blue-600">{{ total_users }}</h3>
|
| 11 |
-
<p class="text-gray-600">Total Users</p>
|
| 12 |
-
</div>
|
| 13 |
-
<div class="bg-green-100 p-6 rounded-lg text-center">
|
| 14 |
-
<h3 class="text-2xl font-bold text-green-600">{{ total_cars }}</h3>
|
| 15 |
-
<p class="text-gray-600">Total Cars</p>
|
| 16 |
-
</div>
|
| 17 |
-
<div class="bg-purple-100 p-6 rounded-lg text-center">
|
| 18 |
-
<h3 class="text-2xl font-bold text-purple-600">{{ total_appointments }}</h3>
|
| 19 |
-
<p class="text-gray-600">Total Appointments</p>
|
| 20 |
-
</div>
|
| 21 |
-
</div>
|
| 22 |
-
|
| 23 |
<!-- Pending Seller Approvals -->
|
| 24 |
<section class="mb-12">
|
| 25 |
-
<h3 class="text-2xl font-bold mb-4"
|
| 26 |
|
| 27 |
{% if pending_sellers %}
|
| 28 |
<div class="overflow-x-auto">
|
| 29 |
-
<table class="min-w-full bg-white
|
| 30 |
<thead>
|
| 31 |
-
<tr class="bg-gray-
|
| 32 |
-
<th class="py-
|
| 33 |
-
<th class="py-
|
| 34 |
-
<th class="py-
|
| 35 |
-
<th class="py-
|
| 36 |
-
<th class="py-3 px-4 border text-left">Action</th>
|
| 37 |
</tr>
|
| 38 |
</thead>
|
| 39 |
<tbody>
|
| 40 |
{% for seller in pending_sellers %}
|
| 41 |
-
<tr
|
| 42 |
-
<td class="py-
|
| 43 |
-
<td class="py-
|
| 44 |
-
<td class="py-
|
| 45 |
-
<td class="py-
|
| 46 |
-
<td class="py-3 px-4 border">
|
| 47 |
<a href="{{ url_for('approve_seller', user_id=seller._id) }}"
|
| 48 |
-
class="bg-green-600 text-white px-4 py-
|
| 49 |
-
|
| 50 |
</a>
|
| 51 |
</td>
|
| 52 |
</tr>
|
|
@@ -55,26 +37,25 @@
|
|
| 55 |
</table>
|
| 56 |
</div>
|
| 57 |
{% else %}
|
| 58 |
-
<p class="text-gray-600
|
| 59 |
{% endif %}
|
| 60 |
</section>
|
| 61 |
|
| 62 |
<!-- Pending Car Approvals -->
|
| 63 |
<section>
|
| 64 |
-
<h3 class="text-2xl font-bold mb-4"
|
| 65 |
|
| 66 |
{% if pending_cars %}
|
| 67 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 68 |
{% for car in pending_cars %}
|
| 69 |
-
<div class="border
|
| 70 |
-
<h4 class="text-xl font-bold
|
| 71 |
-
<p class="text-gray-600
|
| 72 |
-
<p class="text-
|
| 73 |
-
<p class="text-gray-700
|
| 74 |
-
<div class="
|
| 75 |
-
<span class="bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-sm">Pending Approval</span>
|
| 76 |
<a href="{{ url_for('approve_car', car_id=car._id) }}"
|
| 77 |
-
class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700
|
| 78 |
Approve Car
|
| 79 |
</a>
|
| 80 |
</div>
|
|
@@ -82,7 +63,7 @@
|
|
| 82 |
{% endfor %}
|
| 83 |
</div>
|
| 84 |
{% else %}
|
| 85 |
-
<p class="text-gray-600
|
| 86 |
{% endif %}
|
| 87 |
</section>
|
| 88 |
</div>
|
|
|
|
| 4 |
<div class="bg-white rounded-lg shadow-lg p-8">
|
| 5 |
<h2 class="text-3xl font-bold text-center mb-8">Admin Dashboard</h2>
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
<!-- Pending Seller Approvals -->
|
| 8 |
<section class="mb-12">
|
| 9 |
+
<h3 class="text-2xl font-bold mb-4">Pending Seller Approvals</h3>
|
| 10 |
|
| 11 |
{% if pending_sellers %}
|
| 12 |
<div class="overflow-x-auto">
|
| 13 |
+
<table class="min-w-full bg-white">
|
| 14 |
<thead>
|
| 15 |
+
<tr class="bg-gray-200">
|
| 16 |
+
<th class="py-2 px-4 border">Name</th>
|
| 17 |
+
<th class="py-2 px-4 border">Email</th>
|
| 18 |
+
<th class="py-2 px-4 border">Phone</th>
|
| 19 |
+
<th class="py-2 px-4 border">Action</th>
|
|
|
|
| 20 |
</tr>
|
| 21 |
</thead>
|
| 22 |
<tbody>
|
| 23 |
{% for seller in pending_sellers %}
|
| 24 |
+
<tr>
|
| 25 |
+
<td class="py-2 px-4 border">{{ seller.name }}</td>
|
| 26 |
+
<td class="py-2 px-4 border">{{ seller.email }}</td>
|
| 27 |
+
<td class="py-2 px-4 border">{{ seller.phone }}</td>
|
| 28 |
+
<td class="py-2 px-4 border">
|
|
|
|
| 29 |
<a href="{{ url_for('approve_seller', user_id=seller._id) }}"
|
| 30 |
+
class="bg-green-600 text-white px-4 py-1 rounded hover:bg-green-700">
|
| 31 |
+
Approve
|
| 32 |
</a>
|
| 33 |
</td>
|
| 34 |
</tr>
|
|
|
|
| 37 |
</table>
|
| 38 |
</div>
|
| 39 |
{% else %}
|
| 40 |
+
<p class="text-gray-600">No pending seller approvals.</p>
|
| 41 |
{% endif %}
|
| 42 |
</section>
|
| 43 |
|
| 44 |
<!-- Pending Car Approvals -->
|
| 45 |
<section>
|
| 46 |
+
<h3 class="text-2xl font-bold mb-4">Pending Car Approvals</h3>
|
| 47 |
|
| 48 |
{% if pending_cars %}
|
| 49 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 50 |
{% for car in pending_cars %}
|
| 51 |
+
<div class="border rounded-lg p-4">
|
| 52 |
+
<h4 class="text-xl font-bold">{{ car.name }}</h4>
|
| 53 |
+
<p class="text-gray-600">Year: {{ car.year }}</p>
|
| 54 |
+
<p class="text-blue-600 font-bold">${{ car.price }}</p>
|
| 55 |
+
<p class="text-gray-700">{{ car.description }}</p>
|
| 56 |
+
<div class="mt-4">
|
|
|
|
| 57 |
<a href="{{ url_for('approve_car', car_id=car._id) }}"
|
| 58 |
+
class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700">
|
| 59 |
Approve Car
|
| 60 |
</a>
|
| 61 |
</div>
|
|
|
|
| 63 |
{% endfor %}
|
| 64 |
</div>
|
| 65 |
{% else %}
|
| 66 |
+
<p class="text-gray-600">No pending car approvals.</p>
|
| 67 |
{% endif %}
|
| 68 |
</section>
|
| 69 |
</div>
|