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 PostAdminDialog(post database.Post) { {{ elPostId := fmt.Sprintf("post-%d", post.Id) }}

{ elPostId }

Ban info

Reason:
Days:
} templ PostOriginal(post database.Post, thread database.Thread) {
[close] File: { post.MediaPath }
{ util.FormatFileInfo(util.GetPostFileInfo(post.MediaPath)) }

{ 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, threadContext ThreadContext) { {{ elPostId := fmt.Sprintf("post-%d", post.Id) }}
if threadContext.IsAdmin { M } { post.CreatedAt.Format("15:04") } >%d\n'", post.Number) } class=" post-num" > No.{ strconv.Itoa(post.Number) }
if post.MediaPath != "" {
[close] File: { post.MediaPath }
{ util.FormatFileInfo(util.GetPostFileInfo(post.MediaPath)) }
}

@templ.Raw(util.EnrichPost(post.Body)) if post.Banned { (USER WAS BANNED FOR THIS POST) }

@PostAdminDialog(post)
} templ Posts(posts []database.Post, thread database.Thread, threadContext ThreadContext) { @PostOriginal(posts[0], thread)
for _, post := range (posts[1:]) { @PostReply(post, threadContext)
}
} type ThreadContext struct { IsAdmin bool } templ Thread(board database.Board, thread database.Thread, posts []database.Post, threadContext ThreadContext) { @shared.Layout() { @BoardHeader(board)
@shared.NewPostForm(board, fmt.Sprintf("/%s/threads/%d", board.Slug, thread.Id), false)

[Catalog] [Refresh]

@Posts(posts, thread, threadContext)
} }