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:
@@ -1,20 +1,20 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Add Printer</h1>
|
||||
<h1 x-data x-text="$store.i18n.t('add_printer_title')">Add Printer</h1>
|
||||
|
||||
<p><a href="/printers">← Back to Printer Library</a></p>
|
||||
<p><a href="/printers" x-data x-text="$store.i18n.t('back_to_printer_library')">← Back to Printer Library</a></p>
|
||||
|
||||
<div x-data="{ ip: '', port: '', portEdited: false }">
|
||||
<form action="/printers" method="post">
|
||||
|
||||
<label>
|
||||
Printer Name
|
||||
<span x-text="$store.i18n.t('printer_name')">Printer Name</span>
|
||||
<input type="text" name="name" placeholder="e.g. HP LaserJet 4050" required>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
IP Address
|
||||
<span x-text="$store.i18n.t('ip_address')">IP Address</span>
|
||||
<input type="text" name="ip_address"
|
||||
x-model="ip"
|
||||
@input="if (!portEdited) port = 'IP_' + ip.replaceAll('.', '_')"
|
||||
@@ -23,7 +23,7 @@
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Port Name
|
||||
<span x-text="$store.i18n.t('port_name')">Port Name</span>
|
||||
<input type="text" name="port_name"
|
||||
x-model="port"
|
||||
@change="portEdited = true"
|
||||
@@ -32,9 +32,9 @@
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Driver
|
||||
<span x-text="$store.i18n.t('driver')">Driver</span>
|
||||
<select name="driver_id" id="printer-form-driver-select">
|
||||
<option value="">-- No driver --</option>
|
||||
<option value="" x-text="$store.i18n.t('no_driver_option')">-- No driver --</option>
|
||||
{% for item in driver_data %}
|
||||
<option value="{{ item.driver.id }}">
|
||||
{{ item.driver.original_filename }} ({{ item.names | join(', ') }})
|
||||
@@ -44,21 +44,21 @@
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Duplex Mode
|
||||
<span x-text="$store.i18n.t('duplex_mode')">Duplex Mode</span>
|
||||
<select name="duplex_mode">
|
||||
<option value="OneSided" selected>One-Sided</option>
|
||||
<option value="LongEdge">Long Edge</option>
|
||||
<option value="ShortEdge">Short Edge</option>
|
||||
<option value="OneSided" selected x-text="$store.i18n.t('one_sided')">One-Sided</option>
|
||||
<option value="LongEdge" x-text="$store.i18n.t('long_edge')">Long Edge</option>
|
||||
<option value="ShortEdge" x-text="$store.i18n.t('short_edge')">Short Edge</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="color_mode" value="on" checked>
|
||||
Color Mode
|
||||
<span x-text="$store.i18n.t('color_mode')">Color Mode</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Paper Size
|
||||
<span x-text="$store.i18n.t('paper_size')">Paper Size</span>
|
||||
<select name="paper_size">
|
||||
<option value="A4" selected>A4</option>
|
||||
<option value="Letter">Letter</option>
|
||||
@@ -68,20 +68,20 @@
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="collate" value="on" checked>
|
||||
Collate
|
||||
<span x-text="$store.i18n.t('collate')">Collate</span>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Client
|
||||
<span x-text="$store.i18n.t('client')">Client</span>
|
||||
<select name="client_id">
|
||||
<option value="">-- Unassigned --</option>
|
||||
<option value="" x-text="$store.i18n.t('unassigned_option')">-- Unassigned --</option>
|
||||
{% for c in clients %}
|
||||
<option value="{{ c.id }}">{{ c.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<button type="submit">Save Printer</button>
|
||||
<button type="submit" x-text="$store.i18n.t('save_printer')">Save Printer</button>
|
||||
</form>
|
||||
|
||||
<form hx-post="/drivers/upload"
|
||||
@@ -90,10 +90,10 @@
|
||||
hx-swap="outerHTML">
|
||||
<input type="hidden" name="caller" value="printer_form">
|
||||
<label>
|
||||
Upload New Driver
|
||||
<span x-text="$store.i18n.t('upload_new_driver')">Upload New Driver</span>
|
||||
<input type="file" name="file" accept=".zip" required>
|
||||
</label>
|
||||
<button type="submit" class="secondary">Upload Driver</button>
|
||||
<button type="submit" class="secondary" x-text="$store.i18n.t('upload_driver')">Upload Driver</button>
|
||||
</form>
|
||||
<div id="driver-list" style="display:none"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user