From 1f3ae665ed2e58ca572678ce7caf8b711f226392 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 29 Nov 2022 20:59:31 +0100 Subject: 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. --- src/http/tpl/admin.html | 6 +- src/http/tpl/assets.html | 57 -------------- src/http/tpl/draft-posts-manage.html | 50 ++++++++++++ src/http/tpl/draft-posts.html | 50 ------------ src/http/tpl/edit-post.html | 142 ----------------------------------- src/http/tpl/post-assets-manage.html | 57 ++++++++++++++ src/http/tpl/post-edit.html | 142 +++++++++++++++++++++++++++++++++++ src/http/tpl/posts-manage.html | 47 ++++++++++++ src/http/tpl/posts.html | 47 ------------ 9 files changed, 299 insertions(+), 299 deletions(-) delete mode 100644 src/http/tpl/assets.html create mode 100644 src/http/tpl/draft-posts-manage.html delete mode 100644 src/http/tpl/draft-posts.html delete mode 100644 src/http/tpl/edit-post.html create mode 100644 src/http/tpl/post-assets-manage.html create mode 100644 src/http/tpl/post-edit.html create mode 100644 src/http/tpl/posts-manage.html delete mode 100644 src/http/tpl/posts.html (limited to 'src/http/tpl') diff --git a/src/http/tpl/admin.html b/src/http/tpl/admin.html index f2ba4d6..510d705 100644 --- a/src/http/tpl/admin.html +++ b/src/http/tpl/admin.html @@ -7,9 +7,9 @@ mostly left open to inspection, but you will not able to change anything without providing credentials. {{ end }} diff --git a/src/http/tpl/assets.html b/src/http/tpl/assets.html deleted file mode 100644 index f21717a..0000000 --- a/src/http/tpl/assets.html +++ /dev/null @@ -1,57 +0,0 @@ -{{ define "body" }} - -

- Back to Admin -

- -

Assets

- -

Upload Asset

- -

- If the given ID is the same as an existing asset's ID, then that asset will be - overwritten. -

- -
-
-
- -
-
-
-
-
- -
-
-
- -{{ if gt (len .Payload.IDs) 0 }} - -

Existing Assets

- - - - {{ range .Payload.IDs }} - - - - - {{ end }} - -
{{ . }} -
- -
-
- -{{ end }} - -{{ end }} - -{{ template "base.html" . }} diff --git a/src/http/tpl/draft-posts-manage.html b/src/http/tpl/draft-posts-manage.html new file mode 100644 index 0000000..12aadb2 --- /dev/null +++ b/src/http/tpl/draft-posts-manage.html @@ -0,0 +1,50 @@ +{{ define "body" }} + +

+ Back to Admin +

+ +

Drafts

+ +

+ New Draft +

+ + {{ if ge .Payload.PrevPage 0 }} +

+ < < Previous Page +

+ {{ end }} + + + + {{ range .Payload.Posts }} + + + + + + {{ end }} + +
{{ .Title }} + + Edit + + +
+ +
+
+ + {{ if ge .Payload.NextPage 0 }} +

+ Next Page > > +

