Adding Attachment Points
This commit is contained in:
1 parent
2767fb1c8e
commit
ceae27a12e
15 files changed
+729
-3
No files matched your search
@@ -0,0 +1,59 @@
|
||||
{% if ap.iso_thread_id %}{% set current_type = "iso_thread" %}
|
||||
{% elif ap.unc_thread_id %}{% set current_type = "unc_thread" %}
|
||||
{% elif ap.clamp_connection_id %}{% set current_type = "clamp_connection" %}
|
||||
{% elif ap.static_connection_id %}{% set current_type = "static_connection" %}
|
||||
{% else %}{% set current_type = "" %}{% endif %}
|
||||
<tr id="attachment-point-{{ ap.id }}">
|
||||
<td colspan="6">
|
||||
<form hx-post="/admin/attachment-points/{{ ap.id }}"
|
||||
hx-target="#attachment-point-{{ ap.id }}"
|
||||
hx-swap="outerHTML"
|
||||
class="inline-edit">
|
||||
<span class="muted">#{{ ap.id }}</span>
|
||||
<label>Part
|
||||
<select name="augmented_part_id" required>
|
||||
{% for part in augmented_parts %}
|
||||
<option value="{{ part.id }}"
|
||||
{% if part.id == ap.augmented_part_id %}selected{% endif %}>
|
||||
{{ part.description | truncate(50) }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label>Point Name
|
||||
<select name="attachment_point_name_id" required>
|
||||
{% for apn in attachment_point_names %}
|
||||
<option value="{{ apn.id }}"
|
||||
{% if apn.id == ap.attachment_point_name_id %}selected{% endif %}>
|
||||
{{ apn.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label>Connection Type
|
||||
<select name="connection_type" required
|
||||
hx-get="/admin/attachment-points/connection-options"
|
||||
hx-target="#edit-connection-options-{{ ap.id }}"
|
||||
hx-trigger="change"
|
||||
hx-include="[name='connection_type']">
|
||||
<option value="">— select type —</option>
|
||||
<option value="iso_thread" {% if current_type == "iso_thread" %}selected{% endif %}>ISO Thread</option>
|
||||
<option value="unc_thread" {% if current_type == "unc_thread" %}selected{% endif %}>UNC Thread</option>
|
||||
<option value="clamp_connection" {% if current_type == "clamp_connection" %}selected{% endif %}>Clamp Connection</option>
|
||||
<option value="static_connection" {% if current_type == "static_connection" %}selected{% endif %}>Static Connection</option>
|
||||
</select>
|
||||
</label>
|
||||
{# Render the current connection select pre-filled #}
|
||||
<div id="edit-connection-options-{{ ap.id }}">
|
||||
{% 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/attachment-points/{{ ap.id }}/row"
|
||||
hx-target="#attachment-point-{{ ap.id }}"
|
||||
hx-swap="outerHTML">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
Reference in new issue
Block a user