aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/templates/dashboard/page_form.html
diff options
context:
space:
mode:
Diffstat (limited to 'internal/web/templates/dashboard/page_form.html')
-rw-r--r--internal/web/templates/dashboard/page_form.html15
1 files changed, 2 insertions, 13 deletions
diff --git a/internal/web/templates/dashboard/page_form.html b/internal/web/templates/dashboard/page_form.html
index 5b47d05..4ee720b 100644
--- a/internal/web/templates/dashboard/page_form.html
+++ b/internal/web/templates/dashboard/page_form.html
@@ -1,12 +1,9 @@
-{{define "title"}}{{template "pageformtitle" .}} · {{.Blog.Title}}{{end}}
-{{define "pageformtitle"}}{{if eq .Data.page.Kind "gallery"}}{{if .Data.page.ID}}{{t "Edit gallery page"}}{{else}}{{t "New gallery page"}}{{end}}{{else}}{{if .Data.page.ID}}{{t "Edit page"}}{{else}}{{t "New page"}}{{end}}{{end}}{{end}}
+{{define "title"}}{{if .Data.page.ID}}{{t "Edit page"}}{{else}}{{t "New page"}}{{end}} · {{.Blog.Title}}{{end}}
{{define "content"}}
<div class="card">
- <h1>{{template "pageformtitle" .}}</h1>
- {{if eq .Data.page.Kind "gallery"}}<p class="lead muted">{{t "A gallery page shows every image in your files as a wall of pictures, newest first, between its intro and closing text."}}</p>{{end}}
+ <h1>{{if .Data.page.ID}}{{t "Edit page"}}{{else}}{{t "New page"}}{{end}}</h1>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="_csrf" value="{{.CSRF}}">
- {{if not .Data.page.ID}}<input type="hidden" name="kind" value="{{.Data.page.Kind}}">{{end}}
<label>{{t "Title"}}<br><input name="title" value="{{.Data.page.Title}}" required maxlength="120"></label>
<label>{{t "Address"}} <span class="muted">({{t "leave empty to make one from the title; e.g."}} <code>about</code> → {{.BlogURL}}/about)</span><br>
<input name="slug" value="{{.Data.page.Slug}}" pattern="[a-z0-9]([a-z0-9-]*[a-z0-9])?" maxlength="80"></label>
@@ -14,14 +11,6 @@
{{template "editor" (dict "name" "intro" "value" .Data.page.IntroMD "format" .Data.page.Format "rows" 8 "tall" false "upload" (print "/b/" .Blog.Subdomain "/files/upload") "preview" (print "/b/" .Blog.Subdomain "/preview") "csrf" .CSRF)}}
<label for="ed-outro">{{t "Closing text"}} <span class="muted">({{t "shown after the posts, in the same format; optional"}})</span></label>
{{template "editor" (dict "name" "outro" "value" .Data.page.OutroMD "format" .Data.page.Format "formatof" "intro" "rows" 8 "tall" false "upload" (print "/b/" .Blog.Subdomain "/files/upload") "preview" (print "/b/" .Blog.Subdomain "/preview") "csrf" .CSRF)}}
- {{if eq .Data.page.Kind "gallery"}}
- <h2>{{t "Images"}}</h2>
- <p class="muted small">{{t "Every image in your files is shown except the ones ticked here. The logo, favicon, header and background images are never shown."}}</p>
- {{if .Data.images}}<div class="imagegrid hidegrid">
- {{range .Data.images}}<label class="pick"><img src="/b/{{$.Blog.Subdomain}}/media/{{.ID}}" alt="" loading="lazy"><span class="name" title="{{.Filename}}">{{.Filename}}</span><span class="hide"><input type="checkbox" name="hide" value="{{.ID}}"{{if index $.Data.hidden .ID.String}} checked{{end}}> {{t "Hide"}}</span></label>{{end}}
- </div>
- {{else}}<p class="muted">{{t "No images in your files yet."}} <a href="/b/{{.Blog.Subdomain}}/files">{{t "Files"}}</a></p>{{end}}
- {{end}}
<label class="check"><input type="checkbox" name="show_in_nav"{{if .Data.page.ShowInNav}} checked{{end}}> {{t "Show in menu"}}</label>
<label class="check"><input type="checkbox" name="show_notices"{{if .Data.page.ShowNotices}} checked{{end}}> {{t "Show announcements on this page"}}</label>
<p class="actionrow">