Create templates/index.html
Browse files- templates/index.html +53 -0
templates/index.html
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<!-- Hero Section -->
|
| 5 |
+
<section class="bg-gradient-to-r from-blue-500 to-purple-600 text-white py-20 mb-12 rounded-lg">
|
| 6 |
+
<div class="container mx-auto text-center">
|
| 7 |
+
<h1 class="text-5xl font-bold mb-4">Find Your Dream Car</h1>
|
| 8 |
+
<p class="text-xl mb-8">Browse through our extensive collection of quality vehicles</p>
|
| 9 |
+
{% if session.get('user_id') and session.get('role') == 'buyer' %}
|
| 10 |
+
<a href="#cars" class="bg-white text-blue-600 px-8 py-3 rounded-full font-semibold hover:bg-gray-100 transition duration-300">
|
| 11 |
+
Browse Cars
|
| 12 |
+
</a>
|
| 13 |
+
{% else %}
|
| 14 |
+
<a href="{{ url_for('register') }}" class="bg-white text-blue-600 px-8 py-3 rounded-full font-semibold hover:bg-gray-100 transition duration-300">
|
| 15 |
+
Get Started
|
| 16 |
+
</a>
|
| 17 |
+
{% endif %}
|
| 18 |
+
</div>
|
| 19 |
+
</section>
|
| 20 |
+
|
| 21 |
+
<!-- Cars Section -->
|
| 22 |
+
<section id="cars" class="mb-12">
|
| 23 |
+
<h2 class="text-3xl font-bold text-center mb-8">Available Cars</h2>
|
| 24 |
+
|
| 25 |
+
{% if cars %}
|
| 26 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
| 27 |
+
{% for car in cars %}
|
| 28 |
+
<div class="bg-white rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition duration-300">
|
| 29 |
+
<div class="p-6">
|
| 30 |
+
<h3 class="text-xl font-bold mb-2">{{ car.name }}</h3>
|
| 31 |
+
<p class="text-gray-600 mb-2">Year: {{ car.year }}</p>
|
| 32 |
+
<p class="text-2xl font-bold text-blue-600 mb-4">${{ car.price }}</p>
|
| 33 |
+
<p class="text-gray-700 mb-4">{{ car.description }}</p>
|
| 34 |
+
|
| 35 |
+
{% if session.get('user_id') and session.get('role') == 'buyer' %}
|
| 36 |
+
<a href="{{ url_for('book_appointment', car_id=car._id) }}"
|
| 37 |
+
class="bg-blue-600 text-white px-6 py-2 rounded-full hover:bg-blue-700 transition duration-300 block text-center">
|
| 38 |
+
Book Appointment
|
| 39 |
+
</a>
|
| 40 |
+
{% elif not session.get('user_id') %}
|
| 41 |
+
<p class="text-red-500 text-center">Please login as buyer to book appointment</p>
|
| 42 |
+
{% endif %}
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
{% endfor %}
|
| 46 |
+
</div>
|
| 47 |
+
{% else %}
|
| 48 |
+
<div class="text-center py-12">
|
| 49 |
+
<p class="text-xl text-gray-600">No cars available at the moment. Check back later!</p>
|
| 50 |
+
</div>
|
| 51 |
+
{% endif %}
|
| 52 |
+
</section>
|
| 53 |
+
{% endblock %}
|