nirvash/templates/cms_save.html

15 lines
No EOL
513 B
HTML

{{ $slug := ((.Context).Value "params").Slug }}
{{ $newSlug := .FormValue "slug" }}
{{ $title := .FormValue "title" }}
{{ $content := .FormValue "content" }}
{{ $saveErr := ((.Context).Value "adapter").SavePage $slug $newSlug $title $content }}
{{ template "header" . }}
{{ if $saveErr }}
<span class="adapter-error">There was an error saving the page: {{ ($saveErr).Error }}</span>
{{ else }}
<span class="adapter-success">Page '{{ $title }}' saved successfully</span>
{{ end }}
{{ template "footer" . }}