{{ template "layout.html" . }}

{{ define "title" }}Home{{ end }}

{{ define "content" }}
<style>
  .disabled {
    color: #aaa !important;
    pointer-events: none;
  }
</style>
<main class="container">
  <h1>Journal entries</h1>
  <hr />
  <ul>
    <!-- Entry title [date | YYYY-MM-DD] -->
    {{ range .Entries }} <!-- begin range -->
    <li>
      <a href="/entry/{{ .ID }}">{{ .Title }}&nbsp[{{ .FormattedDate }}]</a>
    </li>
    {{ end }} <!-- end range -->
  </ul>
  <hr />
  <p>
    [<a href="/?offset={{ .Pagination.Prev }}" class="{{ if eq .Pagination.Prev 0 }}disabled{{ end }}">prev</a>]
    [<a href="/?offset={{ .Pagination.Next }}" class="{{ if eq .Pagination.Next 0 }}disabled{{ end }}">next</a>]
  </p>
</main>
{{ end }}
