Adding augmented parts

This commit is contained in:
Ian Roddis committed 2026-07-02 12:38:59 -03:00
1 parent 2e7002b73b
commit 00fb43c8ed
14 files changed
+590 -2

No files matched your search

@@ -0,0 +1,56 @@
<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>