Files
moto-adv-website/app/templates/base.html

181 lines
9.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Moto Adventure Community{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
</head>
<body class="bg-gray-50">
<!-- Navigation -->
<nav class="bg-gradient-to-r from-blue-600 via-purple-600 to-teal-600 shadow-lg fixed w-full z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<a href="{{ url_for('main.index') }}" class="text-white text-xl font-bold flex items-center">
<img src="{{ url_for('static', filename='images/logo.png') }}" alt="Moto Adventure" class="h-8 w-8 mr-2">
Moto Adventure
</a>
</div>
<div class="hidden md:flex items-center space-x-8">
<a href="{{ url_for('community.index') }}" class="text-white hover:text-teal-200 transition font-semibold">🏍️ Adventures</a>
<a href="{{ url_for('main.index') }}#accommodation" class="text-white hover:text-purple-200 transition">Accommodation</a>
{% if current_user.is_authenticated %}
{% if not current_user.is_admin %}
<a href="{{ url_for('community.new_post') }}" class="bg-gradient-to-r from-green-500 to-emerald-500 text-white px-4 py-2 rounded-lg hover:from-green-400 hover:to-emerald-400 transition transform hover:scale-105">
<i class="fas fa-plus mr-2"></i>Share Adventure
</a>
{% endif %}
<a href="{{ url_for('community.profile') }}" class="text-white hover:text-blue-200 transition">
<i class="fas fa-user mr-1"></i>My Profile
</a>
{% if current_user.is_admin %}
<a href="{{ url_for('admin.dashboard') }}" class="text-white hover:text-yellow-200 transition">
<i class="fas fa-cog mr-1"></i>Admin
</a>
{% endif %}
<a href="{{ url_for('auth.logout') }}" class="text-white hover:text-red-200 transition">
<i class="fas fa-sign-out-alt mr-1"></i>Logout
</a>
{% else %}
<a href="{{ url_for('auth.login') }}" class="text-white hover:text-blue-200 transition">Login</a>
<a href="{{ url_for('auth.register') }}" class="bg-gradient-to-r from-green-500 to-emerald-500 text-white px-4 py-2 rounded-lg hover:from-green-400 hover:to-emerald-400 transition transform hover:scale-105">Register</a>
{% endif %}
</div>
<!-- Mobile menu button -->
<div class="md:hidden flex items-center">
<button type="button" class="text-white hover:text-orange-200 focus:outline-none focus:text-orange-200" id="mobile-menu-btn">
<i class="fas fa-bars text-xl"></i>
</button>
</div>
</div>
</div>
<!-- Mobile menu -->
<div class="md:hidden bg-gradient-to-r from-blue-700 via-purple-700 to-teal-700 hidden" id="mobile-menu">
<div class="px-2 pt-2 pb-3 space-y-1">
<a href="{{ url_for('main.index') }}#about" class="text-white block px-3 py-2 hover:bg-blue-600 rounded">About</a>
<a href="{{ url_for('main.index') }}#accommodation" class="text-white block px-3 py-2 hover:bg-purple-600 rounded">Accommodation</a>
<a href="{{ url_for('community.index') }}" class="text-white block px-3 py-2 hover:bg-teal-600 rounded">Stories & Tracks</a>
{% if current_user.is_authenticated %}
{% if not current_user.is_admin %}
<a href="{{ url_for('community.new_post') }}" class="text-white block px-3 py-2 hover:bg-green-600 rounded">
<i class="fas fa-plus mr-2"></i>New Post
</a>
{% endif %}
<a href="{{ url_for('community.profile') }}" class="text-white block px-3 py-2 hover:bg-blue-600 rounded">
<i class="fas fa-user mr-1"></i>My Profile
</a>
{% if current_user.is_admin %}
<a href="{{ url_for('admin.dashboard') }}" class="text-white block px-3 py-2 hover:bg-yellow-600 rounded">
<i class="fas fa-cog mr-1"></i>Admin
</a>
{% endif %}
<a href="{{ url_for('auth.logout') }}" class="text-white block px-3 py-2 hover:bg-red-600 rounded">
<i class="fas fa-sign-out-alt mr-1"></i>Logout
</a>
{% else %}
<a href="{{ url_for('auth.login') }}" class="text-white block px-3 py-2 hover:bg-blue-600 rounded">Login</a>
<a href="{{ url_for('auth.register') }}" class="text-white block px-3 py-2 hover:bg-green-600 rounded">Register</a>
{% endif %}
</div>
</div>
</nav>
<!-- Flash Messages -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="fixed top-20 right-4 z-50 space-y-2">
{% for category, message in messages %}
<div class="alert alert-{{ category }} px-4 py-3 rounded-lg shadow-lg max-w-sm
{% if category == 'error' %}bg-red-500 text-white
{% elif category == 'success' %}bg-green-500 text-white
{% elif category == 'warning' %}bg-yellow-500 text-white
{% else %}bg-blue-500 text-white
{% endif %}">
<div class="flex justify-between items-center">
<span>{{ message }}</span>
<button type="button" class="ml-2 text-white hover:text-gray-200" onclick="this.parentElement.parentElement.style.display='none'">
<i class="fas fa-times"></i>
</button>
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<!-- Main Content -->
<main class="pt-16">
{% block content %}{% endblock %}
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-12">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div>
<h3 class="text-xl font-bold mb-4">
<i class="fas fa-motorcycle mr-2"></i>Moto Adventure
</h3>
<p class="text-gray-300">
Join our community of motorcycle enthusiasts exploring the beautiful landscapes of Romania and beyond.
</p>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Quick Links</h4>
<ul class="space-y-2">
<li><a href="{{ url_for('main.index') }}#about" class="text-gray-300 hover:text-white transition">About</a></li>
<li><a href="{{ url_for('main.index') }}#accommodation" class="text-gray-300 hover:text-white transition">Accommodation</a></li>
<li><a href="{{ url_for('community.index') }}" class="text-gray-300 hover:text-white transition">Stories & Tracks</a></li>
</ul>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Contact</h4>
<div class="space-y-2 text-gray-300">
<p><i class="fas fa-map-marker-alt mr-2"></i>Pensiunea Buongusto, Romania</p>
<p><i class="fas fa-envelope mr-2"></i>info@moto-adv.com</p>
<p><i class="fas fa-phone mr-2"></i>+40 123 456 789</p>
</div>
</div>
</div>
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-300">
<p>&copy; 2024 Moto Adventure Community. All rights reserved.</p>
</div>
</div>
</footer>
<script>
// Mobile menu toggle
document.getElementById('mobile-menu-btn').addEventListener('click', function() {
const mobileMenu = document.getElementById('mobile-menu');
mobileMenu.classList.toggle('hidden');
});
// Auto-hide flash messages after 5 seconds
setTimeout(function() {
const alerts = document.querySelectorAll('.alert');
alerts.forEach(function(alert) {
alert.style.display = 'none';
});
}, 5000);
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
</script>
</body>
</html>