{{/* The send log is six columns of addresses, subjects and timestamps, so this
     page takes the whole column rather than the reading measure (see the "wide"
     block in layout.html). It is declared per page rather than per page name
     because how wide a page needs to be is a property of that page, not of the
     navigation entry several pages share. */}}
{{define "wide"}}wide{{end}}

{{define "content"}}
<h1>Deliveries</h1>

<p class="muted">Rows older than {{.SendLogRetentionDays}} days are deleted
automatically.{{if .IsGlobal}} Change retention on
<a href="/settings">Settings</a>.{{end}}</p>

<div class="card">
  <h2>Filter</h2>
  <form method="get" action="/deliveries">
    <label for="domain">Domain</label>
    <select id="domain" name="domain">
      <option value="">All domains</option>
      {{range .FilterDomains}}<option value="{{.}}" {{if eq . $.FilterDomain}}selected{{end}}>{{.}}</option>{{end}}
    </select>
    <label for="app">Application</label>
    <select id="app" name="app">
      <option value="">All applications</option>
      {{range .FilterApps}}<option value="{{.}}" {{if eq . $.FilterApp}}selected{{end}}>{{.}}</option>{{end}}
    </select>
    <button type="submit">Filter</button>
  </form>
</div>

<div class="card">
  {{template "deliveries_rows" .}}
</div>
{{end}}
