all repos — nirvash @ main

modular CMS using the quartzgun library

templates/cms_save.html (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{{ $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 }}

  <h2>Page Save Error</h2>
  <span class="adapter-error">{{ ($saveErr).Error }}</span>

{{ else }}

  <h2>Page Saved</h2>
  <span class="adapter-success">Page '{{ $title }}' saved successfully</span>

{{ end }}

{{ template "footer" . }}