diff options
Diffstat (limited to 'srv/src/api/tpl')
-rw-r--r-- | srv/src/api/tpl/admin-assets.html | 26 | ||||
-rw-r--r-- | srv/src/api/tpl/index.html | 12 | ||||
-rw-r--r-- | srv/src/api/tpl/post.html | 32 |
3 files changed, 47 insertions, 23 deletions
diff --git a/srv/src/api/tpl/admin-assets.html b/srv/src/api/tpl/admin-assets.html index d871a3e..036002e 100644 --- a/srv/src/api/tpl/admin-assets.html +++ b/srv/src/api/tpl/admin-assets.html @@ -1,8 +1,32 @@ {{ define "body" }} +<h2>Upload Asset</h2> + +<p> + If the given ID is the same as an existing asset's ID, then that asset will be + overwritten. +</p> + +<form action={{ BlogURL "assets" }} method="POST" enctype="multipart/form-data"> + {{ .CSRFFormInput }} + <div class="row"> + <div class="four columns"> + <input type="text" placeholder="Unique ID" name="id" /> + </div> + <div class="four columns"> + <input type="file" name="file" /><br/> + </div> + <div class="four columns"> + <input type="submit" value="Upload" /> + </div> + </div> +</form> + +<h2>Existing Assets</h2> + <table> - {{ range .IDs }} + {{ range .Payload.IDs }} <tr> <td><a href="{{ AssetURL . }}" target="_blank">{{ . }}</a></td> <td> diff --git a/srv/src/api/tpl/index.html b/srv/src/api/tpl/index.html index 1858ea8..b634169 100644 --- a/srv/src/api/tpl/index.html +++ b/srv/src/api/tpl/index.html @@ -2,7 +2,7 @@ <ul id="posts-list"> - {{ range .Posts }} + {{ range .Payload.Posts }} <li> <h2> <a href="posts/{{ .HTTPPath }}">{{ .Title }}</a> @@ -17,15 +17,15 @@ </ul> - {{ if or (ge .PrevPage 0) (ge .NextPage 0) }} + {{ if or (ge .Payload.PrevPage 0) (ge .Payload.NextPage 0) }} <div id="page-turner"> - {{ if ge .PrevPage 0 }} - <a style="float: left;" href="?p={{ .PrevPage}}">Newer</a> + {{ if ge .Payload.PrevPage 0 }} + <a style="float: left;" href="?p={{ .Payload.PrevPage}}">Newer</a> {{ end }} - {{ if ge .NextPage 0 }} - <a style="float:right;" href="?p={{ .NextPage}}">Older</a> + {{ if ge .Payload.NextPage 0 }} + <a style="float:right;" href="?p={{ .Payload.NextPage}}">Older</a> {{ end }} </div> diff --git a/srv/src/api/tpl/post.html b/srv/src/api/tpl/post.html index 22a5b97..c5c3c96 100644 --- a/srv/src/api/tpl/post.html +++ b/srv/src/api/tpl/post.html @@ -2,43 +2,43 @@ <header id="post-header"> <h1 id="post-headline"> - {{ .Title }} + {{ .Payload.Title }} </h1> <div class="light"> - {{ .PublishedAt.Format "2006-01-02" }} + {{ .Payload.PublishedAt.Format "2006-01-02" }} • - {{ if not .LastUpdatedAt.IsZero }} - (Updated {{ .LastUpdatedAt.Format "2006-01-02" }}) + {{ if not .Payload.LastUpdatedAt.IsZero }} + (Updated {{ .Payload.LastUpdatedAt.Format "2006-01-02" }}) • {{ end }} - <em>{{ .Description }}</em> + <em>{{ .Payload.Description }}</em> </div> </header> -{{ if (or .SeriesPrevious .SeriesNext) }} +{{ if (or .Payload.SeriesPrevious .Payload.SeriesNext) }} <p class="light"><em> This post is part of a series:<br/> - {{ if .SeriesPrevious }} - Previously: <a href="{{ .SeriesPrevious.HTTPPath }}">{{ .SeriesPrevious.Title }}</a></br> + {{ if .Payload.SeriesPrevious }} + Previously: <a href="{{ .Payload.SeriesPrevious.HTTPPath }}">{{ .Payload.SeriesPrevious.Title }}</a></br> {{ end }} - {{ if .SeriesNext }} - Next: <a href="{{ .SeriesNext.HTTPPath }}">{{ .SeriesNext.Title }}</a></br> + {{ if .Payload.SeriesNext }} + Next: <a href="{{ .Payload.SeriesNext.HTTPPath }}">{{ .Payload.SeriesNext.Title }}</a></br> {{ end }} </em></p> {{ end }} <div id="post-content"> - {{ .Body }} + {{ .Payload.Body }} </div> -{{ if (or .SeriesPrevious .SeriesNext) }} +{{ if (or .Payload.SeriesPrevious .Payload.SeriesNext) }} <p class="light"><em> If you liked this post, consider checking out other posts in the series:<br/> - {{ if .SeriesPrevious }} - Previously: <a href="{{ .SeriesPrevious.HTTPPath }}">{{ .SeriesPrevious.Title }}</a></br> + {{ if .Payload.SeriesPrevious }} + Previously: <a href="{{ .Payload.SeriesPrevious.HTTPPath }}">{{ .Payload.SeriesPrevious.Title }}</a></br> {{ end }} - {{ if .SeriesNext }} - Next: <a href="{{ .SeriesNext.HTTPPath }}">{{ .SeriesNext.Title }}</a></br> + {{ if .Payload.SeriesNext }} + Next: <a href="{{ .Payload.SeriesNext.HTTPPath }}">{{ .Payload.SeriesNext.Title }}</a></br> {{ end }} </em></p> {{ end }} |