package views import ( "fmt" "github.com/dominicf2001/comfychan/internal/database" "github.com/dominicf2001/comfychan/internal/util" "github.com/dominicf2001/comfychan/web/views/shared" "strconv" ) templ PostOriginal(post database.Post, thread *database.Thread) { {{ imgInfo := util.GetPostImageInfo(post.MediaPath) }}
File: { post.MediaPath }
({ util.FormatBytes(imgInfo.Size) }, { strconv.Itoa(imgInfo.Width) }x{ strconv.Itoa(imgInfo.Height) })

{ thread.Subject } -

{ post.CreatedAt.Format("15:04") } >%d\n'", post.Number) } class=" post-num"> No.{ strconv.Itoa(post.Number) }

@templ.Raw(util.EnrichPost(post.Body))

} templ PostReply(post database.Post) { {{ imgInfo := util.GetPostImageInfo(post.MediaPath) }}
{ post.CreatedAt.Format("15:04") } >%d\n'", post.Number) } class=" post-num"> No.{ strconv.Itoa(post.Number) }
if post.MediaPath != "" {
File: { post.MediaPath }
({ util.FormatBytes(imgInfo.Size) }, { strconv.Itoa(imgInfo.Width) }x{ strconv.Itoa(imgInfo.Height) })
}

@templ.Raw(util.EnrichPost(post.Body))

} templ Posts(posts []database.Post, thread database.Thread) { @PostOriginal(posts[0], &thread)
for _, post := range (posts[1:]) { @PostReply(post)
}
} templ Thread(board database.Board, thread database.Thread, posts []database.Post) { @shared.Layout() { @BoardHeader(board)
comment
File

[Catalog] [Refresh]

@Posts(posts, thread)
} }