Display both outbox and inbox previews

parent b548948d
......@@ -102,23 +102,25 @@
#:content-type #"application/activity+json")]
;; Return the html page
[else
(define (preview-collection col-sym col-name col-handler)
`(div
(h2 "Most recent post in your "
(a (@ (href ,(golem-url col-handler)))
,col-name))
,(match (db-ref col-sym)
['()
'(p (i "Hey look... nothing!"))]
[(list post-uri posts-uris ...)
(define activity
(store-get-json post-uri))
(define object
(store-get-json (hash-ref activity 'object)))
`(p ,(hash-ref object 'content))])))
(render-ok
(generic-base-tmpl
`(div ,(post-note-form)
(div
(h2 "Most recent post in your "
(a (@ (href ,(golem-url get-outbox)))
"outbox"))
,(match (db-ref 'outbox)
['()
'(p (i "Hey look... nothing!"))]
[(list post-uri posts-uris ...)
(define activity
(store-get-json post-uri))
(define object
(store-get-json (hash-ref activity 'object)))
`(p ,(hash-ref object 'content))]))
)))]))
(div ,(preview-collection 'outbox "outbox" get-outbox)
,(preview-collection 'inbox "inbox" get-inbox)))))]))
(define (get-inbox req)
(render-ok
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment