Initial commit: runnable Ask a Plumber First server.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
{{define "leaderboard"}}
|
||||
<ol id="leaderboard" class="board" start="1">
|
||||
{{if not .Questions}}
|
||||
<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, $q := .Questions}}
|
||||
<li class="row">
|
||||
<span class="rank" aria-hidden="true">{{rank $i}}</span>
|
||||
{{template "vote" (voteCtx $.User $.CSRF "list" $.Date $q)}}
|
||||
<div class="row-body">
|
||||
<a class="q-title" href="/questions/{{$q.ID}}">{{$q.Title}}</a>
|
||||
<p class="meta">
|
||||
<span>{{$q.AuthorName}}</span>
|
||||
{{if $q.City}}<span class="dot" aria-hidden="true">·</span><span>{{$q.City}}</span>{{end}}
|
||||
{{if $q.Answered}}<span class="badge">Answered</span>{{end}}
|
||||
</p>
|
||||
{{if isAdmin $.User}}
|
||||
<form class="inline-hide" method="post" action="/questions/{{$q.ID}}/hide"
|
||||
hx-post="/questions/{{$q.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}}
|
||||
Reference in New Issue
Block a user