From e25471531cbdd0724b6f0b52fd4339db6dc89015 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Tue, 3 Mar 2026 17:06:42 -0500 Subject: [PATCH] Mar 03 2026: fixed inspection result viewer, overlapped elements 3 --- app/templates/inspections/view.html | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/app/templates/inspections/view.html b/app/templates/inspections/view.html index 0de1e82..951cbb8 100644 --- a/app/templates/inspections/view.html +++ b/app/templates/inspections/view.html @@ -289,25 +289,22 @@ {% endfor %} {% if vis.show %} - {# Flush pending section first #} - {% if remap.pending_sec is not none %} - {# Section: 1 row tall, spanning all 12 cols #} -
-
{{ remap.pending_sec.label }}
-
- {# Section consumed out_row; increment so the next data field gets a fresh row. - Set last_orig_row to the current field's original row so the normal - row-change check below does NOT fire again (avoiding a double-increment). #} - {% set remap.out_row = remap.out_row + 1 %} - {% set remap.pending_sec = none %} - {% set remap.last_orig_row = field.row %} - {% endif %} - - {# Advance out_row only when the original row changes between consecutive - data fields (section flushes above already handle their own increment). #} + {# Advance out_row for any row gap since the last rendered field. + This MUST happen before flushing the section head so the section + always appears below the previous content, never on the same row. #} {% if field.row != remap.last_orig_row and remap.last_orig_row != -1 %} {% set remap.out_row = remap.out_row + 1 %} {% endif %} + + {# Flush pending section head onto its own row, then advance for data. #} + {% if remap.pending_sec is not none %} +
+
{{ remap.pending_sec.label }}
+
+ {% set remap.out_row = remap.out_row + 1 %} + {% set remap.pending_sec = none %} + {% endif %} + {% set remap.last_orig_row = field.row %} {# Render the field at its original col/colSpan but remapped row #}