fix(03): WR-04 add color field error display to create form template

- TabloCreateErrors: add Color field for server-side hex validation error
- TabloCreateFormFragment: render FieldError for color field and update
  placeholder to hex-only hint (#6366f1) matching the validation constraint

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arthur Belleville 2026-05-15 08:30:27 +02:00
parent 38fe5b3909
commit 79435602c4
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View file

@ -139,8 +139,9 @@ templ TabloCreateFormFragment(form TabloCreateForm, errs TabloCreateErrors, csrf
name="color"
value={ form.Color }
class="mt-1 block w-full rounded border border-slate-300 px-3 py-2 text-sm placeholder-slate-400 focus:border-slate-500 focus:outline-none"
placeholder="#6366f1 or indigo"
placeholder="#6366f1"
/>
@FieldError(errs.Color)
</div>
<div class="flex items-center gap-3">
@ui.Button(ui.ButtonProps{

View file

@ -12,6 +12,7 @@ type TabloCreateForm struct {
// create form. A field with an empty string means "no error for this field".
type TabloCreateErrors struct {
Title string
Color string
General string
}