{{define "content"}}
<div class="row">
<div class="col-md-12">
<h2>Review queue</h2>
<h3 class="h5">
Waiting on you
<span class="badge badge-primary">{{len .Data.Open.Items}}</span>
</h3>
{{/* The listing markup is ecore's, so a proposal waiting on the owner and a
repository on a sibling service look like the same kind of thing. The
columns after the title are the item's Meta — the space, then the agent
— and the partial carries the empty-queue sentence itself.
What is lost against the hand-written table this replaces is the header
row: srht-repo-table draws no headings, because the meaning of the
columns it renders is known only to the service supplying them. Here
that costs the "Space" and "Agent" labels, which the values say plainly
enough on their own (~owner/space, and an agent identity).
The digest below is deliberately NOT this partial; inboxData's doc
comment says what it needs that a flat listing cannot express. */}}
{{template "srht-repo-table" .Data.Open}}
<h3 class="h5">
Recently auto-merged
{{if .Data.NewCount}}<span class="badge badge-info">{{.Data.NewCount}} new</span>{{end}}
</h3>
<p class="text-muted">
<small>Content the space's policy merged without stopping for review.</small>
</p>
{{if .Data.NewCount}}
<form method="POST" action="/inbox/seen" class="mb-3">
<button type="submit" class="btn btn-sm btn-outline-secondary">Mark as seen</button>
</form>
{{end}}
{{if .Data.Digest}}
<table class="table">
<thead>
<tr><th>Proposal</th><th>Space</th><th>Agent</th></tr>
</thead>
<tbody>
{{range $i, $r := .Data.Digest}}
{{if eq $i $.Data.NewCount}}
<tr class="table-active">
<td colspan="3" class="text-muted text-center">
<small>— seen before your last visit —</small>
</td>
</tr>
{{end}}
<tr>
<td>
<a href="{{$r.Href}}">#{{$r.ID}} — {{$r.Title}}</a>
{{if $r.New}}<span class="badge badge-info">new</span>{{end}}
</td>
<td class="text-muted"><code>{{$r.Space}}</code></td>
<td class="text-muted"><code>{{$r.Agent}}</code></td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<p class="text-muted">Nothing has auto-merged recently.</p>
{{end}}
</div>
</div>
{{end}}