Files
calorie_tracker_2/views/layout.ejs
2026-01-30 23:32:43 +08:00

105 lines
4.0 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calorie Tracker</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#D62828',
secondary: '#003F87',
success: '#06D6A0',
warning: '#FFB703',
}
}
}
}
</script>
<style>
.glass {
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(10px);
}
</style>
</head>
<body class="bg-gray-50">
<% if (current_user) { %>
<!-- Navigation -->
<nav class="bg-primary text-white shadow-lg">
<div class="container mx-auto px-4">
<div class="flex justify-between items-center py-4">
<div class="flex items-center space-x-8">
<a href="/" class="text-2xl font-bold">🍽️ Calorie Tracker</a>
<div class="hidden md:flex space-x-6">
<a href="/dashboard" class="hover:text-gray-200 transition <%= path === '/dashboard' ? 'font-bold' : '' %>">
🏠 Dashboard
</a>
<a href="/meal-planner" class="hover:text-gray-200 transition <%= path === '/meal-planner' ? 'font-bold' : '' %>">
📅 Meal Planner
</a>
<a href="/foods" class="hover:text-gray-200 transition <%= path === '/foods' ? 'font-bold' : '' %>">
🍛 Foods
</a>
<a href="/progress" class="hover:text-gray-200 transition <%= path === '/progress' ? 'font-bold' : '' %>">
📊 Progress
</a>
<a href="/goals" class="hover:text-gray-200 transition <%= path === '/goals' ? 'font-bold' : '' %>">
🎯 Goals
</a>
</div>
</div>
<div class="flex items-center space-x-4">
<span class="hidden md:inline">👤 <%= current_user.name || current_user.username %></span>
<a href="/logout" class="bg-white text-primary px-4 py-2 rounded hover:bg-gray-100 transition">
Logout
</a>
</div>
</div>
</div>
</nav>
<% } %>
<!-- Flash Messages -->
<% if (success_msg.length > 0) { %>
<div class="container mx-auto px-4 mt-4">
<div class="bg-green-100 border-green-400 text-green-700 border px-4 py-3 rounded relative mb-4" role="alert">
<span class="block sm:inline"><%= success_msg %></span>
</div>
</div>
<% } %>
<% if (error_msg.length > 0) { %>
<div class="container mx-auto px-4 mt-4">
<div class="bg-red-100 border-red-400 text-red-700 border px-4 py-3 rounded relative mb-4" role="alert">
<span class="block sm:inline"><%= error_msg %></span>
</div>
</div>
<% } %>
<% if (error.length > 0) { %>
<div class="container mx-auto px-4 mt-4">
<div class="bg-red-100 border-red-400 text-red-700 border px-4 py-3 rounded relative mb-4" role="alert">
<span class="block sm:inline"><%= error %></span>
</div>
</div>
<% } %>
<!-- Main Content -->
<main class="container mx-auto px-4 py-8">
<%- body %>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white text-center py-4 mt-12">
<p>&copy; 2026 Calorie Tracker - Filipino Food Edition</p>
</footer>
<%- defineContent('scripts') %>
</body>
</html>