Added activity feed

This commit is contained in:
2018-10-31 14:27:48 +09:00
parent 8e1578f2cb
commit 97c8f99499
14 changed files with 93 additions and 19 deletions

View File

@ -5,7 +5,7 @@ component Comments(parent arn.PostParent, user *arn.User)
p.no-data.mountable No comments have been written yet.
else
each post in parent.Posts()
Postable(post.ToPostable(), user, "")
Postable(post.ToPostable(), user, "", "")
if user != nil
if parent.IsLocked()

View File

@ -1,12 +1,12 @@
component Postable(post arn.Postable, user *arn.User, highlightAuthorID string)
component Postable(post arn.Postable, user *arn.User, headerContent string, highlightAuthorID string)
.post.mountable(id=strings.ToLower(post.Type()) + "-" + fmt.Sprint(post.ID()), data-highlight=post.Creator().ID == highlightAuthorID, data-pro=post.Creator().IsPro(), data-api="/api/" + strings.ToLower(post.Type()) + "/" + post.ID())
.post-author
Avatar(post.Creator())
//- if post.recipient && post.recipient.ID !== post.author.ID
//- a.user.post-recipient(href="/+" + post.recipient.nick, title=post.recipient.nick)
//- img.user-image(src=post.recipient.avatar ? (post.recipient.avatar + "?s=100&r=x&d=mm") : "/images/elements/no-gravatar.svg", alt=post.recipient.nick)
.post-content
if headerContent != ""
div!= headerContent
div(id="render-" + post.ID())!= post.HTML()
if user != nil && user.ID == post.Creator().ID

View File

@ -2,4 +2,4 @@ component PostableList(postables []arn.Postable, user *arn.User)
.thread
.posts
each post in postables
Postable(post, user, "")
Postable(post, user, "", "")