feat(03-02): implement printer detail page with driver info and regenerate placeholder

- Add GET /printers/{printer_id} route to pages.py with LEFT OUTER JOINs on Client and Driver
- Create printer_detail.html full-page template showing all config fields and driver info
- Display "No driver assigned" when driver FK is null
- Add disabled "Regenerate Package" button (Phase 4 placeholder)
- Make printer names in printer_list.html clickable links to detail page
This commit is contained in:
2026-04-10 13:04:52 +02:00
parent 6e7892e862
commit cad664c0f6
3 changed files with 64 additions and 1 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
<tbody>
{% for p in printers %}
<tr>
<td>{{ p.name }}</td>
<td><a href="/printers/{{ p.id }}">{{ p.name }}</a></td>
<td>{{ p.ip_address }}</td>
<td>{{ p.port_name }}</td>
<td>{{ p.driver.original_filename if p.driver_id else '—' }}</td>
+33
View File
@@ -0,0 +1,33 @@
{% extends "base.html" %}
{% block content %}
<h1>{{ printer.name }}</h1>
<article>
<h2>Configuration</h2>
<dl>
<dt>IP Address</dt><dd>{{ printer.ip_address }}</dd>
<dt>Port Name</dt><dd>{{ printer.port_name }}</dd>
<dt>Duplex Mode</dt><dd>{{ printer.duplex_mode }}</dd>
<dt>Color Mode</dt><dd>{{ "Color" if printer.color_mode else "Grayscale" }}</dd>
<dt>Paper Size</dt><dd>{{ printer.paper_size }}</dd>
<dt>Collate</dt><dd>{{ "Yes" if printer.collate else "No" }}</dd>
<dt>Client</dt><dd>{{ printer.client.name if printer.client_id else "Unassigned" }}</dd>
</dl>
<h2>Driver</h2>
{% if printer.driver_id %}
<dl>
<dt>Package</dt><dd>{{ printer.driver.original_filename }}</dd>
<dt>Driver Name(s)</dt><dd>{{ driver_names | join(", ") }}</dd>
<dt>Architecture</dt><dd>{{ printer.driver.architecture or "Unknown" }}</dd>
</dl>
{% else %}
<p>No driver assigned</p>
{% endif %}
<h2>Actions</h2>
<button disabled aria-busy="false" title="Available after script generation is implemented (Phase 4)">
Regenerate Package
</button>
<a href="/printers" role="button" class="secondary">Back to Printers</a>
</article>
{% endblock %}