File size: 2,811 Bytes
08cd3bb
 
 
 
 
 
 
 
7a356d8
08cd3bb
 
 
7a356d8
08cd3bb
7a356d8
 
 
 
 
08cd3bb
 
 
 
7a356d8
 
 
 
 
08cd3bb
7a356d8
 
08cd3bb
 
 
 
 
 
 
 
7a356d8
08cd3bb
 
 
 
 
7a356d8
08cd3bb
 
 
 
7a356d8
 
 
 
 
 
08cd3bb
7a356d8
08cd3bb
 
 
 
 
 
 
7a356d8
08cd3bb
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{% 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>
    
    <!-- Pending Seller Approvals -->
    <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>
    
    <!-- Pending Car Approvals -->
    <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 %}