src/views/components/post.lisp
(defpackage murja.views.components.post
(:use :cl :murja.newui :cl-hash-util :binding-arrows :murja.models.user :murja.models.post)
(:export :post))
(in-package :murja.views.components.post)
(defun post (post)
(let ((creator (creator post)))
(c :article (:class "post")
(c :h2 ()
(c :a (:href (format nil "/blog/post/~d" (post-id post)))
(post-title post)))
(c :section (:class "meta")
(c :img (:class "user_avatar" :src (user-img-location creator)))
(c :p () (format nil "By ~a" (user-nickname creator)))
(c :p () "Written at"
(c :time (:datetime (created-at post))
(created-at post))))
(c :section (:class "content") (article post)))))