summaryrefslogtreecommitdiff
path: root/src/http/tpl/posts-manage.html
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2024-05-18 18:29:19 +0200
committerBrian Picciano <mediocregopher@gmail.com>2024-05-18 18:29:19 +0200
commit0665d0c65974533fbd313f4e0b062b5103057aeb (patch)
tree5287795eed9767bd959a5139b77ef78b4024216d /src/http/tpl/posts-manage.html
parentffa26298c95451639a6e01db6692d02d50b3d518 (diff)
Replace all URL rendering within templates by a URLConstructor
Diffstat (limited to 'src/http/tpl/posts-manage.html')
-rw-r--r--src/http/tpl/posts-manage.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/http/tpl/posts-manage.html b/src/http/tpl/posts-manage.html
index f9adbc1..ad9c9d7 100644
--- a/src/http/tpl/posts-manage.html
+++ b/src/http/tpl/posts-manage.html
@@ -1,6 +1,6 @@
{{ define "body" }}
- {{ $page := .GetQueryIntValue "p" 0 -}}
+ {{ $page := .GetQueryIntValue "page" 0 -}}
{{ $getPostsRes := .GetPosts $page 20 -}}
<script>
@@ -11,14 +11,14 @@
</script>
<p>
- <a href="{{ BlogURL "admin" }}">Back to Admin</a>
+ <a href="{{ .RootURL.Path "admin" }}">Back to Admin</a>
</p>
<h1>Posts</h1>
{{ if gt $page 0 }}
<p>
- <a href="?method=manage&p={{ .Add $page -1 }}">&lt; &lt; Previous Page</a>
+ <a href="{{ .RootURL.Posts.MethodManage.Page (.Add $page -1) }}">&lt; &lt; Previous Page</a>
</p>
{{ end }}
@@ -33,15 +33,15 @@
{{ range $getPostsRes.Posts }}
<tr>
<td>{{ .PublishedAt.Local.Format "2006-01-02 15:04:05 MST" }}</td>
- <td><a href="{{ PostURL .ID }}">{{ .Title }}</a></td>
+ <td><a href="{{ $.RootURL.Post .ID }}">{{ .Title }}</a></td>
<td>
- <a href="{{ PostURL .ID }}?method=edit">
+ <a href="{{ ($.RootURL.Post .ID).MethodEdit }}">
Edit
</a>
</td>
<td>
<form
- action="{{ PostURL .ID }}?method=delete"
+ action="{{ ($.RootURL.Post .ID).MethodDelete }}"
method="POST"
>
<input
@@ -58,7 +58,7 @@
{{ if $getPostsRes.HasMore }}
<p>
- <a href="?method=manage&p={{ .Add $page 1 }}">Next Page &gt; &gt;</a>
+ <a href="{{ .RootURL.Posts.MethodManage.Page (.Add $page 1) }}">Next Page &gt; &gt;</a>
</p>
{{ end }}