nirvash/templates/cms_new.html

27 lines
996 B
HTML
Raw Normal View History

{{ $editableSlugs := ((.Context).Value "adapter").EditableSlugs }}
{{ $csrfToken := (.Context).Value "csrfToken" }}
{{ $noEmpty := .FormValue "no-empty" }}
{{ template "header" . }}
2022-06-07 06:59:41 +00:00
<h2>New Page</h2>
<form class="editor" method="POST" action="/create">
{{ if $noEmpty }}
<span class="edit-error">Empty fields are not allowed - please try again</span><br/>
{{ end }}
<input hidden name="csrfToken" value="{{$csrfToken}}"/>
<label for="title">Title</label><br/>
<input class="title-input" id="title" type="text" name="title" required/><br/>
{{ if $editableSlugs }}
2022-06-07 06:59:41 +00:00
<label for="slug">Slug</label><br/>
<input class="slug-input" id="slug" type="text" name="slug" required/><br/>
{{ end }}
2022-06-07 06:59:41 +00:00
<label for="content">Content</label><br/>
<textarea class="content-input" id="content" name="content" required></textarea><br/>
<a target="_blank" class="fmt-help" href="/fmt-help">Formatting help</a>
<input type="submit" value="Save"/>
</form>
2022-06-07 06:59:41 +00:00
{{ template "footer" . }}