latest changes

This commit is contained in:
Joren de Graaf
2026-10-15 20:38:02 +02:00
parent 21f3cf09b7
commit 109ca6ef2a
45 changed files with 1463 additions and 22 deletions
+14
View File
@@ -0,0 +1,14 @@
{% extends 'core/base.html' %}{% load static %}{% block content %}<link rel="stylesheet" href="{% static 'dashboard/builder.css' %}"><link rel="stylesheet" href="{% static 'dashboard/open_meteo.css' %}"><link rel="stylesheet" href="{% static 'dashboard/buienradar.css' %}">
<div class="page-heading dashboard-heading"><div><div class="eyebrow"><span class="eyebrow-line"></span> YOUR WORKSPACE</div><h1>{{ title }}<span class="heading-period">.</span></h1><p>Make this space your own with a few useful widgets.</p></div><div class="dashboard-actions"><button class="button secondary" id="catalogue-toggle" type="button" aria-controls="widget-catalogue" aria-expanded="false" aria-label="Open widget catalogue"><i class="bi bi-gear"></i> Widgets</button><button class="button secondary" id="reset-layout" type="button" hidden>Reset</button><button class="button primary" id="edit-layout" type="button">Edit layout</button></div></div>
<div id="layout-status" class="layout-status" role="status" aria-live="polite">Layout saved</div>
<div class="dashboard-pages" aria-label="Dashboard pages"><a href="{% url 'dashboard:index' %}" {% if dashboard_page == 'overview' %}aria-current="page"{% endif %}>Overview</a><a href="{% url 'dashboard:page' 'personal' %}" {% if dashboard_page == 'personal' %}aria-current="page"{% endif %}>Personal</a></div>
<div id="widget-grid" class="widget-grid" data-page="{{ dashboard_page }}" data-revision="{{ layout.revision }}" data-save-url="{% url 'dashboard:layout' dashboard_page %}">
{% for instance in instances %}{% include 'dashboard/widget_card.html' %}{% endfor %}
</div>
<p id="empty-layout" class="empty-layout" {% if instances %}hidden{% endif %}>This page is empty. Choose <strong>Edit layout</strong>, then add a widget.</p>
<template id="open-meteo-widget-template">{% include 'dashboard/widgets/open_meteo.html' %}</template>
<template id="buienradar-widget-template">{% include 'dashboard/widgets/buienradar.html' %}</template>
<aside id="widget-catalogue" class="widget-catalogue" aria-label="Widget catalogue" aria-hidden="true" inert><div class="catalogue-head"><div><span class="eyebrow">BUILD YOUR PAGE</span><h2>Widgets</h2></div><button type="button" id="catalogue-close" class="button ghost" aria-label="Close widget catalogue"><i class="bi bi-x-lg"></i></button></div><label for="widget-search">Search widgets</label><input id="widget-search" type="search" placeholder="Search by name or description"><div class="catalogue-list">{% for widget in catalogue %}<div class="catalogue-entry" draggable="true" data-widget-type="{{ widget.id }}" data-title="{{ widget.title|lower }}" data-description="{{ widget.description|lower }}"><i class="bi {{ widget.icon }}" aria-hidden="true"></i><div><strong>{{ widget.title }}</strong><small>{{ widget.description }}</small></div><button type="button" class="button secondary" data-add="{{ widget.id }}">Add</button></div>{% endfor %}</div><p class="catalogue-hint">Drag onto a dashed slot, or use Add and the Move controls. Changes save when you select Done.</p></aside><div id="catalogue-backdrop" class="catalogue-backdrop" hidden></div>
{{ catalogue|length|json_script:"widget-count" }}
<script src="{% static 'dashboard/location.js' %}" defer></script><script src="{% static 'dashboard/open_meteo.js' %}" defer></script><script src="{% static 'dashboard/buienradar.js' %}" defer></script><script src="{% static 'dashboard/builder.js' %}" defer></script>
{% endblock %}
@@ -0,0 +1 @@
<article class="widget-card content-card" data-widget-platform="bottom" data-instance-id="{{ instance.id }}" data-widget-type="{{ instance.type }}" data-span="{{ instance.span }}"><header class="widget-card-head"><div><i class="bi {{ instance.kind.icon }}" aria-hidden="true"></i><h2>{{ instance.kind.title }}</h2></div><div class="widget-controls"><button type="button" data-move="left" aria-label="Move {{ instance.kind.title }} earlier" title="Move earlier">←</button><button type="button" data-move="right" aria-label="Move {{ instance.kind.title }} later" title="Move later">→</button><button type="button" data-span-toggle aria-label="Resize {{ instance.kind.title }}" title="Resize">↔</button><button type="button" data-settings-toggle aria-label="Settings for {{ instance.kind.title }}" title="Settings"><i class="bi bi-sliders"></i></button><button type="button" data-remove aria-label="Remove {{ instance.kind.title }}" title="Remove"><i class="bi bi-x-lg"></i></button><span class="drag-handle" draggable="true" aria-hidden="true"><i class="bi bi-grip-vertical"></i></span></div></header><div class="widget-body">{% include instance.kind.template %}</div><div class="widget-settings" hidden>{% if instance.type == 'notes' %}<label>Note text <textarea data-setting="text" maxlength="1000">{{ instance.settings.text|default:'' }}</textarea></label>{% else %}<p>No settings for this widget.</p>{% endif %}</div></article>
@@ -0,0 +1,8 @@
<section class="rain-widget" data-rain-url="{% url 'dashboard:buienradar' %}" aria-label="Buienradar rain radar">
<div class="rain-location"><div><strong data-rain-location>Heerenveen</strong><small data-rain-updated>Waiting for rain forecast</small></div><div><button type="button" class="button secondary" data-rain-geolocate>Use my location</button><button type="button" class="button ghost" data-rain-refresh>Refresh</button></div></div>
<details class="rain-manual"><summary>Choose coordinates manually</summary><form data-rain-manual><label>Latitude <input name="latitude" type="number" min="-90" max="90" step="any" required placeholder="52.96"></label><label>Longitude <input name="longitude" type="number" min="-180" max="180" step="any" required placeholder="5.92"></label><button class="button secondary" type="submit">Use coordinates</button></form><p>Shared with weather widgets on this page. Coordinates are not saved.</p></details>
<div class="rain-layout"><div class="rain-radar"><div class="rain-radar-heading"><h3>Netherlands radar</h3><span>Latest image</span></div><div class="rain-radar-frame"><img data-rain-image src="https://image.buienradar.nl/2.0/image/single/RadarMapRainNL?height=512&amp;width=500&amp;renderBackground=True&amp;renderBranding=True&amp;renderText=True" width="500" height="512" alt="Latest Buienradar rain radar image of the Netherlands. Location is not marked."><iframe data-rain-animation title="Buienradar official animated radar gadget" width="256" height="406" loading="lazy" hidden></iframe></div><div class="rain-radar-actions"><button type="button" class="button secondary" data-rain-play aria-pressed="false">Play animation</button><button type="button" class="button ghost" data-rain-fullscreen>Full screen</button></div><p class="rain-caveat">Animation is managed by Buienradar. Frame times and seeking are not available from this embed.</p></div>
<div class="rain-forecast"><div class="rain-forecast-heading"><h3>Rain at this location</h3><span>Forecast · next 2 hours</span></div><p class="rain-status" data-rain-status role="status" aria-live="polite">Loading rain forecast…</p><div data-rain-content hidden><div class="rain-reading"><strong data-rain-class>—</strong><span data-rain-amount>—</span><small data-rain-time>—</small></div><div class="rain-bars" data-rain-bars aria-hidden="true"></div><label class="rain-scrubber-label" for="rain-scrubber-{{ instance.id|default:'template' }}">Choose forecast time</label><input id="rain-scrubber-{{ instance.id|default:'template' }}" data-rain-slider type="range" min="0" max="0" value="0" aria-label="Forecast time"><div class="rain-step-actions"><button type="button" class="button ghost" data-rain-prev>Previous forecast time</button><button type="button" class="button ghost" data-rain-next>Next forecast time</button></div></div><p class="rain-caveat">Forecast values are separate from the radar image; their times are not synchronized.</p></div></div>
<dialog class="rain-dialog" data-rain-dialog aria-label="Buienradar full screen"><div class="rain-dialog-head"><strong>Buienradar · Netherlands</strong><button type="button" class="button secondary" data-rain-close>Close</button></div><img data-rain-dialog-image src="https://image.buienradar.nl/2.0/image/single/RadarMapRainNL?height=512&amp;width=500&amp;renderBackground=True&amp;renderBranding=True&amp;renderText=True" width="500" height="512" alt="Latest Buienradar rain radar image of the Netherlands. Location is not marked."><iframe data-rain-dialog-animation title="Buienradar official animated radar gadget in full screen" width="256" height="406" loading="lazy" hidden></iframe></dialog>
<footer class="rain-credit">Radar and precipitation data: <a href="https://www.buienradar.nl/" target="_blank" rel="noopener noreferrer">Buienradar.nl</a> · Rain intensity categories adapted for display.</footer>
</section>
@@ -0,0 +1 @@
<p class="note-preview">{{ instance.settings.text|default:'Add a note in widget settings.' }}</p>
@@ -0,0 +1,10 @@
<section class="weather-widget" data-weather-url="{% url 'dashboard:open_meteo' %}" aria-label="Open-Meteo forecast">
<div class="weather-location"><div><strong data-location-name>Heerenveen</strong><small data-weather-updated>Waiting for forecast</small></div><div><button class="button secondary" type="button" data-use-location>Use my location</button><button class="button ghost" type="button" data-weather-refresh>Refresh</button></div></div>
<details class="weather-manual"><summary>Choose coordinates manually</summary><form data-manual-location><label>Latitude <input name="latitude" type="number" min="-90" max="90" step="any" required placeholder="52.96"></label><label>Longitude <input name="longitude" type="number" min="-180" max="180" step="any" required placeholder="5.92"></label><button class="button secondary" type="submit">Use coordinates</button></form><p>Coordinates stay in this browser session and are rounded before the weather request.</p></details>
<p class="weather-status" data-weather-status role="status" aria-live="polite">Loading forecast…</p>
<div data-weather-content hidden><div class="weather-current"><div><span class="weather-temperature" data-current-temp></span><strong data-current-condition></strong><small data-current-feels></small></div><dl data-current-details></dl></div>
<div class="weather-summary"><h3>Today</h3><dl data-daily-summary></dl></div>
<div class="weather-hours-heading"><h3>Hourly forecast</h3><button class="button ghost" type="button" data-hours-toggle aria-expanded="false">Show 48 hours</button></div><div class="weather-hours" data-hours role="group" aria-label="Hourly forecast"></div><div class="weather-hour-detail" data-hour-detail aria-live="polite"></div>
</div>
<footer class="weather-credit">Weather data: <a href="https://open-meteo.com/" target="_blank" rel="noopener noreferrer">Open-Meteo</a> · Forecast data adapted for display · <a href="https://open-meteo.com/en/licence" target="_blank" rel="noopener noreferrer">CC BY 4.0</a></footer>
</section>
@@ -0,0 +1 @@
<nav class="widget-shortcuts" aria-label="Quick links"><a href="{% url 'projects:list' %}">Projects <i class="bi bi-arrow-up-right"></i></a><a href="{% url 'today' %}">Design examples <i class="bi bi-arrow-up-right"></i></a></nav>
@@ -0,0 +1 @@
<p>Welcome to your dashboard. Arrange the cards to fit your day.</p><p class="widget-muted">This is a placeholder widget. Live data widgets will be added separately.</p>