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.