feat: add attachments and success_url options to contact form (#2394)

Scope: Netlify forms
This commit is contained in:
rodrigoalcarazdelaosa authored and GitHub committed 2021-07-24 17:32:02 +01:00
1 parent ce834f7b9c
commit cda364b190
4 files changed
+17 -4

No files matched your search

+5 -3
View File
@@ -75,13 +75,15 @@
- id: more_publications
translation: Més publicacions
- id: contact_name
translation: Name
translation: Nom
- id: contact_email
translation: Email
- id: contact_message
translation: Message
translation: Missatge
- id: contact_attachment
translation: Adjunt
- id: contact_send
translation: Send
translation: Enviar
- id: book_appointment
translation: Book an appointment
- id: abstract
+3
View File
@@ -138,6 +138,9 @@
- id: contact_message
translation: Message
- id: contact_attachment
translation: Attach file
- id: contact_send
translation: Send
+2
View File
@@ -80,6 +80,8 @@
translation: Email
- id: contact_message
translation: Mensaje
- id: contact_attachment
translation: Adjunto
- id: contact_send
translation: Enviar
- id: book_appointment
@@ -38,7 +38,7 @@
{{ end }}
<div class="mb-3">
<form name="contact" method="POST" {{ $post_action | safeHTMLAttr }} {{ if $use_netlify_form }}netlify-honeypot="_gotcha"{{ end }} {{ if $use_netlify_captcha }}data-netlify-recaptcha="true"{{ end }}>
<form name="contact" method="POST" {{ $post_action | safeHTMLAttr }} {{ if $use_netlify_form }}netlify-honeypot="_gotcha"{{ end }} {{ if $use_netlify_captcha }}data-netlify-recaptcha="true"{{ end }} {{ with $st.Params.content.form.netlify.success_url }}action="{{ . | relLangURL }}"{{ 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>
@@ -51,6 +51,12 @@
<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 $st.Params.content.form.netlify.attachments }}
<div class="form-group form-inline">
<label class="sr-only" for="fileUpload">{{ i18n "contact_attachment" }}</label>
<input type="file" name="file" class="form-control w-100" id="fileUpload" placeholder="{{ i18n "contact_attachment" | default "Attach file" }}">
</div>
{{ end }}
<div class="d-none">
<label>Do not fill this field unless you are a bot: <input name="_gotcha"></label>
</div>