Files
bloodpressure/app/templates/_layout.html
2024-12-24 00:57:08 +11:00

58 lines
2.1 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 %}BP Tracker{% endblock %}</title>
<script src="/static/js/tailwindcss@3.2.4.js"></script>
</head>
<body class="bg-gray-100 text-gray-800">
<!-- Navbar -->
<nav class="bg-blue-600 text-white p-4">
<div class="container mx-auto flex justify-between items-center">
<a href="/" class="text-2xl font-bold">BP Tracker</a>
<div>
{% if current_user.is_authenticated %}
<a href="{{ url_for('main.dashboard') }}" class="px-4 py-2 hover:underline">Dashboard</a>
<a href="{{ url_for('user.profile') }}" class="px-4 py-2 hover:underline">Profile</a>
<a href="{{ url_for('auth.logout') }}" class="px-4 py-2 bg-red-500 rounded hover:bg-red-600">Logout</a>
{% else %}
<a href="{{ url_for('auth.login') }}" class="px-4 py-2 hover:underline">Login</a>
<a href="{{ url_for('auth.signup') }}"
class="px-4 py-2 bg-white text-blue-600 rounded hover:bg-gray-200">Signup</a>
{% endif %}
</div>
</div>
</nav>
{% with messages = get_flashed_messages(with_categories=True) %}
{% if messages %}
<div class="container mx-auto mt-4">
{% for category, message in messages %}
<div class="p-4 mb-4 rounded text-white bg-{{ 'red' if category == 'danger' else 'green' }}-500">
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<!-- Main Content -->
<main class="container mx-auto mt-6">
{% block content %}
<!-- Content goes here -->
{% endblock %}
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-4 mt-10">
<div class="container mx-auto text-center">
<p>&copy; 2024 BP Tracker. All rights reserved.</p>
</div>
</footer>
</body>
</html>