aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/templates/dashboard/section_form.html
diff options
context:
space:
mode:
Diffstat (limited to 'internal/web/templates/dashboard/section_form.html')
-rw-r--r--internal/web/templates/dashboard/section_form.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/internal/web/templates/dashboard/section_form.html b/internal/web/templates/dashboard/section_form.html
new file mode 100644
index 0000000..9d4529c
--- /dev/null
+++ b/internal/web/templates/dashboard/section_form.html
@@ -0,0 +1,32 @@
+{{define "title"}}{{if .Data.section.ID}}Edit announcement{{else}}New announcement{{end}} ยท {{.Blog.Title}}{{end}}
+{{define "content"}}
+{{$s := .Data.section}}
+<div class="card">
+ <h1>{{if $s.ID}}Edit announcement{{else}}New announcement{{end}}</h1>
+ <form method="post" enctype="multipart/form-data">
+ <input type="hidden" name="_csrf" value="{{.CSRF}}">
+ <label>Title <span class="muted">(optional)</span><br><input name="title" value="{{$s.Title}}" maxlength="120" autofocus placeholder="Next meeting"></label>
+ <div class="row">
+ <label>Where<br><select name="placement">
+ <option value="above"{{if eq $s.Placement "above"}} selected{{end}}>Above the posts</option>
+ <option value="below"{{if eq $s.Placement "below"}} selected{{end}}>Below the posts</option>
+ <option value="sidebar"{{if eq $s.Placement "sidebar"}} selected{{end}}>Sidebar, under the menu</option>
+ </select></label>
+ <label>Look<br><select name="style">
+ <option value="note"{{if eq $s.Style "note"}} selected{{end}}>Highlighted</option>
+ <option value="warning"{{if eq $s.Style "warning"}} selected{{end}}>Warning</option>
+ <option value="plain"{{if eq $s.Style "plain"}} selected{{end}}>Plain</option>
+ </select></label>
+ </div>
+ <p class="muted small">The sidebar spot only exists when the menu is a sidebar (see <a href="/b/{{.Blog.Subdomain}}/design">Design</a>); otherwise a sidebar announcement is shown above the posts.</p>
+ <label for="ed-body">Text <span class="muted">(Markdown)</span></label>
+ {{template "editor" (dict "name" "body" "value" $s.BodyMD "rows" 10 "tall" false "upload" (print "/b/" .Blog.Subdomain "/images/upload") "csrf" .CSRF)}}
+ <label class="check"><input type="checkbox" name="enabled"{{if $s.Enabled}} checked{{end}}> Shown on the blog</label>
+ <p class="actionrow">
+ <button type="submit">Save</button>
+ <a class="btn secondary" href="{{.BlogURL}}" target="_blank">View blog &#8599;</a>
+ <a href="/b/{{.Blog.Subdomain}}/announcements">Back to announcements</a>
+ </p>
+ </form>
+</div>
+{{end}}