Adding ability to add attachment points when editing augmented part
This commit is contained in:
1 parent
ceae27a12e
commit
d67b4ceb65
7 files changed
+355
-1
No files matched your search
@@ -0,0 +1,45 @@
|
||||
{% if apoint.iso_thread_id %}{% set current_type = "iso_thread" %}
|
||||
{% elif apoint.unc_thread_id %}{% set current_type = "unc_thread" %}
|
||||
{% elif apoint.clamp_connection_id %}{% set current_type = "clamp_connection" %}
|
||||
{% elif apoint.static_connection_id %}{% set current_type = "static_connection" %}
|
||||
{% else %}{% set current_type = "" %}{% endif %}
|
||||
{# _attachment_point_connection_select.html expects `ap` for pre-selection #}
|
||||
{% set ap = apoint %}
|
||||
{% set connection_type = current_type %}
|
||||
<div id="augmented-part-ap-{{ apoint.id }}">
|
||||
<form hx-post="/admin/augmented-parts/{{ apoint.augmented_part_id }}/attachment-points/{{ apoint.id }}"
|
||||
hx-target="#augmented-part-ap-{{ apoint.id }}"
|
||||
hx-swap="outerHTML"
|
||||
class="inline-edit" style="padding:0.3rem 0">
|
||||
<label>Name
|
||||
<select name="attachment_point_name_id" required>
|
||||
{% for apn in attachment_point_names %}
|
||||
<option value="{{ apn.id }}" {{ "selected" if apn.id == apoint.attachment_point_name_id }}>{{ apn.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label>Type
|
||||
<select name="connection_type" required
|
||||
hx-get="/admin/attachment-points/connection-options"
|
||||
hx-target="#edit-ap-{{ apoint.id }}-connection-options"
|
||||
hx-trigger="change"
|
||||
hx-include="[name='connection_type']">
|
||||
<option value="">— type —</option>
|
||||
<option value="iso_thread" {{ "selected" if current_type == "iso_thread" }}>ISO Thread</option>
|
||||
<option value="unc_thread" {{ "selected" if current_type == "unc_thread" }}>UNC Thread</option>
|
||||
<option value="clamp_connection" {{ "selected" if current_type == "clamp_connection" }}>Clamp Connection</option>
|
||||
<option value="static_connection" {{ "selected" if current_type == "static_connection" }}>Static Connection</option>
|
||||
</select>
|
||||
</label>
|
||||
<div id="edit-ap-{{ apoint.id }}-connection-options">
|
||||
{% include "admin/_attachment_point_connection_select.html" %}
|
||||
</div>
|
||||
<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/{{ apoint.augmented_part_id }}/attachment-points/{{ apoint.id }}/row"
|
||||
hx-target="#augmented-part-ap-{{ apoint.id }}"
|
||||
hx-swap="outerHTML">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
Reference in new issue
Block a user