diff --git a/app/static/css/style.css b/app/static/css/style.css index 3174642..987887e 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -505,43 +505,31 @@ textarea:focus { margin-left: auto; } -.fit-item { - padding: 0.5rem 0; - border-bottom: 1px solid var(--border); - font-size: 0.9rem; -} - -.fit-item:last-of-type { - border-bottom: none; -} - -.fit-item-main { - display: flex; - align-items: center; - gap: 0.5rem; - flex-wrap: wrap; - margin-bottom: 0.3rem; -} - .fit-item-arrow { color: var(--muted); + text-align: center; } .fit-badge { text-transform: uppercase; } -/* - /*font-size: 0.7rem; -letter-spacing: 0.03em; -padding: 0.1rem 0.5rem; -font-weight: 600; +/* Fits table on the augmented part detail page */ +.fit-table select, +.fit-table input[type="text"] { + min-width: 8rem; } -*/ -.augmented-fit-row-group { - padding: 0.5rem 0; - border-bottom: 2px solid var(--muted); +.fit-table .fit-add-row { + background: var(--surface-2); +} + +.fit-table .fit-add-row td { + vertical-align: top; +} + +.fit-notes-cell { + min-width: 14rem; } .fit-badge-possible { diff --git a/app/templates/admin/_augmented_part_fit_row.html b/app/templates/admin/_augmented_part_fit_row.html index d7cc657..d1c79f2 100644 --- a/app/templates/admin/_augmented_part_fit_row.html +++ b/app/templates/admin/_augmented_part_fit_row.html @@ -12,42 +12,18 @@ {%- endif -%} {%- endmacro %} -
-
- {{ fit.label.value | capitalize }} - {{ own_ap.attachment_point_name.name }} ({{ conn_desc(own_ap) }}) - ↔ - {{ other_part.sku }} {{ other_part.part_type.name }} -
- {% if can_write %} -
- {% if fit.label.value != "exact" %} - - {% endif %} - {% if fit.label.value != "possible" %} - - {% endif %} - {% if fit.label.value != "none" %} - - {% endif %} - -
- {% endif %} - -
+ + {{ fit.label.value | capitalize }} + + {{ own_ap.attachment_point_name.name }} +
{{ conn_desc(own_ap) }}
+ + ↔ + + {{ other_part.sku or other_part.description }} +
{{ other_part.part_type.name }}
+ + {% for note in fit.notes %}
{{ note.username }} · {{ note.created_at.strftime("%Y-%m-%d %H:%M") }} @@ -59,8 +35,37 @@ hx-target="#fit-{{ fit.id }}" hx-swap="outerHTML" class="inline-edit fit-note-form"> - + {% endif %} -
-
+ + {% if can_write %} + +
+ {% if fit.label.value != "exact" %} + + {% endif %} + {% if fit.label.value != "possible" %} + + {% endif %} + {% if fit.label.value != "none" %} + + {% endif %} + +
+ + {% endif %} + diff --git a/app/templates/admin/_augmented_part_fits.html b/app/templates/admin/_augmented_part_fits.html index 5c20fbd..d7f8a38 100644 --- a/app/templates/admin/_augmented_part_fits.html +++ b/app/templates/admin/_augmented_part_fits.html @@ -4,13 +4,77 @@ {% if message %}

{{ message }}

{% endif %} {% if error %}

{{ error }}

{% endif %} - {% for view in fit_views %} - {% with fit=view.fit, own_ap=view.own_ap, other_ap=view.other_ap, other_part=view.other_part %} - {% include "admin/_augmented_part_fit_row.html" %} - {% endwith %} - {% else %} -

No fits recorded yet.

- {% endfor %} + {% set add_form_id = "ap-" ~ augmented_part_id ~ "-fit-add-form" %} + {% if can_write %} +
+ {% endif %} + + + + + + + + + + {% if can_write %}{% endif %} + + + + {% if can_write %} + + + + + + + + + {% endif %} + + {% for view in fit_views %} + {% with fit=view.fit, own_ap=view.own_ap, other_ap=view.other_ap, other_part=view.other_part %} + {% include "admin/_augmented_part_fit_row.html" %} + {% endwith %} + {% else %} + + + + {% endfor %} + +
TypeThis part's pointFits with partNotes
+ + + + ↔ + +
+
+ + + +
No fits recorded yet.
{% if can_write %}
@@ -19,43 +83,5 @@
- -
- - -
- - - -
{% endif %}
diff --git a/app/templates/admin/_fit_other_points_select.html b/app/templates/admin/_fit_other_points_select.html index 6b03731..bcf654e 100644 --- a/app/templates/admin/_fit_other_points_select.html +++ b/app/templates/admin/_fit_other_points_select.html @@ -1,12 +1,12 @@ {% if points %} - {% for p in points %} {% endfor %} {% else %} - +

This part has no attachment points yet — one matching yours will be created automatically.

diff --git a/app/web/admin.py b/app/web/admin.py index 224301e..a1689b4 100644 --- a/app/web/admin.py +++ b/app/web/admin.py @@ -2682,7 +2682,12 @@ async def fit_other_points( else [] ) return templates.TemplateResponse( - request, "admin/_fit_other_points_select.html", {"points": points} + request, + "admin/_fit_other_points_select.html", + { + "points": points, + "form_id": f"ap-{augmented_part_id}-fit-add-form", + }, )