latest changes

This commit is contained in:
Joren de Graaf
2026-10-22 10:24:33 +02:00
parent 9a5210a48f
commit 3a12d56f8b
33 changed files with 1179 additions and 96 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
{% 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' %}"><link rel="stylesheet" href="{% static 'dashboard/companion.css' %}">
{% 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' %}"><link rel="stylesheet" href="{% static 'dashboard/codex_usage.css' %}?v=20261022"><link rel="stylesheet" href="{% static 'dashboard/companion.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><button class="button secondary" id="companion-toggle" type="button" aria-pressed="false">Show companion</button>
<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>
@@ -8,7 +8,8 @@
<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>
<template id="codex-usage-widget-template">{% include 'dashboard/widgets/codex_usage.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><script src="{% static 'dashboard/companion.js' %}" defer></script><script src="{% static 'dashboard/companion-dashboard.js' %}" defer></script>
<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/codex_usage.js' %}?v=20261022" defer></script><script src="{% static 'dashboard/builder.js' %}?v=20261022" defer></script><script src="{% static 'dashboard/companion.js' %}" defer></script><script src="{% static 'dashboard/companion-dashboard.js' %}" defer></script><script src="https://unpkg.com/htmx.org@2.0.4" defer></script>
{% endblock %}
@@ -0,0 +1,5 @@
{% if usage %}
<div class="codex-usage-top"><span class="codex-usage-state {% if usage.stale %}is-stale{% elif not usage.allowed %}is-limited{% endif %}">{% if usage.stale %}Stale data{% elif not usage.allowed %}Usage limited{% else %}Live usage{% endif %}</span>{% if usage.checked %}<span class="codex-usage-checked">Checked <time datetime="{{ usage.checked|date:'c' }}">{{ usage.checked|date:'j M H:i' }}</time></span>{% endif %}</div>
{% if usage.windows %}<div class="codex-usage-gauges">{% for window in usage.windows %}<div class="codex-usage-window"><div class="codex-usage-ring" {% if window.remaining is not None %}style="--usage-progress:{{ window.remaining }}%"{% endif %} role="img" aria-label="{{ window.bucket }} {{ window.title }}: {% if window.remaining is not None %}{{ window.remaining }} percent remaining{% else %}remaining usage unknown{% endif %}"><div class="codex-usage-ring-inner"><strong>{% if window.remaining is not None %}{{ window.remaining }}%{% else %}—{% endif %}</strong><small>left</small></div></div><strong class="codex-usage-label">{{ window.title }}</strong>{% if window.reset %}<span class="codex-usage-reset">Resets <time datetime="{{ window.reset|date:'c' }}">{{ window.reset|date:'j M H:i' }}</time></span>{% else %}<span class="codex-usage-reset">Reset time unavailable</span>{% endif %}</div>{% endfor %}</div>{% else %}<p class="codex-usage-state">No usage windows available.</p>{% endif %}
{% if usage.stale %}<p class="codex-usage-note">Showing the last available snapshot. The next refresh will retry.</p>{% endif %}
{% else %}<p class="codex-usage-state is-error" role="status">Usage is unavailable right now. The next refresh will retry.</p>{% endif %}
@@ -0,0 +1,6 @@
{% load static %}<div class="codex-usage" data-codex-usage>
<div class="codex-usage-panel" hx-get="{% url 'dashboard:codex_usage' %}" hx-trigger="load, every 60s" hx-swap="innerHTML" aria-busy="true">
<p class="codex-usage-state" role="status">Loading usage…</p>
</div>
<p class="codex-usage-footer">Next refresh <time data-next-refresh>soon</time></p>
</div>