mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
#4205: a board template could be applied manually (the "Template" link on the Create Board form opens a picker of the user's Board Templates and copies the chosen one), but there was no way to make one the default, so every new board meant reopening that picker each time. Add a star toggle to each row of that picker (Template.searchElementPopup, isBoardTemplateSearch) that marks/unmarks one "Board Templates" card as the user's default (profile.defaultBoardTemplateId/-BoardId, both optional and unset by default). Toggling goes through a new toggleDefaultBoardTemplate method that only accepts a live, unarchived linked-board card from the caller's own templates board. The plain "type a name and click Create" board-creation flow now checks for a default and, when set, applies it by calling the SAME copyBoard method the manual picker already uses - not a second copy of the board-copying logic - before falling back to the unchanged blank-board path. A user who never sets a default sees no change at all. Deleting the underlying template board clears it as anyone's default so creation cannot fail against a dead id. Thanks to Jieiku and xet7 ! Closes #4205,