all repos — nirvash @ main

modular CMS using the quartzgun library

templates/build.html (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{{ $buildOpts := ((.Context).Value "adapter").BuildOptions }}
{{ $csrfToken := (.Context).Value "csrfToken" }}

{{ template "header" . }}

<h2>Build</h2>

<form class="build" method="POST" action="/build-run">
<input hidden type="text" name="csrfToken" value="{{$csrfToken}}"/>
{{ if $buildOpts }}
<details><summary>Build Options</summary>
  {{ range $opt := $buildOpts }}
    {{ if eq ($opt).Type "bool" }}
        <label class="bool">{{($opt).Name}} <input type="checkbox" name="{{($opt).Name}}:{{($opt).Type}}"/></label><br/>
    {{ end }}
  {{ end }}
  {{ range $opt := $buildOpts }}
    {{ if eq ($opt).Type "int" }}
        <label>{{($opt).Name}} <input type="number" step="1" name="{{($opt).Name}}:{{($opt).Type}}"/></label><br/>
    {{ end }}
  {{ end }}
  {{ range $opt := $buildOpts }}
    {{ if eq ($opt).Type "float" }}
        <label>{{($opt).Name}} <input type="number" step="0.00000001" name="{{($opt).Name}}:{{($opt).Type}}"/></label><br/>
    {{ end }}
  {{ end }}
  {{ range $opt := $buildOpts }}
    {{ if eq ($opt).Type "string" }}
        <label>{{($opt).Name}} <input type="text" name="{{($opt).Name}}:{{($opt).Type}}"/></label><br/>
    {{ end }}
  {{ end }}
  {{ range $opt := $buildOpts }}
    {{ if eq ($opt).Type "multilinestring" }}
        <label>{{($opt).Name}} <textarea name="{{($opt).Name}}:{{($opt).Type}}"></textarea></label><br/>
    {{ end }}
  {{ end }}
</details>
{{ end }}
<input type="submit" value="Build"/>
</form>

{{ template "footer" . }}