Browse Source

add older/newer archive entries to data returned from /view/archive.

stable
Craig Oates 2 years ago
parent
commit
2b4336bced
  1. 21
      src/web.lisp

21
src/web.lisp

@ -1006,14 +1006,19 @@
(defroute ("/view/archive/:slug" :method :GET) (&key slug) (defroute ("/view/archive/:slug" :method :GET) (&key slug)
(let ((alert (utils:get-and-reset-alert))) (let ((alert (utils:get-and-reset-alert)))
(if (storage:file-exists-p "" "archive" slug) (if (storage:file-exists-p "" "archive" slug)
(render #P"archive-entry.html" (let* ((archive-entry (nera:get-archive-entry :slug slug))
(append (if (hermetic:logged-in-p) (archive-id (archive::object-id archive-entry)))
(auth:auth-user-data)) (render #P"archive-entry.html"
`(:alert ,alert (append (if (hermetic:logged-in-p)
:db-data ,(nera:get-archive-entry :slug slug) (auth:auth-user-data))
:system-data ,(nera:system-data) `(:alert ,alert
:data ,(storage:open-text-file :db-data ,archive-entry
"" "archive" slug)))) :system-data ,(nera:system-data)
:newer-entries
,(nera:get-newer-archive-entries archive-id 2)
:older-entries
,(nera:get-older-archive-entries archive-id 2)
:data ,(storage:open-text-file "" "archive" slug)))))
(on-exception *web* 404)))) (on-exception *web* 404))))
(defroute ("/user/archive" :method :GET) () (defroute ("/user/archive" :method :GET) ()

Loading…
Cancel
Save