{{/* parts/reply_card.html — 回复卡片片段 模板名:reply-card 数据:utils.ReplyPageItem 使用场景: 1. post.html 初始渲染时通过 {{range .Replies}}{{template "reply-card" .}}{{end}} 内联 2. HTMXReplyNew handler 返回此片段,HTMX 追加到 #reply-list 关键字段: .RID uint64 .AuthorUID uint64 .AuthorName string .AuthorAver int64 .ContentHTML template.HTML ← 已渲染,直接输出,不会被转义 .CreatedAt time.Time .IsOwner bool ← 是否为当前登录用户的回复(服务端设置) 删除按钮: 仅 .IsOwner=true 时显示,调用 post.html 中定义的 hpDeleteReply(rid) */}} {{define "reply-card"}}
{{.AuthorName}}
{{fmtdatetime .CreatedAt}} {{if .IsOwner}} {{end}}
{{.ContentHTML}}
{{end}}