Implements display of replyingTo in front end.

This commit is contained in:
Dominik Picheta 2018-05-17 22:44:30 +01:00
commit 8d41060c54
3 changed files with 21 additions and 5 deletions

View file

@ -306,8 +306,17 @@ $views-color: #545d70;
} }
} }
.post-time { .post-metadata {
float: right; float: right;
.post-replyingTo {
display: inline-block;
margin-right: $control-padding-x;
i.fa-reply {
transform: rotate(180deg);
}
}
} }
} }

View file

@ -212,7 +212,13 @@ when defined(js):
if post.author.rank == Admin: if post.author.rank == Admin:
italic(class="fas fa-chess-knight", italic(class="fas fa-chess-knight",
title="User is an admin") title="User is an admin")
tdiv(class="post-time"): tdiv(class="post-metadata"):
if post.replyingTo.isSome():
let replyingTo = post.replyingTo.get()
tdiv(class="post-replyingTo"):
a(href=renderPostUrl(replyingTo)):
italic(class="fas fa-reply")
renderUserMention(replyingTo.author.get())
let title = post.info.creation.fromUnix().local. let title = post.info.creation.fromUnix().local.
format("MMM d, yyyy HH:mm") format("MMM d, yyyy HH:mm")
a(href=renderPostUrl(post, thread), title=title): a(href=renderPostUrl(post, thread), title=title):

View file

@ -38,6 +38,7 @@ when defined(js):
proc renderUserMention*(user: User): VNode = proc renderUserMention*(user: User): VNode =
result = buildHtml(): result = buildHtml():
# TODO: Add URL to profile. a(class="user-mention",
span(class="user-mention"): href=makeUri("/profile/" & user.name),
text "@" & user.name onClick=anchorCB):
text "@" & user.name