Adding ability to add attachment points when editing augmented part

This commit is contained in:
Ian Roddis committed 2026-07-02 14:13:09 -03:00
1 parent ceae27a12e
commit d67b4ceb65
7 files changed
+355 -1

No files matched your search

@@ -0,0 +1,36 @@
{% if apoint.iso_thread %}
{% set conn_type = "ISO" %}
{% set conn_label = "M" ~ apoint.iso_thread.diameter_mm ~ "×" ~ apoint.iso_thread.pitch_mm %}
{% elif apoint.unc_thread %}
{% set conn_type = "UNC" %}
{% set conn_label = apoint.unc_thread.diameter_fraction ~ "-" ~ apoint.unc_thread.tpi ~ " " ~ apoint.unc_thread.series.value %}
{% elif apoint.clamp_connection %}
{% set conn_type = "Clamp" %}
{% if apoint.clamp_connection.min_mm is not none %}
{% set conn_label = apoint.clamp_connection.min_mm ~ "–" ~ apoint.clamp_connection.max_mm ~ " mm" %}
{% else %}
{% set conn_label = apoint.clamp_connection.min_in ~ "–" ~ apoint.clamp_connection.max_in ~ " in" %}
{% endif %}
{% elif apoint.static_connection %}
{% set conn_type = "Static" %}
{% set conn_label = apoint.static_connection.od_mm ~ " mm OD" %}
{% else %}
{% set conn_type = "—" %}
{% set conn_label = "—" %}
{% endif %}
<div id="augmented-part-ap-{{ apoint.id }}" class="ap-item">
<span class="ap-item-name">{{ apoint.attachment_point_name.name }}</span>
<span class="ap-item-type">{{ conn_type }}</span>
<code class="ap-item-conn">{{ conn_label }}</code>
<div class="row-actions">
<button class="btn btn-ghost"
hx-get="/admin/augmented-parts/{{ apoint.augmented_part_id }}/attachment-points/{{ apoint.id }}/edit"
hx-target="#augmented-part-ap-{{ apoint.id }}"
hx-swap="outerHTML">Edit</button>
<button class="btn btn-danger"
hx-delete="/admin/augmented-parts/{{ apoint.augmented_part_id }}/attachment-points/{{ apoint.id }}"
hx-target="#ap-{{ apoint.augmented_part_id }}-attachment-points"
hx-swap="outerHTML"
hx-confirm="Delete this attachment point?">Delete</button>
</div>
</div>