nirvash/templates/cms_new.html

26 lines
996 B
HTML

{{ $editableSlugs := ((.Context).Value "adapter").EditableSlugs }}
{{ $csrfToken := (.Context).Value "csrfToken" }}
{{ $noEmpty := .FormValue "no-empty" }}
{{ template "header" . }}
<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 }}
<label for="slug">Slug</label><br/>
<input class="slug-input" id="slug" type="text" name="slug" required/><br/>
{{ end }}
<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>
{{ template "footer" . }}