Threaded comments

This commit is contained in:
2018-11-05 19:05:36 +09:00
parent e74253df96
commit 08497f0c37
13 changed files with 109 additions and 217 deletions

View File

@ -21,11 +21,5 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Thread not found", err)
}
// Fetch posts
posts := thread.Posts()
// Sort posts
arn.SortPostsLatestLast(posts)
return ctx.HTML(components.Thread(thread, posts, user))
return ctx.HTML(components.Thread(thread, user))
}

View File

@ -1,12 +1,9 @@
component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User)
component Thread(thread *arn.Thread, user *arn.User)
h1.thread-title= thread.Title
#thread.thread(data-id=thread.ID)
.posts
Postable(thread, user, "", thread.Creator().ID)
each post in posts
Postable(post, user, "", thread.Creator().ID)
Postable(thread, user, true, "", thread.Creator().ID)
//- Reply
if user != nil

View File

@ -14,18 +14,23 @@
.post-author
margin-bottom 0.25rem
.post-content
[data-highlight="true"]
.post-content
border 2px solid post-highlight-color
border 2px solid post-highlight-color
// [data-pro="true"]
// .post-content
// border 2px solid pro-color
.post-parent
vertical
.replies
margin-top 0.75rem
margin-left content-padding
> 600px
.post
horizontal
margin-bottom 0.75rem
margin-bottom 0
.post-author
margin-bottom 0
margin-bottom 0
.post-parent
horizontal