This commit is contained in:
2026-11-03 08:44:11 +01:00
parent cbf5f20c75
commit 0a9da4f9c5
13 changed files with 422 additions and 5 deletions
+96
View File
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calendar — 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>Calendar</h1>
<div class="panel">
<h2>Readouts</h2>
<div class="calendar-controls">
<a href="{{ url_for('calendar_page', view='month', year=year, month=month) }}"><span class="mc-key">M</span>Month</a>
<a href="{{ url_for('calendar_page', view='week', date=today.isoformat()) }}"><span class="mc-key">W</span>Week</a>
{% if view == 'month' %}
<a class="calendar-today" href="{{ url_for('calendar_page', view='month', year=today.year, month=today.month) }}"><span class="mc-key">T</span>Today</a>
<a href="{{ url_for('calendar_page', view='month', year=prev_year, month=prev_month) }}">&lt;</a>
<a href="{{ url_for('calendar_page', view='month', year=next_year, month=next_month) }}">&gt;</a>
{% else %}
<a class="calendar-today" href="{{ url_for('calendar_page', view='week', date=today.isoformat()) }}"><span class="mc-key">T</span>Today</a>
{% endif %}
</div>
{% if view == 'month' %}
<div class="calendar-title-row">
<h2 class="calendar-title">{{ month_label }}</h2>
</div>
<div class="calendar-grid">
{% for week in month_weeks %}
<div class="calendar-week">
{% for day in week %}
<div class="calendar-day{% if not day.in_month %} calendar-day-outside{% endif %}{% if day.date == today %} calendar-today{% endif %}">
<div class="calendar-day-header">{{ day.date.strftime("%a %d %b") }}</div>
<ul class="calendar-readouts">
{% for r in day.readouts %}
<li class="calendar-event">
<span class="calendar-event-time">{{ r.timestamp.strftime("%H:%M") }}</span>
<span class="calendar-event-sensor">{{ sensor_names[r.sensor_id] }}</span>
<span class="calendar-event-type">{{ r.type }}</span>
<span class="calendar-event-value">{{ r.value|round(1) }}</span>
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% else %}
<div class="calendar-title-row">
<h2 class="calendar-title">Tydzień {{ week_start }} – {{ week_end }}</h2>
<div class="calendar-nav">
<a href="{{ url_for('calendar_page', view='week', date=week_prev.isoformat()) }}">&lt;</a>
<a href="{{ url_for('calendar_page', view='week', date=week_next.isoformat()) }}">&gt;</a>
</div>
</div>
<ul class="calendar-list">
{% for day in days %}
<li class="calendar-day-item{% if day.date == today %} calendar-today{% endif %}" id="calendar-{{ day.date }}">
<div class="calendar-day-header">{{ day.date.strftime("%Y-%m-%d (%a)") }}</div>
<ul class="calendar-readouts">
{% for r in day.readouts %}
<li class="calendar-event">
<span class="calendar-event-time">{{ r.timestamp.strftime("%H:%M") }}</span>
<span class="calendar-event-sensor">{{ sensor_names[r.sensor_id] }}</span>
<span class="calendar-event-type">{{ r.type }}</span>
<span class="calendar-event-value">{{ r.value|round(1) }}</span>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<footer class="statusbar">
<span>{{ user.username }}@yggdrasil:~/calendar$</span>
</footer>
</body>
</html>
+1
View File
@@ -14,6 +14,7 @@
<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>
+1
View File
@@ -14,6 +14,7 @@
<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>
+4 -1
View File
@@ -14,6 +14,7 @@
<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>
@@ -29,9 +30,10 @@
<li><a href="{{ url_for('notifications_page') }}"><span class="mc-key">3</span>Notifications{% if unread_notifications %} ({{ unread_notifications }} new){% endif %}</a></li>
<li><a href="{{ url_for('api_docs') }}"><span class="mc-key">4</span>API — documentation</a></li>
<li><a href="{{ url_for('clipboard_page') }}"><span class="mc-key">5</span>Clipboard — upload and share files</a></li>
<li><a href="{{ url_for('calendar_page') }}"><span class="mc-key">6</span>Calendar — sensor readings</a></li>
<li><a href="{{ url_for('logout') }}"><span class="mc-key">0</span>Log out</a></li>
</ul>
<p class="hint">Tip: press <b>1</b>, <b>2</b>, <b>3</b>, <b>4</b>, <b>5</b> or <b>0</b> to navigate.</p>
<p class="hint">Tip: press <b>1</b>, <b>2</b>, <b>3</b>, <b>4</b>, <b>5</b>, <b>6</b> or <b>0</b> to navigate.</p>
</div>
<img class="logo" src="{{ url_for('static', filename='yggdrasil-logo.png') }}" alt="Yggdrasil logo">
<footer class="statusbar">
@@ -50,6 +52,7 @@
'3': "{{ url_for('notifications_page') }}",
'4': "{{ url_for('api_docs') }}",
'5': "{{ url_for('clipboard_page') }}",
'6': "{{ url_for('calendar_page') }}",
'0': "{{ url_for('logout') }}"
};
if (targets[e.key]) window.location.href = targets[e.key];
+1
View File
@@ -14,6 +14,7 @@
<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>
+1
View File
@@ -14,6 +14,7 @@
<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>
+1
View File
@@ -15,6 +15,7 @@
<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>