feat: SSR 抽奖帖发帖与开奖

compose 支持 lottery;详情抽奖卡可开奖并展示中奖名单。同步勾选已落地的 health/robots/sitemap/uploads/限流清单项。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-30 03:30:57 +08:00
parent b5aee606fb
commit e06c54870c
9 changed files with 176 additions and 13 deletions

View File

@@ -121,6 +121,27 @@
{{end}}
</section>
{{end}}
{{if .Lottery}}
<section class="j13-lottery" aria-label="抽奖">
<h2 class="j13-lottery__title">抽奖</h2>
<p class="j13-muted">
中奖 {{.Lottery.WinnerCount}} 人 · 参与 {{.Lottery.ParticipantCount}} 人 · {{.Lottery.StatusLabel}}
</p>
{{if .Lottery.CanDraw}}
<form method="post" action="/post/{{.PostID}}/lottery/draw" class="j13-inline-form" onsubmit="return confirm('确认开奖?人数不足会失败。');">
<input type="hidden" name="_csrf" value="{{.CSRF}}"/>
<button type="submit">开奖</button>
</form>
{{end}}
{{if .Lottery.Winners}}
<ul class="j13-lottery__winners">
{{range .Lottery.Winners}}
<li>{{if .UserID}}<a href="/user/{{.UserID}}">{{.Name}}</a>{{else}}{{.Name}}{{end}}</li>
{{end}}
</ul>
{{end}}
</section>
{{end}}
{{if .Poll}}
<section class="j13-poll" aria-label="投票">
<h2 class="j13-poll__title">投票</h2>