Files
jiang13-forum/templates/messages/thread.tmpl
freefire c32c81d1ca feat: SSR 评论回复与 @ 提及通知
发评/审通接入 NotifyService,系统通知会话支持 kind 筛选。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 21:51:52 +08:00

49 lines
1.7 KiB
Cheetah

{{define "messages/thread"}}
{{template "base/head" .}}
{{template "base/navbar" .}}
<main class="j13-main j13-messages">
<p><a href="/messages">← 返回会话列表</a></p>
<h1>{{.PeerName}}</h1>
{{if .IsSystem}}
<p class="j13-muted">系统通知(只读)</p>
{{if .KindLinks}}
<nav class="j13-msg-kinds" aria-label="通知类型">
{{range .KindLinks}}
<a href="{{.URL}}"{{if .Active}} class="is-active" aria-current="page"{{end}}>{{.Label}}</a>
{{end}}
</nav>
{{end}}
{{else}}<p class="j13-muted"><a href="/user/{{.PeerID}}">查看主页</a></p>{{end}}
{{template "base/alert" .}}
{{if and .HasOlder (or (not .IsSystem) (eq .KindFilter "all") (eq .KindFilter ""))}}
<p><a href="/messages/with/{{.PeerID}}?before={{.OlderBefore}}">加载更早消息</a></p>
{{end}}
{{if .Messages}}
<ul class="j13-msg-thread">
{{range .Messages}}
<li class="j13-msg-bubble{{if .FromSelf}} is-self{{end}}{{if .IsSystem}} is-system{{end}}">
{{if .Subject}}<div class="j13-msg-bubble__subj">{{.Subject}}</div>{{end}}
<div class="j13-msg-bubble__body">{{.Content}}</div>
<div class="j13-muted">{{.CreatedLabel}}{{if .Kind}} · {{.Kind}}{{end}}</div>
</li>
{{end}}
</ul>
{{else}}
<p class="j13-empty">还没有消息。{{if .CanReply}}发送第一条私信开始对话。{{end}}</p>
{{end}}
{{if .CanReply}}
<form method="post" action="/messages/with/{{.PeerID}}" class="j13-form j13-msg-compose">
<input type="hidden" name="_csrf" value="{{.CSRF}}"/>
<label>回复
<textarea name="content" rows="4" required maxlength="4000">{{.Draft}}</textarea>
</label>
<button type="submit">发送</button>
</form>
{{end}}
</main>
{{template "base/footer" .}}
{{end}}