70 lines
3.0 KiB
HTML
70 lines
3.0 KiB
HTML
<tr id="augmented-part-{{ ap.id }}">
|
|
<td colspan="12">
|
|
<form id="augmented-part-edit-form-{{ ap.id }}"
|
|
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>
|
|
<label class="check"><input type="checkbox" name="on_website" value="true" {{ "checked" if ap.on_website }}> On website</label>
|
|
<label class="check"><input type="checkbox" name="preferred_part" value="true" {{ "checked" if ap.preferred_part }}> Preferred part</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>
|
|
|
|
<div hx-get="/admin/augmented-parts/{{ ap.id }}/attachment-points"
|
|
hx-trigger="load"
|
|
hx-swap="outerHTML">
|
|
</div>
|
|
|
|
<div hx-get="/admin/augmented-parts/{{ ap.id }}/fits"
|
|
hx-trigger="load"
|
|
hx-swap="outerHTML">
|
|
</div>
|
|
</td>
|
|
</tr>
|