Improved post view
This commit is contained in:
23
pages/post/post.go
Normal file
23
pages/post/post.go
Normal file
@ -0,0 +1,23 @@
|
||||
package post
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// Get post.
|
||||
func Get(ctx *aero.Context) string {
|
||||
id := ctx.Get("id")
|
||||
user := utils.GetUser(ctx)
|
||||
post, err := arn.GetPost(id)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "Post not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Post(post, user))
|
||||
}
|
7
pages/post/post.pixy
Normal file
7
pages/post/post.pixy
Normal file
@ -0,0 +1,7 @@
|
||||
component Post(post *arn.Post, user *arn.User)
|
||||
.thread
|
||||
.posts
|
||||
Postable(post.ToPostable(), user, "")
|
||||
|
||||
.side-note.mountable
|
||||
a(href=post.Thread().Link())= post.Thread().Title
|
3
pages/post/post.scarlet
Normal file
3
pages/post/post.scarlet
Normal file
@ -0,0 +1,3 @@
|
||||
.side-note
|
||||
font-size 0.9rem
|
||||
text-align right !important
|
Reference in New Issue
Block a user