From e9ea0efa35284f28bbda2f2b779233e1c35cc1b0 Mon Sep 17 00:00:00 2001 From: James Brechtel Date: Sun, 21 Jun 2026 22:53:05 -0400 Subject: [PATCH] feat: update spine-add-form-model for shelf list --- spine.el | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/spine.el b/spine.el index 1937bf5..0f2acaa 100644 --- a/spine.el +++ b/spine.el @@ -59,20 +59,9 @@ Returns the rendered string." (defun spine-add-form-model (books) - "Build the view model ht for templates/add.mustache from BOOKS." - (let ((authors nil) - (categories nil)) - (dolist (book books) - (let ((author (plist-get book :author))) - (when (and author (> (length author) 0) - (not (member author authors))) - (push author authors))) - (dolist (tag (or (plist-get book :tags) nil)) - (unless (member tag categories) - (push tag categories)))) - (ht ("app_title" "spine") - ("existing_authors" (sort authors #'string<)) - ("existing_categories" (sort categories #'string<))))) + "Build view model for templates/add.mustache from current BOOKS." + (ht ("app_title" "spine") + ("shelves" (or (spine-shelves) '())))) (defun spine-index-model (books &optional filter selected-id) "Build the view model ht for templates/index.mustache from BOOKS.