05/26 Fix form layout broken

This commit is contained in:
2026-05-26 14:19:00 -04:00
parent 650f291784
commit eceee86944
+25 -19
View File
@@ -588,10 +588,19 @@
{% elif ftype == 'label' %}
{# Only show labels that are ancestors of rated fields #}
{% if field.id in ns.visible_label_ids %}
{% if remap.last_orig_row != -1 %}
{% set remap.out_row = remap.out_row + 1 %}
{# Advance row only when original row actually changes #}
{% if field.row != remap.last_orig_row %}
{% if remap.last_orig_row != -1 %}{% set remap.out_row = remap.out_row + 1 %}{% endif %}
{# Flush pending section before the first field on this new row #}
{% if remap.pending_sec is not none %}
<div class="fg-cell" style="grid-column:1 / span 12; grid-row:{{ remap.out_row }} / span 1;">
<div class="section-head"><strong>{{ remap.pending_sec.label }}</strong></div>
</div>
{% set remap.out_row = remap.out_row + 1 %}
{% set remap.pending_sec = none %}
{% endif %}
{% set remap.last_orig_row = field.row %}
{% endif %}
{% set remap.last_orig_row = field.row %}
{% set fs_map = {'small':'0.72rem','normal':'0.82rem','large':'0.96rem','x-large':'1.1rem'} %}
<div class="fg-cell"
style="grid-column: {{ field.col }} / span {{ field.colSpan }};
@@ -612,24 +621,21 @@
{% endfor %}
{% if vis.show %}
{# 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 %}
{# Advance row only when original row actually changes.
Section flush is also guarded here so a label already placed on
this row at the same out_row cannot be displaced. #}
{% if field.row != remap.last_orig_row %}
{% if remap.last_orig_row != -1 %}{% set remap.out_row = remap.out_row + 1 %}{% endif %}
{% if remap.pending_sec is not none %}
<div class="fg-cell" style="grid-column:1 / span 12; grid-row:{{ remap.out_row }} / span 1;">
<div class="section-head"><strong>{{ remap.pending_sec.label }}</strong></div>
</div>
{% set remap.out_row = remap.out_row + 1 %}
{% set remap.pending_sec = none %}
{% endif %}
{% set remap.last_orig_row = field.row %}
{% endif %}
{# Flush pending section head onto its own row, then advance for data. #}
{% if remap.pending_sec is not none %}
<div class="fg-cell" style="grid-column:1 / span 12; grid-row:{{ remap.out_row }} / span 1;">
<div class="section-head"><strong>{{ remap.pending_sec.label }}</strong></div>
</div>
{% 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 #}
<div class="fg-cell"
style="grid-column: {{ field.col }} / span {{ field.colSpan }};