diff options
Diffstat (limited to 'jakob')
| -rw-r--r-- | jakob/utils/comments.scm | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/jakob/utils/comments.scm b/jakob/utils/comments.scm index f9228bd..15824b1 100644 --- a/jakob/utils/comments.scm +++ b/jakob/utils/comments.scm @@ -114,17 +114,25 @@ (if (webmention? comment) '() (internal-comment-reactions comment))) + (define (comment-subject comment) + (if (webmention? comment) + #f + (internal-comment-subject comment))) `(article (@ ,@(if (not (webmention? comment)) `((id ,(format #f "comment-~a" (internal-comment-id comment)))) '()) - (class "comment-block")) + ,(if reply? + '(class "comment-block reply") + '(class "comment-block"))) (header (@ (class "comment-meta")) (img (@ (class "comment-avatar") (src ,(comment-photo comment)) (alt "User Icon"))) (div (@ (class "comment-info")) (strong ,(comment-name comment)) - ;; (span (@ (class "subject"))) + ,@(if (comment-subject comment) + `((span (@ (class "subject")) ,(comment-subject comment)(span (@ (class "subject"))))) + '()) (br) ,@(if (and (comment-url comment) (not (string= "" (comment-url comment))) @@ -139,11 +147,20 @@ ,(date->string (comment-publish-time comment) "~B ~e, ~Y at ~H:~M")))) (div (@ (class "comment-body")) ,@(comment-content comment)) - (footer (@ (class "comment-reactions")) - ,@(map (match-lambda - ((emote . count) - `(span (@ (class "reaction")) ,(format #f "~a ~a" emote count)))) - (comment-reactions comment))) + ,@(if (not (webmention? comment)) + `((footer (@ (class "comment-reactions")) + (button (@ (class "reply-button") (hidden #t) + (aria-label "Reply to comment") + (data-target ,(format #f "comment-~a" (internal-comment-id comment))) + (data-reply-to-id ,(internal-comment-id comment))) + "Reply") + ,@(map (match-lambda + ((emote . count) + `(span (@ (class "reaction")) ,(format #f "~a ~a" emote count)))) + (comment-reactions comment)) + (button (@ (class "add-reaction") (hidden #t) + (aria-label "Add reaction")) "+"))) + '()) ,@(if (and (not reply?) (internal-comment? comment) (positive? (length (internal-comment-replies comment)))) |