Welcome to mirror list, hosted at ThFree Co, Russian Federation.

contact-form.html « shortcodes « layouts - gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3094002b12aa3e3fc9558cfbfb34bb7784dd1ed4 (plain)
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
43
44
45
46
{{ $autoComplete := "off" }}

{{ if .Site.Params.Contact.autoComplete }}
  {{ $autoComplete = "on" }}
{{ end }}


<form id="contact" {{ with .Site.Params.Contact.formspreeFormId }}action="https://formspree.io/{{ . }}"{{ end }} method="post" accept-charset="utf-8">
  <label class="label-form">{{ T "name" }}
    <input aria-label="{{ T "name" }}" class="input-text" type="text" name="name" minlength="3" {{ with .Site.Params.Contact.Placeholder.name }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required>
  </label>
  
  <label class="label-form">Email<input aria-label="Email" class="input-text" type="email" name="_replyto" {{ with .Site.Params.Contact.Placeholder.email }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required></label>
  
  {{ with .Site.Params.Contact.subject }}
    {{ if gt (len .) 1 }}
      <label class="label-form">{{ T "subject" }}
        <select aria-label="{{ T "subject" }}" class="input-text" name="_subject">
    
          {{ range . }}
            <option>{{ . }}</option>
          {{ end }}
        
        </select>
      </label>
    {{ else }}
      <input type="hidden" name="_subject" value="{{ index . 0 }}" />
    {{ end }}
  {{ else }}
  
    {{ with .Site.Params.Contact.Placeholder.subject }}
      <label class="label-form">{{ T "subject" }}
        <input aria-label="{{ T "subject" }}" class="input-text" type="text" name="_subject" minlength="6" placeholder="{{ . }}" autocomplete="{{ $autoComplete }}" required>
      </label>
    {{ end }}
  
  {{ end }}
  
  
  <label class="label-form">{{ T "message" }}<textarea id="message" aria-label="{{ T "message" }}" class="input-text" rows="6" name="message" {{ with .Site.Params.Contact.messageMinLength | default 140 }}minlength="{{ . }}"{{ end }} {{ with .Site.Params.Contact.Placeholder.message }}placeholder="{{ . }}"{{ end }} required></textarea></label>
  
  <input type="text" name="_gotcha">
  
  <input class="outline-dashed" type="submit" value="{{ T "submit" }}">

</form>