From c577da47793fdfc2027a76b5328626443f360f64 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 20 Oct 2025 11:54:12 +0100 Subject: [PATCH] Enhance LLM import preview with detailed M2M field handling and improved exclusion toggle functionality --- .../sbas/partials/import_preview.html | 153 +++++++++++++++--- 1 file changed, 129 insertions(+), 24 deletions(-) diff --git a/sbas/templates/sbas/partials/import_preview.html b/sbas/templates/sbas/partials/import_preview.html index 1623e6c7..21c6d617 100644 --- a/sbas/templates/sbas/partials/import_preview.html +++ b/sbas/templates/sbas/partials/import_preview.html @@ -34,22 +34,100 @@

Feedback: {{ item.payload.feedback|default:''|safe }}

{% endif %} -

Missing M2M: - {% if item.missing_m2m %} -

- {% else %} - None - {% endif %} -

+ {% endif %} + {% if item.missing_map.Finding %} + {% for val in item.missing_map.Finding %} + + {% endfor %} + {% endif %} + + {% if item.missing_map.Finding %} +
Would create: {{ item.missing_map.Finding|join:", " }}
+ {% endif %} + + + + +
Structure: + {% if item.resolved_m2m.structure %} + {% for val in item.resolved_m2m.structure %} + + {% endfor %} + {% endif %} + {% if item.missing_map.Structure %} + {% for val in item.missing_map.Structure %} + + {% endfor %} + {% endif %} + + {% if item.missing_map.Structure %} +
Would create: {{ item.missing_map.Structure|join:", " }}
+ {% endif %} +
+ + +
Condition: + {% if item.resolved_m2m.condition %} + {% for val in item.resolved_m2m.condition %} + + {% endfor %} + {% endif %} + {% if item.missing_map.Condition %} + {% for val in item.missing_map.Condition %} + + {% endfor %} + {% endif %} + + {% if item.missing_map.Condition %} +
Would create: {{ item.missing_map.Condition|join:", " }}
+ {% endif %} +
+ + +
Presentation: + {% if item.resolved_m2m.presentation %} + {% for val in item.resolved_m2m.presentation %} + + {% endfor %} + {% endif %} + {% if item.missing_map.Presentation %} + {% for val in item.missing_map.Presentation %} + + {% endfor %} + {% endif %} + + {% if item.missing_map.Presentation %} +
Would create: {{ item.missing_map.Presentation|join:", " }}
+ {% endif %} +
+ + +
Subspecialty: + {% if item.resolved_m2m.subspecialty %} + {% for val in item.resolved_m2m.subspecialty %} + + {% endfor %} + {% endif %} + {% if item.missing_map.Subspecialty %} + {% for val in item.missing_map.Subspecialty %} + + {% endfor %} + {% endif %} + + {% if item.missing_map.Subspecialty %} +
Would create: {{ item.missing_map.Subspecialty|join:", " }}
+ {% endif %} +
+
@@ -68,8 +146,8 @@