nirvash/templates/cms_save.html

15 lines
513 B
HTML
Raw Normal View History

{{ $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" . }}