Files
jiang13-forum/templates/messages/list.tmpl
freefire 40ec20b3df feat: SSR 私信与通知(/messages)
会话列表、读写、未读角标与全部已读;系统会话只读;用户主页可发起私信。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 05:59:54 +08:00

41 lines
1.4 KiB
Cheetah
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{define "messages/list"}}
{{template "base/head" .}}
{{template "base/navbar" .}}
<main class="j13-main j13-messages">
<h1>私信与通知</h1>
{{template "base/alert" .}}
<p class="j13-muted">
未读 {{.UnreadTotal}}
(私信 {{.UnreadDM}} · 通知 {{.UnreadNotify}}
{{if gt .UnreadTotal 0}}
<form method="post" action="/messages/read-all" class="j13-inline-form">
<input type="hidden" name="_csrf" value="{{.CSRF}}"/>
<button type="submit" class="j13-linkbtn">全部标已读</button>
</form>
{{end}}
</p>
{{if .Conversations}}
<ul class="j13-msg-list">
{{range .Conversations}}
<li class="j13-msg-item{{if gt .Unread 0}} is-unread{{end}}">
<a href="/messages/with/{{.PeerID}}">
<strong>{{.PeerName}}</strong>
{{if gt .Unread 0}}<span class="j13-badge">{{.Unread}}</span>{{end}}
<span class="j13-msg-item__preview">{{.Preview}}</span>
<span class="j13-muted">{{.UpdatedLabel}}</span>
</a>
</li>
{{end}}
</ul>
<nav class="j13-pager">
{{if .HasPrev}}<a href="/messages?page={{.PrevPage}}">上一页</a>{{end}}
{{if .HasMore}}<a href="/messages?page={{.NextPage}}">下一页</a>{{end}}
</nav>
{{else}}
<p class="j13-empty">暂无会话。可在用户主页点击「发私信」开始对话。</p>
{{end}}
</main>
{{template "base/footer" .}}
{{end}}