Add Jinja2 web UI with Bootstrap 5 dark theme

- app/templates/: base layout with sidebar nav + 6 pages
  (dashboard, printers, jobs, filaments, todos, pricing)
- app/routers/ui.py: HTML routes querying the DB live
- API routes moved to /api/* prefix
- requirements: jinja2, python-multipart

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Hohenberg
2026-06-18 21:26:23 +02:00
parent f4e991e5dc
commit ee0b1b39e9
10 changed files with 473 additions and 9 deletions

40
app/templates/todos.html Normal file
View File

@@ -0,0 +1,40 @@
{% extends "base.html" %}
{% block title %}To-Do — POPS{% endblock %}
{% block content %}
<h5 class="text-white mb-4">To-Do</h5>
<div class="card">
{% if todos %}
<table class="table table-dark table-hover mb-0 align-middle">
<thead>
<tr class="text-secondary small">
<th class="fw-normal">Task</th>
<th class="fw-normal">Printer</th>
<th class="fw-normal text-center">Done</th>
<th class="fw-normal text-end">Created</th>
</tr>
</thead>
<tbody>
{% for t in todos %}
<tr class="{% if t.done %}opacity-50{% endif %}">
<td class="{% if t.done %}text-decoration-line-through text-secondary{% else %}text-white{% endif %}">
{{ t.title }}
</td>
<td class="text-secondary small">{{ t.printer.name if t.printer else '—' }}</td>
<td class="text-center">
{% if t.done %}
<i class="bi bi-check-circle-fill text-success"></i>
{% else %}
<i class="bi bi-circle text-secondary"></i>
{% endif %}
</td>
<td class="text-secondary small text-end">{{ t.created_at.strftime('%d.%m.%Y') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="card-body text-secondary">No to-do items yet.</div>
{% endif %}
</div>
{% endblock %}