feat(12-02): wire all template strings to Alpine i18n store

- dashboard.html: headings, quick actions, empty states wired to x-text
- printers.html: h1, add button, h2 wired to x-text
- printers_new.html: all form labels (span pattern), options, submit buttons wired
- clients.html: headings, label, submit button wired
- client_detail.html: back link, section heading wired
- drivers.html: all headings, label, buttons, spinner wired
- packages.html: heading, description, table headers, empty state wired
- printer_detail.html: all dt/dd, section headings, copy buttons, script/export links wired with conditional Jinja2 for color/collate/client
- partials/printer_list.html: table headers, Yes/No cells (Alpine ternary), delete button wired
- partials/printer_edit_modal.html: edit trigger, modal title, all labels (span pattern), options, save/cancel wired
- partials/client_list.html: empty state, table headers wired
- partials/driver_list.html: table headers, unknown values, empty state wired
- Fix test_printers_library_no_form: check form element attribute instead of UI label string (now in i18n dict)
This commit is contained in:
2026-04-15 15:50:35 +02:00
parent e8801ecd34
commit 59fc8b1e9c
13 changed files with 132 additions and 123 deletions
+16 -13
View File
@@ -1,6 +1,6 @@
<div id="printer-list">
{% if not grouped %}
<p>No printers configured yet.</p>
<p x-data x-text="$store.i18n.t('no_printers')">No printers configured yet.</p>
{% else %}
{% for client_name, printers in grouped.items() %}
<section>
@@ -13,15 +13,15 @@
<table>
<thead>
<tr>
<th>Name</th>
<th>IP Address</th>
<th>Port</th>
<th>Driver</th>
<th>Duplex</th>
<th>Color</th>
<th>Paper</th>
<th>Collate</th>
<th>Actions</th>
<th x-data x-text="$store.i18n.t('th_name')">Name</th>
<th x-data x-text="$store.i18n.t('th_ip')">IP Address</th>
<th x-data x-text="$store.i18n.t('th_port')">Port</th>
<th x-data x-text="$store.i18n.t('th_driver')">Driver</th>
<th x-data x-text="$store.i18n.t('th_duplex')">Duplex</th>
<th x-data x-text="$store.i18n.t('th_color')">Color</th>
<th x-data x-text="$store.i18n.t('th_paper')">Paper</th>
<th x-data x-text="$store.i18n.t('th_collate')">Collate</th>
<th x-data x-text="$store.i18n.t('th_actions')">Actions</th>
</tr>
</thead>
<tbody>
@@ -32,16 +32,19 @@
<td>{{ p.port_name }}</td>
<td>{{ p.driver.original_filename if p.driver_id else '—' }}</td>
<td>{{ p.duplex_mode }}</td>
<td>{{ 'Yes' if p.color_mode else 'No' }}</td>
<td x-data="{ val: {{ 'true' if p.color_mode else 'false' }} }"
x-text="val ? $store.i18n.t('yes') : $store.i18n.t('no')">{{ 'Yes' if p.color_mode else 'No' }}</td>
<td>{{ p.paper_size }}</td>
<td>{{ 'Yes' if p.collate else 'No' }}</td>
<td x-data="{ val: {{ 'true' if p.collate else 'false' }} }"
x-text="val ? $store.i18n.t('yes') : $store.i18n.t('no')">{{ 'Yes' if p.collate else 'No' }}</td>
<td>
{% include "partials/printer_edit_modal.html" %}
<button
hx-delete="/printers/{{ p.id }}"
hx-target="#printer-list"
hx-swap="outerHTML"
hx-confirm="Delete '{{ p.name }}'?">
hx-confirm="Delete '{{ p.name }}'?"
x-data x-text="$store.i18n.t('delete')">
Delete
</button>
</td>