Improved composability
This commit is contained in:
parent
dd7355a45d
commit
e652e6655f
@ -1,16 +1,18 @@
|
||||
component PostableList(postables []arn.Postable)
|
||||
h2.thread-title= len(postables), " latest posts by ", postables[0].Author().Nick
|
||||
.thread
|
||||
.posts
|
||||
each post in postables
|
||||
.post
|
||||
.post-author
|
||||
Avatar(post.Author())
|
||||
|
||||
.post-content
|
||||
p!= aero.Markdown(post.Text())
|
||||
|
||||
.post-toolbar
|
||||
.spacer
|
||||
.post-likes= len(post.Likes())
|
||||
a.post-tool.post-permalink.ajax(href=post.Link(), title="Permalink")
|
||||
Icon("link")
|
||||
|
||||
a.post-link.side-note.ajax(href=post.Link())= post.Title()
|
||||
|
@ -34,6 +34,6 @@ func GetPostsByUser(ctx *aero.Context) string {
|
||||
postables[i] = arn.ToPostable(post)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.PostableList(postables))
|
||||
return ctx.HTML(components.LatestPosts(postables, user))
|
||||
|
||||
}
|
||||
|
6
pages/profile/posts.pixy
Normal file
6
pages/profile/posts.pixy
Normal file
@ -0,0 +1,6 @@
|
||||
component LatestPosts(postables []arn.Postable, viewUser *arn.User)
|
||||
if len(postables) > 0
|
||||
h2.thread-title= len(postables), " latest posts by ", postables[0].Author().Nick
|
||||
PostableList(postables)
|
||||
else
|
||||
p= viewUser.Nick + " hasn't written any posts yet."
|
Loading…
Reference in New Issue
Block a user