Files
ImpTune/imptune/templates/partials/printer_list.html
T
kawa 59fc8b1e9c 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)
2026-04-15 15:50:35 +02:00

59 lines
2.3 KiB
HTML

<div id="printer-list">
{% if not grouped %}
<p x-data x-text="$store.i18n.t('no_printers')">No printers configured yet.</p>
{% else %}
{% for client_name, printers in grouped.items() %}
<section>
{% set group_client_id = printers[0].client_id if printers else None %}
{% if group_client_id %}
<h3><a href="/clients/{{ group_client_id }}">{{ client_name }}</a></h3>
{% else %}
<h3>{{ client_name }}</h3>
{% endif %}
<table>
<thead>
<tr>
<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>
{% for p in printers %}
<tr>
<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>
<td>{{ p.duplex_mode }}</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 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 }}'?"
x-data x-text="$store.i18n.t('delete')">
Delete
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
{% endfor %}
{% endif %}
</div>