Adding ability to edit attachment points on augmented item details
This commit is contained in:
1 parent
25fccd617f
commit
aef60d77be
5 files changed
+83
-37
No files matched your search
@@ -22,6 +22,7 @@
|
||||
<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"
|
||||
@@ -33,4 +34,5 @@
|
||||
hx-swap="outerHTML"
|
||||
hx-confirm="Delete this attachment point?">Delete</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -7,6 +7,7 @@
|
||||
<p class="muted" style="font-size:0.85rem;margin:0 0 0.5rem">No attachment points yet.</p>
|
||||
{% endfor %}
|
||||
|
||||
{% if can_write_attachment_points %}
|
||||
<form hx-post="/admin/augmented-parts/{{ augmented_part_id }}/attachment-points"
|
||||
hx-target="#ap-{{ augmented_part_id }}-attachment-points"
|
||||
hx-swap="outerHTML"
|
||||
@@ -35,4 +36,5 @@
|
||||
<div id="ap-{{ augmented_part_id }}-add-connection-options"></div>
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -3,20 +3,6 @@
|
||||
{% block body %}
|
||||
{% include "_nav.html" %}
|
||||
|
||||
{%- macro conn_desc(point) -%}
|
||||
{%- if point.iso_thread -%}
|
||||
ISO M{{ point.iso_thread.diameter_mm }}×{{ point.iso_thread.pitch_mm }}
|
||||
{%- elif point.unc_thread -%}
|
||||
UNC {{ point.unc_thread.diameter_fraction }}-{{ point.unc_thread.tpi }} {{ point.unc_thread.series.value }}
|
||||
{%- elif point.clamp_connection -%}
|
||||
Clamp {{ point.clamp_connection.min_mm if point.clamp_connection.min_mm is not none else point.clamp_connection.min_in }}–{{ point.clamp_connection.max_mm if point.clamp_connection.max_mm is not none else point.clamp_connection.max_in }}
|
||||
{%- elif point.static_connection -%}
|
||||
Static {{ point.static_connection.od_mm }} mm OD
|
||||
{%- else -%}
|
||||
—
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
<main class="container">
|
||||
<p><a href="/admin/augmented-parts" class="btn btn-ghost">← Augmented Parts</a></p>
|
||||
|
||||
@@ -62,20 +48,14 @@
|
||||
</dl>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card">
|
||||
<h2>Attachment points</h2>
|
||||
{% for point in attachment_points %}
|
||||
<div class="ap-item">
|
||||
<span class="ap-item-name">{{ point.attachment_point_name.name }}</span>
|
||||
<code class="ap-item-conn">{{ conn_desc(point) }}</code>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="muted">No attachment points recorded.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if can_read_attachment_points %}
|
||||
<div class="card">
|
||||
{% include "admin/_augmented_part_attachment_points.html" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if can_read_fits %}
|
||||
<div class="card">
|
||||
{% include "admin/_augmented_part_fits.html" %}
|
||||
|
||||
Reference in new issue
Block a user