2022-06-03 04:56:38 +00:00
|
|
|
{{ $slug := ((.Context).Value "params").Slug }}
|
|
|
|
{{ $page := ((.Context).Value "adapter").GetPage $slug }}
|
2022-06-05 04:34:20 +00:00
|
|
|
{{ $editableSlugs := ((.Context).Value "adapter").EditableSlugs }}
|
2022-06-06 05:29:39 +00:00
|
|
|
{{ $csrfToken := (.Context).Value "csrfToken" }}
|
|
|
|
{{ $noEmpty := .FormValue "no-empty" }}
|
2022-06-03 04:56:38 +00:00
|
|
|
|
|
|
|
{{ template "header" . }}
|
2022-06-05 04:34:20 +00:00
|
|
|
<a href="/">«</a>
|
2022-06-06 05:29:39 +00:00
|
|
|
<form class="editor" method="POST" action="/save/{{$slug}}">
|
|
|
|
{{ if $noEmpty }}
|
|
|
|
<span class="edit-error">Empty fields are not allowed - please try again</span><br/>
|
|
|
|
{{ end }}
|
|
|
|
<input hidden name="csrfToken" value="{{$csrfToken}}"/>
|
|
|
|
<input hidden name="oldSlug" value="{{$slug}}"/>
|
2022-06-05 04:34:20 +00:00
|
|
|
{{ if $editableSlugs }}
|
2022-06-06 05:29:39 +00:00
|
|
|
<input class="slug-input" type="text" name="slug" value="{{$slug}}"/><br/>
|
2022-06-05 04:34:20 +00:00
|
|
|
{{ end }}
|
2022-06-06 05:29:39 +00:00
|
|
|
<input class="title-input" type="text" name="title" value="{{($page).Title}}"/><br/>
|
|
|
|
<span class="edited-time">last edited {{($page).Edited}}</span><br/>
|
|
|
|
<textarea class="content-input" name="content">{{($page).Content}}</textarea><br/>
|
2022-06-05 04:34:20 +00:00
|
|
|
<input type="submit" value="Save"/>
|
2022-06-03 04:56:38 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
{{ template "footer" . }}
|