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 @@
- {% for m in item.missing_m2m %}
- -
- {{ m.model }}:
- {% for val in m.values %}
-
- {% endfor %}
-
+ M2M fields (click to exclude)
+ Green = will be created/attached. Click a value to exclude it (grey).
+
+
+
Finding:
+ {% if item.resolved_m2m.finding %}
+ {% for val in item.resolved_m2m.finding %}
+
{% endfor %}
-
- {% else %}
- None
- {% endif %}
-
+ {% endif %}
+ {% if item.missing_map.Finding %}
+ {% for val in item.missing_map.Finding %}
+
+ {% endfor %}
+ {% endif %}
+
(none)
+ {% 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 %}
+
(none)
+ {% 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 %}
+
(none)
+ {% 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 %}
+
(none)
+ {% 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 %}
+
(none)
+ {% if item.missing_map.Subspecialty %}
+
Would create: {{ item.missing_map.Subspecialty|join:", " }}
+ {% endif %}
+
+
@@ -68,8 +146,8 @@