summaryrefslogtreecommitdiff
path: root/srv/src/http/tpl
diff options
context:
space:
mode:
Diffstat (limited to 'srv/src/http/tpl')
-rw-r--r--srv/src/http/tpl/admin.html1
-rw-r--r--srv/src/http/tpl/draft-posts.html48
-rw-r--r--srv/src/http/tpl/edit-post.html10
3 files changed, 59 insertions, 0 deletions
diff --git a/srv/src/http/tpl/admin.html b/srv/src/http/tpl/admin.html
index 24b2770..3b10675 100644
--- a/srv/src/http/tpl/admin.html
+++ b/srv/src/http/tpl/admin.html
@@ -9,6 +9,7 @@ anything without providing credentials.
<ul>
<li><a href="{{ BlogURL "posts" }}">Posts</a></li>
<li><a href="{{ BlogURL "assets" }}">Assets</a></li>
+ <li><a href="{{ BlogURL "drafts" }}">Drafts (private)</a></li>
</ul>
{{ end }}
diff --git a/srv/src/http/tpl/draft-posts.html b/srv/src/http/tpl/draft-posts.html
new file mode 100644
index 0000000..f89fac5
--- /dev/null
+++ b/srv/src/http/tpl/draft-posts.html
@@ -0,0 +1,48 @@
+{{ define "body" }}
+
+ <h1>Drafts</h1>
+
+ <p>
+ <a href="{{ BlogURL "drafts/" }}?edit">
+ New Draft
+ </a>
+ </p>
+
+ {{ if ge .Payload.PrevPage 0 }}
+ <p>
+ <a href="?p={{ .Payload.PrevPage}}">&lt; &lt; Previous Page</a>
+ </p>
+ {{ end }}
+
+ <table>
+
+ {{ range .Payload.Posts }}
+ <tr>
+ <td><a href="{{ DraftURL .ID }}">{{ .Title }}</a></td>
+ <td>
+ <a href="{{ DraftURL .ID }}?edit">
+ Edit
+ </a>
+ </td>
+ <td>
+ <form
+ action="{{ DraftURL .ID }}?method=delete"
+ method="POST"
+ >
+ <input type="submit" value="Delete" />
+ </form>
+ </td>
+ </tr>
+ {{ end }}
+
+ </table>
+
+ {{ if ge .Payload.NextPage 0 }}
+ <p>
+ <a href="?p={{ .Payload.NextPage}}">Next Page &gt; &gt;</a>
+ </p>
+ {{ end }}
+
+{{ end }}
+
+{{ template "base.html" . }}
diff --git a/srv/src/http/tpl/edit-post.html b/srv/src/http/tpl/edit-post.html
index a585b82..ea1f2c1 100644
--- a/srv/src/http/tpl/edit-post.html
+++ b/srv/src/http/tpl/edit-post.html
@@ -15,6 +15,9 @@
type="text"
placeholder="e.g. how-to-fly-a-kite"
value="{{ .Payload.Post.ID }}" />
+ {{ else if .Payload.IsDraft }}
+ {{ .Payload.Post.ID }}
+ <input name="id" type="hidden" value="{{ .Payload.Post.ID }}" />
{{ else }}
<a href="{{ PostURL .Payload.Post.ID }}">{{ .Payload.Post.ID }}</a>
<input name="id" type="hidden" value="{{ .Payload.Post.ID }}" />
@@ -107,10 +110,17 @@
</form>
<p>
+ {{ if .Payload.IsDraft }}
+ <a href="{{ BlogURL "drafts/" }}">
+ Back to Drafts
+ </a>
+ {{ else }}
<a href="{{ BlogURL "posts/" }}">
Back to Posts
</a>
+ {{ end }}
</p>
+
{{ end }}
{{ template "base.html" . }}