nirvash/templates/cms_save.html

17 lines
562 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 }}
2022-06-07 06:59:41 +00:00
<h2>Page Save Error</h2>
<span class="adapter-error">There was an error saving the page: {{ ($saveErr).Error }}</span>
{{ else }}
2022-06-07 06:59:41 +00:00
<h2>Page Saved</h2>
<span class="adapter-success">Page '{{ $title }}' saved successfully</span>
{{ end }}
{{ template "footer" . }}