Files
fitguide/app/templates/admin/_augmented_part_row_edit.html
T
2026-07-02 12:38:59 -03:00

57 lines
2.4 KiB
HTML

<tr id="augmented-part-{{ ap.id }}">
<td colspan="9">
<form hx-post="/admin/augmented-parts/{{ ap.id }}"
hx-target="#augmented-part-{{ ap.id }}"
hx-swap="outerHTML"
class="inline-edit">
<span class="muted">#{{ ap.id }}</span>
<label>SKU <input type="text" name="sku" value="{{ ap.sku or '' }}" placeholder="optional"></label>
<label>Description <input type="text" name="description" value="{{ ap.description }}" required></label>
<label>Colour
<select name="colour_id" required>
{% for pc in part_colours %}
<option value="{{ pc.id }}" {{ "selected" if pc.id == ap.colour_id }}>{{ pc.name }}</option>
{% endfor %}
</select>
</label>
<label>Manufacturer
<select name="manufacturer_id" required>
{% for m in manufacturers %}
<option value="{{ m.id }}" {{ "selected" if m.id == ap.manufacturer_id }}>{{ m.name }}</option>
{% endfor %}
</select>
</label>
<label>Model
<select name="scope_model_id">
<option value="" {{ "selected" if ap.scope_model_id is none }}>— none —</option>
{% for sm in scope_models %}
<option value="{{ sm.id }}" {{ "selected" if sm.id == ap.scope_model_id }}>{{ sm.name }} ({{ sm.manufacturer.name }})</option>
{% endfor %}
</select>
</label>
<label>Type
<select name="part_type_id" required>
{% for pt in part_types %}
<option value="{{ pt.id }}" {{ "selected" if pt.id == ap.part_type_id }}>{{ pt.name }}</option>
{% endfor %}
</select>
</label>
<label>Sub Type
<select name="sub_part_type_id">
<option value="" {{ "selected" if ap.sub_part_type_id is none }}>— none —</option>
{% for spt in sub_part_types %}
<option value="{{ spt.id }}" {{ "selected" if spt.id == ap.sub_part_type_id }}>{{ spt.name }} ({{ spt.part_type.name }})</option>
{% endfor %}
</select>
</label>
<div class="row-actions">
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn btn-ghost"
hx-get="/admin/augmented-parts/{{ ap.id }}/row"
hx-target="#augmented-part-{{ ap.id }}"
hx-swap="outerHTML">Cancel</button>
</div>
</form>
</td>
</tr>