2024-01-12 10:57:58 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
2024-03-07 20:34:30 +01:00
|
|
|
<meta content="width=device-width, initial-scale=1" name="viewport">
|
2024-01-12 10:57:58 +01:00
|
|
|
<title>{{ title }} - HabitTracker</title>
|
2024-03-13 12:04:00 +01:00
|
|
|
<link rel="icon" href="/static/icon.ico">
|
2024-01-12 10:57:58 +01:00
|
|
|
|
2024-02-02 08:56:04 +01:00
|
|
|
<!-- CSS -->
|
2024-03-07 20:34:30 +01:00
|
|
|
<link href="../../static/css/background.css" rel="stylesheet" type="text/css">
|
|
|
|
|
<link href="../../static/css/profile.css" rel="stylesheet" type="text/css">
|
2024-03-08 14:05:22 +01:00
|
|
|
<link href="../../static/css/heatmap.css" rel="stylesheet" type="text/css">
|
2024-03-07 20:34:30 +01:00
|
|
|
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/fastbootstrap@2.2.0/dist/css/fastbootstrap.min.css"
|
|
|
|
|
integrity="sha256-V6lu+OdYNKTKTsVFBuQsyIlDiRWiOmtC8VQ8Lzdm2i4=" rel="stylesheet">
|
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
|
2024-01-23 11:17:24 +01:00
|
|
|
|
2024-02-18 04:53:15 +01:00
|
|
|
|
2024-02-20 04:16:28 +01:00
|
|
|
<!-- jQuery -->
|
|
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
|
|
|
|
|
|
|
|
|
<!-- Bootstrap JS (including Popper.js for Bootstrap 5) -->
|
2024-03-07 20:34:30 +01:00
|
|
|
<script crossorigin="anonymous"
|
|
|
|
|
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
|
|
|
|
|
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
2024-02-20 04:16:28 +01:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.2/Sortable.min.js"></script>
|
|
|
|
|
|
2024-01-26 10:25:01 +01:00
|
|
|
<!-- Axios Library-->
|
2024-01-23 11:17:24 +01:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
2024-02-20 04:16:28 +01:00
|
|
|
|
|
|
|
|
|
2024-01-12 10:57:58 +01:00
|
|
|
</head>
|
2024-01-17 11:17:35 +01:00
|
|
|
<body style="background-color: White">
|
2024-01-13 12:42:54 +01:00
|
|
|
|
2024-01-16 11:16:21 +01:00
|
|
|
<nav class="navbar navbar-expand-lg" style="background-color: #000000">
|
2024-01-12 10:57:58 +01:00
|
|
|
<div class="container-fluid">
|
2024-01-16 11:16:21 +01:00
|
|
|
<a class="navbar-brand" href="{{ url_for('index') }}" style="color: ivory">HabitTracker</a>
|
2024-03-07 20:34:30 +01:00
|
|
|
<button aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler"
|
|
|
|
|
data-bs-target="#navbarSupportedContent" data-bs-toggle="collapse" type="button">
|
2024-01-12 10:57:58 +01:00
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
2024-03-01 10:31:24 +01:00
|
|
|
<ul class="me-auto"></ul>
|
2024-01-12 10:57:58 +01:00
|
|
|
<ul class="navbar-nav mb-2 mb-lg-0">
|
2024-01-12 16:53:03 +01:00
|
|
|
{% if not current_user.is_authenticated %}
|
2024-01-12 10:57:58 +01:00
|
|
|
<li class="nav-item me-2">
|
2024-03-07 20:34:30 +01:00
|
|
|
<a aria-current="page" class="btn text-white btn-primary" href="{{ url_for('login') }}">Login</a>
|
2024-01-12 10:57:58 +01:00
|
|
|
</li>
|
|
|
|
|
<li class="nav-item">
|
2024-03-07 20:34:30 +01:00
|
|
|
<a aria-current="page" class="btn btn-outline-secondary" href="{{ url_for('signup') }}">Signup</a>
|
2024-01-12 10:57:58 +01:00
|
|
|
</li>
|
2024-01-12 16:53:03 +01:00
|
|
|
{% else %}
|
2024-03-07 20:34:30 +01:00
|
|
|
{% if notifications %}
|
|
|
|
|
<li class="nav-item me-4 mb-2 mb-lg-0">
|
|
|
|
|
<div class="dropdown">
|
|
|
|
|
<!--<button class="btn btn-default dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
|
|
|
Page actions
|
|
|
|
|
</button>-->
|
|
|
|
|
<i class="bi bi-bell-fill dropdown-toggle" data-bs-toggle="dropdown"
|
|
|
|
|
style="color: white; cursor: pointer"></i>
|
|
|
|
|
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill text-bg-danger">
|
|
|
|
|
{{ notifications|length }}
|
|
|
|
|
<span class="visually-hidden">unread messages</span>
|
|
|
|
|
</span>
|
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
|
|
|
|
{% for notification in notifications %}
|
|
|
|
|
<li>
|
|
|
|
|
<div class="dropdown-item">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col">
|
|
|
|
|
{{ notification.name }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col">
|
|
|
|
|
<a class="accept-button" data-id="{{ notification.id }}" style="cursor: pointer"><i class="bi bi-check-circle-fill" style="color: green"></i></a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col">
|
|
|
|
|
<a class="deny-button" data-id="{{ notification.id }}" style="cursor: pointer"><i class="bi bi-x-circle-fill" style="color: red"></i></a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
var acceptButtons = document.querySelectorAll('.accept-button');
|
|
|
|
|
|
|
|
|
|
acceptButtons.forEach(function(button) {
|
|
|
|
|
button.addEventListener('click', function() {
|
|
|
|
|
var notificationId = this.getAttribute('data-id');
|
|
|
|
|
console.log('Notification accepted:', notificationId);
|
|
|
|
|
|
|
|
|
|
axios.post('/accept-list', {list_id: notificationId}, {
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
}
|
|
|
|
|
}).then(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
var acceptButtons = document.querySelectorAll('.deny-button');
|
|
|
|
|
|
|
|
|
|
acceptButtons.forEach(function(button) {
|
|
|
|
|
button.addEventListener('click', function() {
|
|
|
|
|
var notificationId = this.getAttribute('data-id');
|
|
|
|
|
console.log('Notification accepted:', notificationId);
|
|
|
|
|
|
|
|
|
|
axios.post('/deny-list', {list_id: notificationId}, {
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
}
|
|
|
|
|
}).then(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</li>
|
|
|
|
|
{% endif %}
|
2024-03-06 10:52:47 +01:00
|
|
|
<li class="nav-item me-2 mb-2 mb-lg-0">
|
2024-03-07 20:34:30 +01:00
|
|
|
<a aria-current="page" class="btn text-white btn-primary" href="{{ url_for('profile') }}">Profil</a>
|
2024-01-26 10:25:01 +01:00
|
|
|
</li>
|
2024-01-12 16:53:03 +01:00
|
|
|
<li class="nav-item me-2">
|
2024-03-07 20:34:30 +01:00
|
|
|
<a aria-current="page" class="btn btn-primary" href="{{ url_for('logout') }}">Logout</a>
|
2024-01-12 16:53:03 +01:00
|
|
|
</li>
|
|
|
|
|
{% endif %}
|
2024-01-12 10:57:58 +01:00
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
2024-01-13 12:42:54 +01:00
|
|
|
|
2024-01-16 11:16:21 +01:00
|
|
|
<div class="container mt-3 pb-3">
|
2024-01-12 10:57:58 +01:00
|
|
|
{% block content %} {% endblock %}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|