Files
ImpTune/imptune/templates/partials/driver_upload_with_oob.html
T
kawa 10ee09a5aa fix(09-01): resolve driver upload 500 and add HTMX OOB refresh path
- Import Form from fastapi for mixed multipart + form field support
- Add caller: str = Form('') parameter to upload_driver handler
- Capture new_driver from Driver.get_or_create() return tuple
- Branch on caller == 'printer_form' to emit OOB-enabled response
- Create partials/driver_upload_with_oob.html with primary driver_list
  include + hx-swap-oob select targeting id=printer-form-driver-select
- New driver is auto-selected via new_driver_id context variable

All 13 driver upload tests pass including 4 new OOB contract tests.
Full non-e2e suite: 111 passed.
2026-04-13 10:50:27 +02:00

12 lines
415 B
HTML

{% include "partials/driver_list.html" %}
<select name="driver_id" id="printer-form-driver-select" hx-swap-oob="true">
<option value="">-- No driver --</option>
{% for item in driver_data %}
<option value="{{ item.driver.id }}"
{% if item.driver.id == new_driver_id %}selected{% endif %}>
{{ item.driver.original_filename }} ({{ item.names | join(', ') }})
</option>
{% endfor %}
</select>