fix: enforce mutability checks for all fields

This commit is contained in:
Björn Fromme
2026-03-16 12:03:00 +01:00
parent e6880b7fed
commit 9cef24f827
3 changed files with 67 additions and 3 deletions
+5 -1
View File
@@ -41,7 +41,8 @@
{%- for child in form %}
{% set choiceData = form.vars.choices[loop.index0] is defined ? form.vars.choices[loop.index0].data : null %}
{% set description = child.vars.attr['data-description']|default(null) %}
{% set isReadonly = child.vars.attr.readonly is defined %}
{% set fieldReadonly = form.vars.attr.readonly is defined %}
{% set isReadonly = fieldReadonly or child.vars.attr.readonly is defined %}
{%- set child_attr = {} -%}
{%- if attr['hx-trigger'] is defined -%}
{%- set child_attr = {
@@ -51,6 +52,9 @@
'hx-swap': attr['hx-swap']
} -%}
{%- endif -%}
{%- if fieldReadonly and child.vars.attr.readonly is not defined -%}
{%- set child_attr = child_attr|merge({'readonly': true}) -%}
{%- endif -%}
<tr>
<td class="border border-primary-bg p-2 align-top">
<div>{{- child.vars.label -}}</div>