diff options
Diffstat (limited to 'srv/src/http/tpl/posts.html')
-rw-r--r-- | srv/src/http/tpl/posts.html | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/srv/src/http/tpl/posts.html b/srv/src/http/tpl/posts.html index 885018d..7416ee6 100644 --- a/srv/src/http/tpl/posts.html +++ b/srv/src/http/tpl/posts.html @@ -1,36 +1,22 @@ -{{ define "posts-nextprev" }} - - {{ 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 }} - {{ define "body" }} - <p style="text-align: center;"> + <p> <a href="{{ BlogURL "posts/" }}?edit"> <button>New Post</button> </a> </p> - {{ template "posts-nextprev" . }} + {{ if ge .Payload.PrevPage 0 }} + <p> + <a href="?p={{ .Payload.PrevPage}}">< < Previous Page</a> + </p> + {{ end }} - <table style="margin-top: 2rem;"> + <table> {{ range .Payload.Posts }} <tr> - <td>{{ .PublishedAt }}</td> + <td>{{ .PublishedAt.Local.Format "2006-01-02 15:04:05 MST" }}</td> <td><a href="{{ PostURL .ID }}" target="_blank">{{ .Title }}</a></td> <td> <a href="{{ PostURL .ID }}?edit"> @@ -50,7 +36,11 @@ </table> - {{ template "posts-nextprev" . }} + {{ if ge .Payload.NextPage 0 }} + <p> + <a href="?p={{ .Payload.NextPage}}">Next Page > ></a> + </p> + {{ end }} {{ end }} |