Removed Postable proxies

This commit is contained in:
2018-11-01 17:05:55 +09:00
parent ae1bd6846d
commit 4779b492ec
6 changed files with 20 additions and 28 deletions

View File

@ -13,4 +13,4 @@ component ActivityPost(post *arn.Post, user *arn.User)
//- span commented on
//- a(href=post.Parent().Link())= post.Parent().TitleByUser(user)
Postable(post.ToPostable(), user, fmt.Sprintf(`<p class="activity-header"><a href="%s">%s</a></p>`, post.Parent().Link(), post.Parent().TitleByUser(user)), "")
Postable(post, user, fmt.Sprintf(`<p class="activity-header"><a href="%s">%s</a></p>`, post.Parent().Link(), post.Parent().TitleByUser(user)), "")

View File

@ -1,7 +1,7 @@
component Post(post *arn.Post, user *arn.User)
.thread
.posts
Postable(post.ToPostable(), user, "", "")
Postable(post, user, "", "")
.side-note-container.mountable
a.side-note(href=post.Parent().Link())= post.Parent().TitleByUser(user)

View File

@ -23,18 +23,10 @@ func GetPostsByUser(ctx *aero.Context) string {
posts := viewUser.Posts()
arn.SortPostsLatestFirst(posts)
var postables []arn.Postable
if len(posts) >= postLimit {
posts = posts[:postLimit]
}
postables = make([]arn.Postable, len(posts))
for i, post := range posts {
postables[i] = arn.ToPostable(post)
}
return ctx.HTML(components.LatestPosts(postables, viewUser, utils.GetUser(ctx), ctx.URI()))
return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, utils.GetUser(ctx), ctx.URI()))
}

View File

@ -3,10 +3,10 @@ component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User)
#thread.thread(data-id=thread.ID)
.posts
Postable(thread.ToPostable(), user, "", thread.Creator().ID)
Postable(thread, user, "", thread.Creator().ID)
each post in posts
Postable(post.ToPostable(), user, "", thread.Creator().ID)
Postable(post, user, "", thread.Creator().ID)
//- Reply
if user != nil