+ {{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/draft-posts.html b/src/http/tpl/draft-posts.html deleted file mode 100644 index 53261b9..0000000 --- a/src/http/tpl/draft-posts.html +++ /dev/null @@ -1,50 +0,0 @@ -{{ define "body" }} - -

- Back to Admin -

- -

Drafts

- -

- New Draft -

- - {{ if ge .Payload.PrevPage 0 }} -

- < < Previous Page -

- {{ end }} - - - - {{ range .Payload.Posts }} - - - - - - {{ end }} - -
{{ .Title }} - - Edit - - -
- -
-
- - {{ if ge .Payload.NextPage 0 }} -

- Next Page > > -

- {{ end }} - -{{ end }} - -{{ template "base.html" . }} diff --git a/src/http/tpl/edit-post.html b/src/http/tpl/edit-post.html deleted file mode 100644 index f8e2730..0000000 --- a/src/http/tpl/edit-post.html +++ /dev/null @@ -1,142 +0,0 @@ -{{ define "body" }} - -

- {{ if .Payload.IsDraft }} - - Back to Drafts - - {{ else }} - - Back to Posts - - {{ end }} -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Unique ID - - {{ if eq .Payload.Post.ID "" }} - - {{ else if .Payload.IsDraft }} - {{ .Payload.Post.ID }} - - {{ else }} - {{ .Payload.Post.ID }} - - {{ end }} -
Tags (space separated) - - - {{ if gt (len .Payload.Tags) 0 }} - - Existing tags: - {{ range $i, $tag := .Payload.Tags }} - {{ if ne $i 0 }} {{ end }}{{ $tag }} - {{ end }} - - {{ end }} -
Series - -
Title - -
Description - -
- -

- -

- -

- - - - {{ if .Payload.IsDraft }} - - - - - - - - - {{ else }} - - {{ end }} - -

- -
- -{{ end }} - -{{ template "base.html" . }} 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" }} + +

+ Back to Admin +

+ +

Assets

+ +

Upload Asset

+ +

+ If the given ID is the same as an existing asset's ID, then that asset will be + overwritten. +

+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +{{ if gt (len .Payload.IDs) 0 }} + +

Existing Assets

+ + + + {{ range .Payload.IDs }} + + + + + {{ end }} + +
{{ . }} +
+ +
+
+ +{{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/post-edit.html b/src/http/tpl/post-edit.html new file mode 100644 index 0000000..2813754 --- /dev/null +++ b/src/http/tpl/post-edit.html @@ -0,0 +1,142 @@ +{{ define "body" }} + +

+ {{ if .Payload.IsDraft }} + + Back to Drafts + + {{ else }} + + Back to Posts + + {{ end }} +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Unique ID + + {{ if eq .Payload.Post.ID "" }} + + {{ else if .Payload.IsDraft }} + {{ .Payload.Post.ID }} + + {{ else }} + {{ .Payload.Post.ID }} + + {{ end }} +
Tags (space separated) + + + {{ if gt (len .Payload.Tags) 0 }} + + Existing tags: + {{ range $i, $tag := .Payload.Tags }} + {{ if ne $i 0 }} {{ end }}{{ $tag }} + {{ end }} + + {{ end }} +
Series + +
Title + +
Description + +
+ +

+ +

+ +

+ + + + {{ if .Payload.IsDraft }} + + + + + + + + + {{ else }} + + {{ end }} + +

+ +
+ +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/posts-manage.html b/src/http/tpl/posts-manage.html new file mode 100644 index 0000000..cfb2ec9 --- /dev/null +++ b/src/http/tpl/posts-manage.html @@ -0,0 +1,47 @@ +{{ define "body" }} + +

+ Back to Admin +

+ +

Posts

+ + {{ if ge .Payload.PrevPage 0 }} +

+ < < Previous Page +

+ {{ end }} + + + + {{ range .Payload.Posts }} + + + + + + + {{ end }} + +
{{ .PublishedAt.Local.Format "2006-01-02 15:04:05 MST" }}{{ .Title }} + + Edit + + +
+ +
+
+ + {{ if ge .Payload.NextPage 0 }} +

+ Next Page > > +

+ {{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/posts.html b/src/http/tpl/posts.html deleted file mode 100644 index fbeaa41..0000000 --- a/src/http/tpl/posts.html +++ /dev/null @@ -1,47 +0,0 @@ -{{ define "body" }} - -

- Back to Admin -

- -

Posts

- - {{ if ge .Payload.PrevPage 0 }} -

- < < Previous Page -

- {{ end }} - - - - {{ range .Payload.Posts }} - - - - - - - {{ end }} - -
{{ .PublishedAt.Local.Format "2006-01-02 15:04:05 MST" }}{{ .Title }} - - Edit - - -
- -
-
- - {{ if ge .Payload.NextPage 0 }} -

- Next Page > > -

- {{ end }} - -{{ end }} - -{{ template "base.html" . }} -- cgit v1.2.3