39 lines
1.8 KiB
HTML
39 lines
1.8 KiB
HTML
{% 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>
|
||
{% if can_write_attachment_points %}
|
||
<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>
|
||
{% endif %}
|
||
</div>
|