all repos — nirvash @ 8fdc9ddb460f6dc76363da7c64bdae15927bf430

modular CMS using the quartzgun library

templates/cms_create.html (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{ $slug := .FormValue "slug" }}
{{ $title := .FormValue "title" }}
{{ $content := .FormValue "content" }}
{{ $createErr := ((.Context).Value "adapter").CreatePage "" $title $content }}

{{ template "header" . }}

{{ if $createErr }}
  <h2>Page Creation Error</h2>
  <span class="adapter-error">There was an error creating the page: {{ ($createErr).Error }}</span>
{{ else }}
  <h2>Page Created</h2>
  <span class="adapter-success">Page '{{ $title }}' created successfully</span>
{{ end }}

{{ template "footer" . }}