Files
skeleton-api/app/templates/admin/_attachment_point_row.html
T
2026-07-02 14:06:18 -03:00

39 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% if ap.iso_thread %}
{% set conn_type = "ISO Thread" %}
{% set conn_label = "M" ~ ap.iso_thread.diameter_mm ~ "×" ~ ap.iso_thread.pitch_mm %}
{% elif ap.unc_thread %}
{% set conn_type = "UNC Thread" %}
{% set conn_label = ap.unc_thread.diameter_fraction ~ "-" ~ ap.unc_thread.tpi ~ " " ~ ap.unc_thread.series.value %}
{% elif ap.clamp_connection %}
{% set conn_type = "Clamp Connection" %}
{% if ap.clamp_connection.min_mm is not none %}
{% set conn_label = ap.clamp_connection.min_mm ~ "–" ~ ap.clamp_connection.max_mm ~ " mm" %}
{% else %}
{% set conn_label = ap.clamp_connection.min_in ~ "–" ~ ap.clamp_connection.max_in ~ " in" %}
{% endif %}
{% elif ap.static_connection %}
{% set conn_type = "Static Connection" %}
{% set conn_label = ap.static_connection.od_mm ~ " mm OD" %}
{% else %}
{% set conn_type = "—" %}
{% set conn_label = "—" %}
{% endif %}
<tr id="attachment-point-{{ ap.id }}">
<td>{{ ap.id }}</td>
<td>{{ ap.augmented_part.description | truncate(40) }}</td>
<td>{{ ap.attachment_point_name.name }}</td>
<td>{{ conn_type }}</td>
<td><code>{{ conn_label }}</code></td>
<td class="row-actions">
<button class="btn btn-ghost"
hx-get="/admin/attachment-points/{{ ap.id }}/edit"
hx-target="#attachment-point-{{ ap.id }}"
hx-swap="outerHTML">Edit</button>
<button class="btn btn-danger"
hx-delete="/admin/attachment-points/{{ ap.id }}"
hx-target="#attachment-point-{{ ap.id }}"
hx-swap="outerHTML"
hx-confirm="Delete attachment point #{{ ap.id }}?">Delete</button>
</td>
</tr>