61 lines
2.6 KiB
HTML
61 lines
2.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Notifications — Yggdrasil</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='retro.css') }}">
|
|
</head>
|
|
<body>
|
|
<nav>
|
|
<a href="{{ url_for('home') }}">Home</a>
|
|
<a href="{{ url_for('sensors_page') }}">Sensors</a>
|
|
<a href="{{ url_for('notes_page') }}">Notes</a>
|
|
<a href="{{ url_for('clipboard_page') }}">Clipboard</a>
|
|
<a href="{{ url_for('calendar_page') }}">Calendar</a>
|
|
<a href="{{ url_for('notifications_page') }}">Notifications{% if unread_notifications %} <span class="nav-badge">{{ unread_notifications }}</span>{% endif %}</a>
|
|
<a href="{{ url_for('api_docs') }}">API</a>
|
|
<a href="{{ url_for('logout') }}">Log out</a>
|
|
<img class="nav-logo" src="{{ url_for('static', filename='yggdrasil-logo.png') }}" alt="Yggdrasil logo">
|
|
</nav>
|
|
<h1>Notifications</h1>
|
|
|
|
<p class="hint">
|
|
{% if unread_notifications %}
|
|
{{ unread_notifications }} new notification{{ "s" if unread_notifications != 1 else "" }}.
|
|
{% else %}
|
|
No new notifications.
|
|
{% endif %}
|
|
</p>
|
|
|
|
{% if not notifications %}
|
|
<p class="hint">There are no notifications yet.</p>
|
|
{% else %}
|
|
<ul class="notification-list">
|
|
{% for notification in notifications %}
|
|
<li id="notification-{{ notification.id }}"
|
|
class="notification-item {{ notification.status }}">
|
|
<a href="{{ url_for('notification_read', notification_id=notification.id) }}"
|
|
title="{{ 'Mark as read' if notification.status == 'new' else 'Read notification' }}">
|
|
<span class="notification-message">{{ notification.message }}</span>
|
|
<span class="notification-meta">
|
|
<span class="notification-status">{{ notification.status }}</span>
|
|
<span>{{ notification.created_at.strftime("%Y-%m-%d %H:%M") }}</span>
|
|
</span>
|
|
</a>
|
|
<form method="post" action="{{ url_for('notification_delete', notification_id=notification.id) }}" class="notification-delete-form">
|
|
<button type="submit" title="Delete notification">[x]</button>
|
|
</form>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
<footer class="statusbar">
|
|
<span>{{ user.username }}@yggdrasil:~/notifications$</span>
|
|
</footer>
|
|
</body>
|
|
</html>
|