package views import ( "fmt" "github.com/dominicf2001/comfychan/internal/database" "github.com/dominicf2001/comfychan/internal/util" "github.com/dominicf2001/comfychan/web/views/shared" "strconv" "time" ) 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.FormatPostFileInfo(util.GetPostFileInfo(post.MediaPath)) }
if thread.Locked { Locked } if thread.Pinned { Pinned }

{ thread.Subject }

>%d\n' then call #newPostBody.focus()`, 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 } >%d\n' then call smoothScrollTo('top') then call #newPostBody.focus()`, post.Number) } class=" post-num" > No.{ strconv.Itoa(post.Number) }
if post.MediaPath != "" {
[close] File: { post.MediaPath }
{ util.FormatPostFileInfo(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 ThreadActionBar(thread database.Thread, pos string) {
if pos == "top" { [Scroll to bottom] } else { [Scroll to top] } [Catalog] [Refresh]

} templ Thread(board database.Board, thread database.Thread, posts []database.Post, threadContext ThreadContext) { @shared.Layout(fmt.Sprintf("/%s/ - %s", board.Slug, thread.Subject+" "+posts[0].Body)) { @BoardHeader(board)
if !thread.Locked || threadContext.IsAdmin { @shared.NewPostForm(board, fmt.Sprintf("/%s/threads/%d", board.Slug, thread.Id), false) }
@ThreadActionBar(thread, "top")
@Posts(posts, thread, threadContext)
@ThreadActionBar(thread, "bottom") } }