|
@@ -5,152 +5,137 @@
|
|
|
|
|
|
{{ $columns := $st.Params.design.columns | default "2" }}
|
|
{{ $columns := $st.Params.design.columns | default "2" }}
|
|
|
|
|
|
-<div class="row contact-widget {{if not $st.Title | or (eq $columns "1") }}justify-content-center{{end}}">
|
|
|
|
- {{ if $st.Title }}
|
|
|
|
- {{ if eq $columns "1" }}
|
|
|
|
- <div class="col-12 col-lg-8 section-heading text-center">
|
|
|
|
- {{ with $st.Title }}<h1>{{.}}</h1>{{ end }}
|
|
|
|
- {{ with $st.Params.subtitle }}<p>{{ . | markdownify | emojify }}</p>{{ end }}
|
|
|
|
- </div>
|
|
|
|
- {{else}}
|
|
|
|
- <div class="col-12 col-lg-4 section-heading">
|
|
|
|
- {{ with $st.Title }}<h1>{{.}}</h1>{{ end }}
|
|
|
|
- {{ with $st.Params.subtitle }}<p>{{ . | markdownify | emojify }}</p>{{ end }}
|
|
|
|
- </div>
|
|
|
|
- {{end}}
|
|
|
|
- {{ end }}
|
|
|
|
- <div class="col-12 col-lg-8">
|
|
|
|
- {{ with $st.Content }}{{ . }}{{ end }}
|
|
|
|
|
|
+<div class="col-12 {{if eq $columns "2"}}col-lg-8{{end}}">
|
|
|
|
+ {{ with $st.Content }}{{ . }}{{ end }}
|
|
|
|
|
|
- {{ if $st.Params.email_form }}
|
|
|
|
|
|
+ {{ if $st.Params.email_form }}
|
|
|
|
|
|
- {{ $post_action := "" }}
|
|
|
|
- {{ if eq $st.Params.email_form 1 }}
|
|
|
|
- {{ $post_action = "netlify" }}
|
|
|
|
- {{ else }}
|
|
|
|
- {{ if not $data.email }}
|
|
|
|
- {{ errorf "Please set an email address for the contact form using the `email` parameter in `params.toml`. Otherwise, set `email_form = 0` to disable the contact form." }}
|
|
|
|
|
|
+ {{ $post_action := "" }}
|
|
|
|
+ {{ if eq $st.Params.email_form 1 }}
|
|
|
|
+ {{ $post_action = "netlify" }}
|
|
|
|
+ {{ else }}
|
|
|
|
+ {{ if not $data.email }}
|
|
|
|
+ {{ errorf "Please set an email address for the contact form using the `email` parameter in `params.toml`. Otherwise, set `email_form = 0` to disable the contact form." }}
|
|
|
|
+ {{ end }}
|
|
|
|
+ {{ $post_action = printf "action=\"https://formspree.io/%s\"" $data.email }}
|
|
|
|
+ {{end}}
|
|
|
|
+
|
|
|
|
+ <div class="mb-3">
|
|
|
|
+ <form name="contact" method="POST" {{ $post_action | safeHTMLAttr }} {{ if eq $st.Params.email_form 1 }}netlify-honeypot="welcome-bot"{{end}} {{ if $st.Params.netlify.captcha }}data-netlify-recaptcha="true"{{end}}>
|
|
|
|
+ <div class="form-group form-inline">
|
|
|
|
+ <label class="sr-only" for="inputName">{{ i18n "contact_name" }}</label>
|
|
|
|
+ <input type="text" name="name" class="form-control w-100" id="inputName" placeholder="{{ i18n "contact_name" | default "Name" }}" required>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-group form-inline">
|
|
|
|
+ <label class="sr-only" for="inputEmail">{{ i18n "contact_email" }}</label>
|
|
|
|
+ <input type="email" name="email" class="form-control w-100" id="inputEmail" placeholder="{{ i18n "contact_email" | default "Email" }}" required>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <label class="sr-only" for="inputMessage">{{ i18n "contact_message" }}</label>
|
|
|
|
+ <textarea name="message" class="form-control" id="inputMessage" rows="5" placeholder="{{ i18n "contact_message" | default "Message" }}" required></textarea>
|
|
|
|
+ </div>
|
|
|
|
+ {{ if eq $st.Params.email_form 1 }}
|
|
|
|
+ <div class="d-none">
|
|
|
|
+ <label>Do not fill this field unless you are a bot: <input name="welcome-bot"></label>
|
|
|
|
+ </div>
|
|
{{ end }}
|
|
{{ end }}
|
|
- {{ $post_action = printf "action=\"https://formspree.io/%s\"" $data.email }}
|
|
|
|
- {{end}}
|
|
|
|
-
|
|
|
|
- <div class="mb-3">
|
|
|
|
- <form name="contact" method="POST" {{ $post_action | safeHTMLAttr }} {{ if eq $st.Params.email_form 1 }}netlify-honeypot="welcome-bot"{{end}} {{ if $st.Params.netlify.captcha }}data-netlify-recaptcha="true"{{end}}>
|
|
|
|
- <div class="form-group form-inline">
|
|
|
|
- <label class="sr-only" for="inputName">{{ i18n "contact_name" }}</label>
|
|
|
|
- <input type="text" name="name" class="form-control w-100" id="inputName" placeholder="{{ i18n "contact_name" | default "Name" }}" required>
|
|
|
|
- </div>
|
|
|
|
- <div class="form-group form-inline">
|
|
|
|
- <label class="sr-only" for="inputEmail">{{ i18n "contact_email" }}</label>
|
|
|
|
- <input type="email" name="email" class="form-control w-100" id="inputEmail" placeholder="{{ i18n "contact_email" | default "Email" }}" required>
|
|
|
|
- </div>
|
|
|
|
- <div class="form-group">
|
|
|
|
- <label class="sr-only" for="inputMessage">{{ i18n "contact_message" }}</label>
|
|
|
|
- <textarea name="message" class="form-control" id="inputMessage" rows="5" placeholder="{{ i18n "contact_message" | default "Message" }}" required></textarea>
|
|
|
|
- </div>
|
|
|
|
- {{ if eq $st.Params.email_form 1 }}
|
|
|
|
- <div class="d-none">
|
|
|
|
- <label>Do not fill this field unless you are a bot: <input name="welcome-bot"></label>
|
|
|
|
- </div>
|
|
|
|
- {{ end }}
|
|
|
|
- {{ if $st.Params.netlify.captcha }}
|
|
|
|
- <div class="form-group" data-netlify-recaptcha="true"></div>
|
|
|
|
- {{ end }}
|
|
|
|
- <button type="submit" class="btn btn-outline-primary px-3 py-2">{{ i18n "contact_send" | default "Send" }}</button>
|
|
|
|
- </form>
|
|
|
|
- </div>
|
|
|
|
- {{end}}
|
|
|
|
-
|
|
|
|
- <ul class="fa-ul">
|
|
|
|
-
|
|
|
|
- {{ if and $data.email (not $st.Params.email_form) }}
|
|
|
|
- <li>
|
|
|
|
- <i class="fa-li fas fa-envelope fa-2x" aria-hidden="true"></i>
|
|
|
|
- <span id="person-email">
|
|
|
|
- {{- if $autolink }}<a href="mailto:{{ $data.email }}">{{ $data.email }}</a>{{ else }}{{ $data.email }}{{ end -}}
|
|
|
|
- </span>
|
|
|
|
- </li>
|
|
|
|
|
|
+ {{ if $st.Params.netlify.captcha }}
|
|
|
|
+ <div class="form-group" data-netlify-recaptcha="true"></div>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
+ <button type="submit" class="btn btn-outline-primary px-3 py-2">{{ i18n "contact_send" | default "Send" }}</button>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
|
|
+ {{end}}
|
|
|
|
|
|
- {{ with $data.phone }}
|
|
|
|
- <li>
|
|
|
|
- <i class="fa-li fas fa-phone fa-2x" aria-hidden="true"></i>
|
|
|
|
- <span id="person-telephone">
|
|
|
|
- {{- if $autolink }}<a href="tel:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
|
|
|
|
- </span>
|
|
|
|
- </li>
|
|
|
|
- {{ end }}
|
|
|
|
|
|
+ <ul class="fa-ul">
|
|
|
|
|
|
- {{ $addr_formatted := "" }}{{/* Scoping for maps. */}}
|
|
|
|
- {{ if $data.address.street | or $data.address.city | or $data.address.region | or $data.address.postcode | or $data.address.country }}
|
|
|
|
- {{ $addr_formatted = partial "functions/get_address" (dict "root" . "address" $data.address) }}
|
|
|
|
- <li>
|
|
|
|
- <i class="fa-li fas fa-map-marker fa-2x" aria-hidden="true"></i>
|
|
|
|
- <span id="person-address">{{$addr_formatted}}</span>
|
|
|
|
- </li>
|
|
|
|
- {{ end }}
|
|
|
|
|
|
+ {{ if and $data.email (not $st.Params.email_form) }}
|
|
|
|
+ <li>
|
|
|
|
+ <i class="fa-li fas fa-envelope fa-2x" aria-hidden="true"></i>
|
|
|
|
+ <span id="person-email">
|
|
|
|
+ {{- if $autolink }}<a href="mailto:{{ $data.email }}">{{ $data.email }}</a>{{ else }}{{ $data.email }}{{ end -}}
|
|
|
|
+ </span>
|
|
|
|
+ </li>
|
|
|
|
+ {{ end }}
|
|
|
|
|
|
- {{ with $data.directions }}
|
|
|
|
- <li>
|
|
|
|
- <i class="fa-li fas fa-compass fa-2x" aria-hidden="true"></i>
|
|
|
|
- <span>{{ . | markdownify | emojify }}</span>
|
|
|
|
- </li>
|
|
|
|
- {{ end }}
|
|
|
|
|
|
+ {{ with $data.phone }}
|
|
|
|
+ <li>
|
|
|
|
+ <i class="fa-li fas fa-phone fa-2x" aria-hidden="true"></i>
|
|
|
|
+ <span id="person-telephone">
|
|
|
|
+ {{- if $autolink }}<a href="tel:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
|
|
|
|
+ </span>
|
|
|
|
+ </li>
|
|
|
|
+ {{ end }}
|
|
|
|
|
|
- {{ with $data.office_hours }}
|
|
|
|
|
|
+ {{ $addr_formatted := "" }}{{/* Scoping for maps. */}}
|
|
|
|
+ {{ if $data.address.street | or $data.address.city | or $data.address.region | or $data.address.postcode | or $data.address.country }}
|
|
|
|
+ {{ $addr_formatted = partial "functions/get_address" (dict "root" . "address" $data.address) }}
|
|
<li>
|
|
<li>
|
|
- <i class="fa-li fas fa-clock fa-2x" aria-hidden="true"></i>
|
|
|
|
- <span>
|
|
|
|
- {{- if not (reflect.IsSlice .)}}{{/* Support legacy string format. */}}
|
|
|
|
- {{- . | markdownify | emojify -}}
|
|
|
|
- {{else}}
|
|
|
|
- {{- delimit . "<br>" | markdownify | emojify -}}
|
|
|
|
- {{end -}}
|
|
|
|
- </span>
|
|
|
|
|
|
+ <i class="fa-li fas fa-map-marker fa-2x" aria-hidden="true"></i>
|
|
|
|
+ <span id="person-address">{{$addr_formatted}}</span>
|
|
</li>
|
|
</li>
|
|
- {{ end }}
|
|
|
|
|
|
+ {{ end }}
|
|
|
|
|
|
- {{ with $data.appointment_url }}
|
|
|
|
- <li>
|
|
|
|
- <i class="fa-li fas fa-calendar-check fa-2x" aria-hidden="true"></i>
|
|
|
|
- <a href="{{ . }}" target="_blank" rel="noopener">{{ i18n "book_appointment" | default "Book an appointment" }}</a>
|
|
|
|
- </li>
|
|
|
|
- {{ end }}
|
|
|
|
|
|
+ {{ with $data.directions }}
|
|
|
|
+ <li>
|
|
|
|
+ <i class="fa-li fas fa-compass fa-2x" aria-hidden="true"></i>
|
|
|
|
+ <span>{{ . | markdownify | emojify }}</span>
|
|
|
|
+ </li>
|
|
|
|
+ {{ end }}
|
|
|
|
|
|
- {{/* Contact links. */}}
|
|
|
|
- {{ range $data.contact_links }}
|
|
|
|
- {{ $pack := or .icon_pack "fas" }}
|
|
|
|
- {{ $pack_prefix := $pack }}
|
|
|
|
- {{ if in (slice "fab" "fas" "far" "fal") $pack }}
|
|
|
|
- {{ $pack_prefix = "fa" }}
|
|
|
|
- {{ end }}
|
|
|
|
- {{ $link := .link }}
|
|
|
|
- {{ $scheme := (urls.Parse $link).Scheme }}
|
|
|
|
- {{ $target := "" }}
|
|
|
|
- {{ if not $scheme }}
|
|
|
|
- {{ $link = .link | relLangURL }}
|
|
|
|
- {{ else if in (slice "http" "https") $scheme }}
|
|
|
|
- {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
|
|
|
|
- {{ end }}
|
|
|
|
- <li>
|
|
|
|
- <i class="fa-li {{ $pack }} {{ $pack_prefix }}-{{ .icon }} fa-2x" aria-hidden="true"></i>
|
|
|
|
- <a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }}>{{.name|markdownify|emojify|safeHTML}}</a>
|
|
|
|
- </li>
|
|
|
|
- {{ end }}
|
|
|
|
|
|
+ {{ with $data.office_hours }}
|
|
|
|
+ <li>
|
|
|
|
+ <i class="fa-li fas fa-clock fa-2x" aria-hidden="true"></i>
|
|
|
|
+ <span>
|
|
|
|
+ {{- if not (reflect.IsSlice .)}}{{/* Support legacy string format. */}}
|
|
|
|
+ {{- . | markdownify | emojify -}}
|
|
|
|
+ {{else}}
|
|
|
|
+ {{- delimit . "<br>" | markdownify | emojify -}}
|
|
|
|
+ {{end -}}
|
|
|
|
+ </span>
|
|
|
|
+ </li>
|
|
|
|
+ {{ end }}
|
|
|
|
|
|
- </ul>
|
|
|
|
-
|
|
|
|
- {{ if and site.Params.map.engine $data.coordinates.latitude }}
|
|
|
|
- <div class="d-none">
|
|
|
|
- <input id="map-provider" value="{{ site.Params.map.engine }}">
|
|
|
|
- <input id="map-lat" value="{{ $data.coordinates.latitude }}">
|
|
|
|
- <input id="map-lng" value="{{ $data.coordinates.longitude }}">
|
|
|
|
- <input id="map-dir" value="{{ $addr_formatted }}">
|
|
|
|
- <input id="map-zoom" value="{{ site.Params.map.zoom | default "15" }}">
|
|
|
|
- <input id="map-api-key" value="{{ site.Params.map.api_key }}">
|
|
|
|
- </div>
|
|
|
|
- <div id="map"></div>
|
|
|
|
|
|
+ {{ with $data.appointment_url }}
|
|
|
|
+ <li>
|
|
|
|
+ <i class="fa-li fas fa-calendar-check fa-2x" aria-hidden="true"></i>
|
|
|
|
+ <a href="{{ . }}" target="_blank" rel="noopener">{{ i18n "book_appointment" | default "Book an appointment" }}</a>
|
|
|
|
+ </li>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
|
|
+ {{/* Contact links. */}}
|
|
|
|
+ {{ range $data.contact_links }}
|
|
|
|
+ {{ $pack := or .icon_pack "fas" }}
|
|
|
|
+ {{ $pack_prefix := $pack }}
|
|
|
|
+ {{ if in (slice "fab" "fas" "far" "fal") $pack }}
|
|
|
|
+ {{ $pack_prefix = "fa" }}
|
|
|
|
+ {{ end }}
|
|
|
|
+ {{ $link := .link }}
|
|
|
|
+ {{ $scheme := (urls.Parse $link).Scheme }}
|
|
|
|
+ {{ $target := "" }}
|
|
|
|
+ {{ if not $scheme }}
|
|
|
|
+ {{ $link = .link | relLangURL }}
|
|
|
|
+ {{ else if in (slice "http" "https") $scheme }}
|
|
|
|
+ {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
|
|
|
|
+ {{ end }}
|
|
|
|
+ <li>
|
|
|
|
+ <i class="fa-li {{ $pack }} {{ $pack_prefix }}-{{ .icon }} fa-2x" aria-hidden="true"></i>
|
|
|
|
+ <a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }}>{{.name|markdownify|emojify|safeHTML}}</a>
|
|
|
|
+ </li>
|
|
|
|
+ {{ end }}
|
|
|
|
+
|
|
|
|
+ </ul>
|
|
|
|
+
|
|
|
|
+ {{ if and site.Params.map.engine $data.coordinates.latitude }}
|
|
|
|
+ <div class="d-none">
|
|
|
|
+ <input id="map-provider" value="{{ site.Params.map.engine }}">
|
|
|
|
+ <input id="map-lat" value="{{ $data.coordinates.latitude }}">
|
|
|
|
+ <input id="map-lng" value="{{ $data.coordinates.longitude }}">
|
|
|
|
+ <input id="map-dir" value="{{ $addr_formatted }}">
|
|
|
|
+ <input id="map-zoom" value="{{ site.Params.map.zoom | default "15" }}">
|
|
|
|
+ <input id="map-api-key" value="{{ site.Params.map.api_key }}">
|
|
</div>
|
|
</div>
|
|
|
|
+ <div id="map"></div>
|
|
|
|
+ {{ end }}
|
|
|
|
+
|
|
</div>
|
|
</div>
|