feat: update spine-add-form-model for shelf list
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user