|
|
{% extends "base.html" %} |
|
|
|
|
|
{% block content %} |
|
|
<div class="bg-white rounded-lg shadow-lg p-8"> |
|
|
<h2 class="text-3xl font-bold text-center mb-8">Admin Dashboard</h2> |
|
|
|
|
|
|
|
|
<section class="mb-12"> |
|
|
<h3 class="text-2xl font-bold mb-4">Pending Seller Approvals</h3> |
|
|
|
|
|
{% if pending_sellers %} |
|
|
<div class="overflow-x-auto"> |
|
|
<table class="min-w-full bg-white"> |
|
|
<thead> |
|
|
<tr class="bg-gray-200"> |
|
|
<th class="py-2 px-4 border">Name</th> |
|
|
<th class="py-2 px-4 border">Email</th> |
|
|
<th class="py-2 px-4 border">Phone</th> |
|
|
<th class="py-2 px-4 border">Action</th> |
|
|
</tr> |
|
|
</thead> |
|
|
<tbody> |
|
|
{% for seller in pending_sellers %} |
|
|
<tr> |
|
|
<td class="py-2 px-4 border">{{ seller.name }}</td> |
|
|
<td class="py-2 px-4 border">{{ seller.email }}</td> |
|
|
<td class="py-2 px-4 border">{{ seller.phone }}</td> |
|
|
<td class="py-2 px-4 border"> |
|
|
<a href="{{ url_for('approve_seller', user_id=seller._id) }}" |
|
|
class="bg-green-600 text-white px-4 py-1 rounded hover:bg-green-700"> |
|
|
Approve |
|
|
</a> |
|
|
</td> |
|
|
</tr> |
|
|
{% endfor %} |
|
|
</tbody> |
|
|
</table> |
|
|
</div> |
|
|
{% else %} |
|
|
<p class="text-gray-600">No pending seller approvals.</p> |
|
|
{% endif %} |
|
|
</section> |
|
|
|
|
|
|
|
|
<section> |
|
|
<h3 class="text-2xl font-bold mb-4">Pending Car Approvals</h3> |
|
|
|
|
|
{% if pending_cars %} |
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
|
|
{% for car in pending_cars %} |
|
|
<div class="border rounded-lg p-4"> |
|
|
<h4 class="text-xl font-bold">{{ car.name }}</h4> |
|
|
<p class="text-gray-600">Year: {{ car.year }}</p> |
|
|
<p class="text-blue-600 font-bold">${{ car.price }}</p> |
|
|
<p class="text-gray-700">{{ car.description }}</p> |
|
|
<div class="mt-4"> |
|
|
<a href="{{ url_for('approve_car', car_id=car._id) }}" |
|
|
class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700"> |
|
|
Approve Car |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
|
{% endfor %} |
|
|
</div> |
|
|
{% else %} |
|
|
<p class="text-gray-600">No pending car approvals.</p> |
|
|
{% endif %} |
|
|
</section> |
|
|
</div> |
|
|
{% endblock %} |