{{ $action := .Get "action" | default "" }} {{ $method := .Get "method" | default "post" }} {{ if not (.Page.Scratch.Get "recaptchaLoaded") }} {{ with .Get "recaptcha_site_key" }} {{ $.Page.Scratch.Set "recaptchaLoaded" true }} {{ end }} {{ end }} {{ $seed := now.Unix }} {{ $random := delimit (shuffle (split (md5 $seed) "" )) "" }}
{{ $fieldCount := 0 }} {{ range $key, $value := .Params }} {{ if hasPrefix $key "field" }} {{ $fieldIndex := int (replaceRE "field(\\d+)_.*" "$1" $key) }} {{ if gt $fieldIndex $fieldCount }} {{ $fieldCount = $fieldIndex }} {{ end }} {{ end }} {{ end }} {{ range $i := seq 0 $fieldCount }} {{ $fieldType := $.Get (printf "field%d_type" $i) }} {{ $fieldName := $.Get (printf "field%d_name" $i) }} {{ $fieldLabel := $.Get (printf "field%d_label" $i) }} {{ $fieldRequired := $.Get (printf "field%d_required" $i) }} {{ $fieldPlaceholder := $.Get (printf "field%d_placeholder" $i) }} {{ $fieldOptions := $.Get (printf "field%d_options" $i) }} {{ if and $fieldType $fieldName $fieldLabel }} {{ if eq $fieldType "text" }}
{{ else if eq $fieldType "email" }}
{{ else if eq $fieldType "select" }}
{{ else if eq $fieldType "textarea" }}
{{ end }} {{ end }} {{ end }} {{ with .Get "recaptcha_site_key" }}
{{ end }}