WorkTracker/app/templates/base.html
2024-11-10 21:43:00 +08:00

71 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>工時記錄</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
{% block head %}{% endblock %}
</head>
<body>
{% if not request.endpoint == 'login' %}
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container">
<a class="navbar-brand" href="/">工時記錄</a>
{% if session.logged_in %}
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="/">首頁</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/settings">設定</a>
</li>
</ul>
</div>
{% endif %}
</div>
</nav>
{% endif %}
<div class="container mt-4">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-info alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var alerts = document.querySelectorAll('.alert');
alerts.forEach(function (alert) {
setTimeout(function () {
alert.classList.remove('show');
setTimeout(function () {
alert.remove();
}, 150);
}, 2000);
});
});
</script>
{% block scripts %}{% endblock %}
</body>
</html>