nirvash/templates/cms_edit.html

19 lines
605 B
HTML
Raw Normal View History

2022-06-03 04:56:38 +00:00
{{ $slug := ((.Context).Value "params").Slug }}
{{ $page := ((.Context).Value "adapter").GetPage $slug }}
{{ $editMode := ((.Context).Value "adapter").EditMode }}
{{ $editModes := (.Context).Value "edit-modes" }}
{{ template "header" . }}
<form method="POST" action="/save/{{$slug}}">
<textarea name="title">{{($page).Title}}</textarea>
<span>last edited {{($page).Edited}}</span>
{{ if eq $editMode 0 }}
<textarea name="content">{{($page).Content}}</textarea>
{{ else }}
<div contenteditable>{{($page).Content}}</div>
{{ end }}
<input type="submit" value="Save"/>
</form>
{{ template "footer" . }}