CI / test (pull_request) Successful in 8m23s
Render reply trees with permission-aware inline controls, and move hunt, profile, voting, submission, and hiding flows to post storage.
38 lines
1.4 KiB
HTML
38 lines
1.4 KiB
HTML
{{define "leaderboard"}}
|
|
<ol id="leaderboard" class="board" start="1">
|
|
{{if not .Posts}}
|
|
<li class="empty">
|
|
{{if eq .Date .Today}}
|
|
<p class="empty-kicker">Queue empty</p>
|
|
<p>No questions yet. Be the first to <a href="/submit">ask</a>.</p>
|
|
{{else}}
|
|
<p>No questions on this day.</p>
|
|
{{end}}
|
|
</li>
|
|
{{else}}
|
|
{{range $i, $post := .Posts}}
|
|
<li class="row">
|
|
<span class="rank" aria-hidden="true">{{rank $i}}</span>
|
|
{{template "vote" (voteCtx $.User $.CSRF "list" $.Date $post)}}
|
|
<div class="row-body">
|
|
<a class="q-title" href="/questions/{{$post.ID}}">{{$post.Title}}</a>
|
|
<p class="meta">
|
|
<span>{{$post.AuthorName}}</span>
|
|
{{if $post.City}}<span class="dot" aria-hidden="true">·</span><span>{{$post.City}}</span>{{end}}
|
|
{{if $post.Answered}}<span class="badge">Answered</span>{{end}}
|
|
</p>
|
|
{{if isAdmin $.User}}
|
|
<form class="inline-hide" method="post" action="/questions/{{$post.ID}}/hide"
|
|
hx-post="/questions/{{$post.ID}}/hide" hx-target="#leaderboard" hx-swap="outerHTML">
|
|
<input type="hidden" name="_csrf" value="{{$.CSRF}}">
|
|
<input type="hidden" name="view" value="list">
|
|
<button type="submit" class="linkish">Hide</button>
|
|
</form>
|
|
{{end}}
|
|
</div>
|
|
</li>
|
|
{{end}}
|
|
{{end}}
|
|
</ol>
|
|
{{end}}
|