Formulario de contacto
This commit is contained in:
parent
ab27eaaed5
commit
5a59db7503
2 changed files with 59 additions and 0 deletions
40
_data/forms/contacto.yml
Normal file
40
_data/forms/contacto.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
pronouns:
|
||||
type: "string"
|
||||
autocomplete: "sex"
|
||||
label:
|
||||
es: "Pronombres"
|
||||
en: "Pronouns"
|
||||
placeholder:
|
||||
es: "¿Qué pronombres usás?"
|
||||
en: "What are your pronouns?"
|
||||
name:
|
||||
type: "string"
|
||||
autocomplete: "name"
|
||||
label:
|
||||
es: "Nombre"
|
||||
en: "Name"
|
||||
placeholder:
|
||||
es: "Nombre elegido, pseudónimo, alias"
|
||||
en: "Choosen name, pseudonym, alias"
|
||||
from:
|
||||
type: "email"
|
||||
autocomplete: "email"
|
||||
label:
|
||||
es: "Correo electrónico"
|
||||
en: "E-mail address"
|
||||
body:
|
||||
type: text
|
||||
label:
|
||||
es: Mensaje
|
||||
en: Message
|
||||
consent:
|
||||
type: boolean
|
||||
label:
|
||||
es: Acepto las políticas de privacidad
|
||||
en: I agree to the privacy policy
|
||||
submit:
|
||||
type: submit
|
||||
label:
|
||||
es: Enviar
|
||||
en: Send
|
19
_includes/contact.html
Normal file
19
_includes/contact.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{% comment %}
|
||||
Esta imagen obtiene una cookie desde la API de Sutty para autorizar el
|
||||
envío del formulario.
|
||||
{% endcomment %}
|
||||
<img class="d-none" src="https://api.sutty.nl/v1/sites/{{ site.hostname }}/contact/cookie.png" />
|
||||
|
||||
{% comment %}
|
||||
El formulario se envía a la API. La definición del formulario se
|
||||
encuentra en _data/forms/contacto.yml
|
||||
{% endcomment %}
|
||||
<form action="https://api.sutty.nl/v1/sites/{{ site.hostname }}/contact/contacto"
|
||||
method="post">
|
||||
{%- for field in include.form -%}
|
||||
{% assign template = field[1].type | append: '.html' %}
|
||||
<div class="col{{ field[1].col | default: 12 | prepend: '-' }}">
|
||||
{% include {{ template }} field=field %}
|
||||
</div>
|
||||
{%- endfor -%}
|
||||
</form>
|
Loading…
Reference in a new issue