Files
integreat/resources/templates/transaction-bulk-code/form-errors.html
Bryce a760d15509 refactor(ssr): render the bulk-code modal fully through Selmer
Move all markup in the Transaction Bulk Code modal out of Clojure and into
Selmer templates so bulk_code.clj only assembles data.

- Replace the inline sel/raw HTML strings and one Hiccup [:p] with templates:
  head, form-errors, footer, account-entries, success-body.
- Render the expense-account grid from a {% for %} template (account-grid.html
  + account-row.html) driven by a per-row view-model (account-row-vm); the row
  reuses the shared components/typeahead.html via a {% with %} include (no fork).
- Extract behaviour-preserving data-prep helpers reused by the view-model:
  sc/typeahead-ctx, sc/money-input-attrs, sc/validated-field-classes,
  sc/errors-str, edit/account-typeahead-ctx, edit/location-select-ctx.

Verified: REPL render parity + browser QA (add/remove row, typeahead select,
per-row location swap, percentage validation, submit, vendor auto-populate);
no JS errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 19:22:37 -07:00

5 lines
379 B
HTML

{# Submit-error sink. A 4xx submit swaps the inner `.error-content` (hx-target-400);
the span is present only when there are form-level errors, matching the prior
hand-rolled markup byte-for-byte. #}
<div id="form-errors">{% if errors_str %}<span class="error-content"><p class="mt-2 text-xs text-red-600 dark:text-red-500 h-4">{{ errors_str }}</p></span>{% endif %}</div>