summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl/index.html
blob: 946a3e4faddb19ae7f6d580d2695358405208481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{{ define "body" }}

  <ul id="posts-list">

    {{ range .Payload.Posts }}
    <li>
      <h2>
        <a href="{{ PostURL .ID }}">{{ .Title }}</a>
      </h2>
      <span>{{ .PublishedAt.Format "2006-01-02" }}</span>
      {{ if not .LastUpdatedAt.IsZero }}
      <span>(Updated {{ .LastUpdatedAt.Format "2006-01-02" }})</span>
      {{ end }}
      <p>{{ .Description }}</p>
    </li>
    {{ end }}

  </ul>

  {{ if or (ge .Payload.PrevPage 0) (ge .Payload.NextPage 0) }}
    <div id="page-turner">

    {{ if ge .Payload.PrevPage 0 }}
      <a style="float: left;" href="?p={{ .Payload.PrevPage}}">Newer</a>
    {{ end }}

    {{ if ge .Payload.NextPage 0 }}
      <a style="float:right;" href="?p={{ .Payload.NextPage}}">Older</a>
    {{ end }}

    </div>
  {{ end }}

{{ end }}

{{ template "base.html" . }}