05/26 Fix form layout broken

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