356f490546
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 11s
CI / ui (pull_request) Successful in 32s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m14s
A new /_gm/messages console page lists posted chat messages (nudges excluded) newest-first — time, source (guest/robot/oldest identity kind), sender (linked to the user card), IP, body, game (linked to the game card) — searchable by sender name / external-id glob masks and pinnable to one game (?game=) or sender (?user=), linked from the game and user cards. The list query lives in social (raw SQL, kind='message', source via a SQL CASE), reusing the now-exported account.LikePattern. Server-rendered adminconsole MessagesView + messages.gohtml, 50/page via the shared pager. Tests: adminconsole render case; backend integration AdminListMessages (real Postgres) — nudge exclusion, game/sender pins, glob masks, source. Docs: ARCHITECTURE section 8 chat moderation, PLAN round-6.
31 lines
1.4 KiB
Go Template
31 lines
1.4 KiB
Go Template
{{define "content" -}}
|
|
{{with .Data}}
|
|
<h1>Game {{.ID}}</h1>
|
|
<nav class="subnav"><a href="/_gm/games">« games</a> · <a href="/_gm/messages?game={{.ID}}">messages</a></nav>
|
|
<section class="panel"><h2>Summary</h2>
|
|
<ul class="kv">
|
|
<li><b>Variant</b> {{.Variant}}</li>
|
|
<li><b>Dictionary</b> {{.DictVersion}}</li>
|
|
<li><b>Status</b> {{.Status}}{{if .EndReason}} ({{.EndReason}}){{end}}</li>
|
|
<li><b>Players</b> {{.Players}}</li>
|
|
<li><b>To move</b> seat {{.ToMove}}</li>
|
|
<li><b>Moves</b> {{.MoveCount}}</li>
|
|
<li><b>Created</b> {{.CreatedAt}}</li>
|
|
<li><b>Updated</b> {{.UpdatedAt}}</li>
|
|
{{if .FinishedAt}}<li><b>Finished</b> {{.FinishedAt}}</li>{{end}}
|
|
</ul>
|
|
</section>
|
|
<section class="panel"><h2>Seats</h2>
|
|
<table class="list">
|
|
<thead><tr><th>Seat</th><th>Player</th><th>Score</th><th>Hints used</th><th>Winner</th><th>Robot</th></tr></thead>
|
|
<tbody>
|
|
{{range .Seats}}
|
|
<tr><td>{{.Seat}}</td><td><a href="/_gm/users/{{.AccountID}}">{{.DisplayName}}</a></td><td>{{.Score}}</td><td>{{.HintsUsed}}</td><td>{{if .Winner}}<span class="ok">winner</span>{{end}}</td><td>{{if .IsRobot}}🤖 {{.RobotIntent}}{{if .NextMove}}<br><small>next move {{.NextMove}}</small>{{end}}{{end}}</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{if .HasRobot}}<p><small>Play-to-win is decided once per game from the bag seed; robots play to win in ~{{.RobotTargetPct}}% of games.</small></p>{{end}}
|
|
</section>
|
|
{{end}}
|
|
{{- end}}
|