Add contact form

This commit is contained in:
Oliver Davies 2016-06-01 05:31:34 +01:00
parent 5e847a252b
commit 2650be1075
5 changed files with 58 additions and 3 deletions

View file

@ -100,6 +100,7 @@ main_menu:
talks: { href: /talks/, title: Talks }
experience: { href: /experience/, title: Experience }
blog: { href: /blog/, title: Blog }
contact: { href: /contact/, title: Contact }
meetups:
drupalbristol:

View file

@ -0,0 +1,12 @@
.page--contact
form
.form__name,
.form__email,
.form__subject,
.form__message
@extend .form-group
[type="email"],
[type="text"],
textarea
@extend .form-control

View file

@ -17,9 +17,6 @@
<a href="{{ site.url }}{{ link.href }}">{{ link.title }}</a>
</li>
{% endfor %}
<li>
<a href="mailto:{{ site.email }}?subject=Email%20from%20{{ site.short_url }}">Contact <i class="fa fa-envelope-o"></i></a>
</li>
</ul>
</div>{# .nav-collapse #}
</div>

6
source/contact-thanks.md Normal file
View file

@ -0,0 +1,6 @@
---
layout: page
nav: contact
title: Thanks!
---
Your email has been sent. You should receive a response within the next working day.

39
source/contact.html.twig Normal file
View file

@ -0,0 +1,39 @@
---
title: Contact
nav: contact
layout: page
---
{% block content %}
<p>To send me an email, complete the form below. The form is powered by <a href="https://formspree.io">Formspree</a>.</p>
<form action="https://formspree.io/{{ site.email }}" method="POST">
<div class="form__name">
<label for="name">Name</label>
<input type="text" name="name">
</div>
<div class="form__email">
<label for="email">Email</label>
<input type="email" name="email">
</div>
<div class="form__subject">
<label for="subject">Subject</label>
<input type="text" name="subject">
</div>
<div class="form__message">
<label for="message">Message</label>
<textarea name="message" rows="5"></textarea>
</div>
<div class="form__actions">
<input class="btn btn-primary" type="submit" value="Send email">
</div>
<input type="hidden" name="_next" value="{{ site.url }}/contact-thanks/" />
<input type="text" name="_gotcha" style="display: none" />
</form>
{% endblock %}
{% block body_classes 'page--contact' %}