Commit Graph
3 Commits
Author SHA1 Message Date
Lauri Ojansivu fd41970ed2 Make existing card dates editable again.
The date form consolidation put the inputs inside a child Blaze template but left the event maps on the parent popup. Blaze does not dispatch child-template events to a parent template event map, so Save, Delete and validation no longer ran after a date existed. Keep the common form and move its common event map onto that form, passing each popup's date state and field-specific callbacks explicitly.

Regression coverage pins the child event ownership and changes a previously stored due date through the browser UI.

Thanks to Alishara and xet7 !

Fixes #6607.
2026-08-17 14:42:00 +03:00
Lauri Ojansivu 9c288c3d4d Date templates: one edit form and one badge instead of twenty-two copies.
Two shapes were copied across three files. The edit-a-date form - date, time,
Save, Delete - existed eight times, letter for letter: the card's Received,
Start, Due and End, a vote's end date, a planning poker's end date, a date
custom field, and a ninth `datepicker` template that nothing included and no
popup could open (a popup's template name ends in `Popup`). The date badge -
the coloured date on a card and on a minicard - existed fourteen times.

The JavaScript was already shared: client/lib/datepicker.js holds the state and
the handlers, and each popup differs only in the field it stores. It was only
the markup, so a change to the form meant eight edits and a change to the badge
meant fourteen, with nothing to say so.

Each is one template now - editDateForm and dateBadgeBody. They take what they
draw as ARGUMENTS, because a helper is looked up on the template it is written
in and not on the one including it: that is what lets one piece of markup serve
them all while every popup keeps its own state, its own click and its own name.
cardDate.jade went from 289 lines to 91, and the dead datepicker.js went with
the template it wired up.

The badge's `baseClass` is the trap this had to avoid: three of the fourteen -
the custom-field dates - were never `.card-date` and must not become one, so
the class each caller carried is passed in rather than baked into the shared
markup. tests/dateTemplates.test.cjs pins that, the minicard kind classes, and
that no state moved.

Thanks to xet7 !
2026-08-14 06:48:47 +03:00
Harry Adel 8ffc0cb5ff Centralize client boot and rspack package loading 2026-03-24 01:50:25 +02:00