fix: Swap order of enabled checkbox and hidden input in custom-feeds

The hidden input with value="false" was rendered before the checkbox,
causing request.form.to_dict() to use the hidden input's value instead
of the checkbox's "true" value when checked.

Fix by rendering the checkbox first, then the hidden fallback input.
This ensures that when the checkbox is checked, its "true" value
overwrites the hidden input's "false" value in request.form.to_dict().

The hidden input still serves as a fallback to ensure "false" is
submitted when the checkbox is unchecked (since unchecked checkboxes
don't submit a value).
This commit is contained in:
Chuck
2026-01-11 15:43:35 -05:00
parent 60aad56d0e
commit a315693b44

View File

@@ -259,12 +259,12 @@
</div>
</td>
<td class="px-4 py-3 whitespace-nowrap text-center">
<input type="hidden" name="{{ full_key }}.{{ item_index }}.enabled" value="false">
<input type="checkbox"
name="{{ full_key }}.{{ item_index }}.enabled"
{% if item.get('enabled', true) %}checked{% endif %}
value="true"
class="h-4 w-4 text-blue-600">
<input type="hidden" name="{{ full_key }}.{{ item_index }}.enabled" value="false">
</td>
<td class="px-4 py-3 whitespace-nowrap text-center">
<button type="button"