Create templates/base.html
Browse files- templates/base.html +64 -0
templates/base.html
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Carwala - Your Car Marketplace</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
| 9 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 10 |
+
</head>
|
| 11 |
+
<body class="bg-gray-100">
|
| 12 |
+
<!-- Navigation -->
|
| 13 |
+
<nav class="bg-blue-600 text-white shadow-lg">
|
| 14 |
+
<div class="container mx-auto px-4">
|
| 15 |
+
<div class="flex justify-between items-center py-4">
|
| 16 |
+
<a href="{{ url_for('index') }}" class="text-2xl font-bold">Carwala</a>
|
| 17 |
+
|
| 18 |
+
<div class="flex space-x-4">
|
| 19 |
+
{% if session.get('user_id') %}
|
| 20 |
+
{% if session.get('role') == 'admin' %}
|
| 21 |
+
<a href="{{ url_for('admin_dashboard') }}" class="hover:bg-blue-700 px-3 py-2 rounded">Admin Dashboard</a>
|
| 22 |
+
{% elif session.get('role') == 'seller' %}
|
| 23 |
+
<a href="{{ url_for('seller_dashboard') }}" class="hover:bg-blue-700 px-3 py-2 rounded">Seller Dashboard</a>
|
| 24 |
+
{% endif %}
|
| 25 |
+
<a href="{{ url_for('index') }}" class="hover:bg-blue-700 px-3 py-2 rounded">Home</a>
|
| 26 |
+
<a href="{{ url_for('logout') }}" class="hover:bg-blue-700 px-3 py-2 rounded">Logout</a>
|
| 27 |
+
{% else %}
|
| 28 |
+
<a href="{{ url_for('index') }}" class="hover:bg-blue-700 px-3 py-2 rounded">Home</a>
|
| 29 |
+
<a href="{{ url_for('login') }}" class="hover:bg-blue-700 px-3 py-2 rounded">Login</a>
|
| 30 |
+
<a href="{{ url_for('register') }}" class="hover:bg-blue-700 px-3 py-2 rounded">Register</a>
|
| 31 |
+
{% endif %}
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
</div>
|
| 35 |
+
</nav>
|
| 36 |
+
|
| 37 |
+
<!-- Flash Messages -->
|
| 38 |
+
{% with messages = get_flashed_messages() %}
|
| 39 |
+
{% if messages %}
|
| 40 |
+
<div class="container mx-auto mt-4">
|
| 41 |
+
{% for message in messages %}
|
| 42 |
+
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative" role="alert">
|
| 43 |
+
<span class="block sm:inline">{{ message }}</span>
|
| 44 |
+
</div>
|
| 45 |
+
{% endfor %}
|
| 46 |
+
</div>
|
| 47 |
+
{% endif %}
|
| 48 |
+
{% endwith %}
|
| 49 |
+
|
| 50 |
+
<!-- Main Content -->
|
| 51 |
+
<main class="container mx-auto px-4 py-8">
|
| 52 |
+
{% block content %}{% endblock %}
|
| 53 |
+
</main>
|
| 54 |
+
|
| 55 |
+
<!-- Footer -->
|
| 56 |
+
<footer class="bg-gray-800 text-white py-8 mt-12">
|
| 57 |
+
<div class="container mx-auto px-4 text-center">
|
| 58 |
+
<p>© 2024 Carwala. All rights reserved.</p>
|
| 59 |
+
</div>
|
| 60 |
+
</footer>
|
| 61 |
+
|
| 62 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
| 63 |
+
</body>
|
| 64 |
+
</html>
|