summaryrefslogtreecommitdiff
path: root/src/http/tpl/post-assets-manage.html
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-11-29 20:59:31 +0100
committerBrian Picciano <mediocregopher@gmail.com>2022-11-29 20:59:31 +0100
commit1f3ae665ed2e58ca572678ce7caf8b711f226392 (patch)
treee023602e07e2a80d24ef9d9527ddca0e1640e929 /src/http/tpl/post-assets-manage.html
parent31f8f37c5ad3ad4ac7b3cc93d0257dd80c877c7c (diff)
Introduce EDIT and MANAGE methods
All admin "index" pages are moved under MANAGE, so that we can have (for example) and normal "GET /posts" page later which would replace the current index page, and potentially corresponding pages for the other categories. The EDIT method replaces the old `?edit` pattern, which normalizes how we differentiate page functionality generally.
Diffstat (limited to 'src/http/tpl/post-assets-manage.html')
-rw-r--r--src/http/tpl/post-assets-manage.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/http/tpl/post-assets-manage.html b/src/http/tpl/post-assets-manage.html
new file mode 100644
index 0000000..f21717a
--- /dev/null
+++ b/src/http/tpl/post-assets-manage.html
@@ -0,0 +1,57 @@
+{{ define "body" }}
+
+<p>
+ <a href="{{ BlogURL "admin" }}">Back to Admin</a>
+</p>
+
+<h1>Assets</h1>
+
+<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">
+ <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>
+
+{{ if gt (len .Payload.IDs) 0 }}
+
+<h2>Existing Assets</h2>
+
+<table>
+
+ {{ range .Payload.IDs }}
+ <tr>
+ <td><a href="{{ AssetURL . }}">{{ . }}</a></td>
+ <td>
+ <form
+ action="{{ AssetURL . }}?method=delete"
+ method="POST"
+ style="margin-bottom: 0;"
+ >
+ <input type="submit" value="Delete" />
+ </form>
+ </td>
+ </tr>
+ {{ end }}
+
+</table>
+
+{{ end }}
+
+{{ end }}
+
+{{ template "base.html" . }}