Skip to content

Instantly share code, notes, and snippets.

@rdallaire
Created December 6, 2012 18:48
Show Gist options
  • Save rdallaire/4227019 to your computer and use it in GitHub Desktop.
Save rdallaire/4227019 to your computer and use it in GitHub Desktop.
Contact Form On Other Pages
{% unless page.title == "Homepage" %}
<h1 class="pagetitle">{{ page.title }}</h1>
<div id="addthis">
<!-- AddThis Button BEGIN -->
<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=300&amp;pubid=ra-50b76d820adc7f5e"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50b76d820adc7f5e"></script>
<!-- AddThis Button END -->
</div>
{% endunless %}
{{ page.content }}
{% if site.pagename == "about_us"%}
<h1>Contact Us</h1>
{% if contact_us.success? %}
<h2>{{ "contact_us.success_message" | trans }}</h2>
<p>{{ "contact_us.get_back_to_you" | trans }}</p>
{% endif %}
{% if contact_us.errors? %}
<h2>{{ "contact_us.errors.message" | trans }}</h2>
{% if contact_us.email_invalid? %}
<p>{{ "contact_us.errors.email_invalid" | trans }}</p>
{% endif %}
{% if contact_us.name_blank? %}
<p>{{ "contact_us.errors.name_blank" | trans }}</p>
{% endif %}
{% if contact_us.message_blank? %}
<p>{{ "contact_us.errors.message_blank" | trans }}</p>
{% endif %}
{% endif %}
{% include "recaptcha_errors" %}
{% unless contact_us.success? %}
<form class="contact_us" action="/contact_us" method="POST">
{{ token_tag }}
<p>
<label for="name">{{ "contact_us.your_name" | trans }}</label></br>
<input type="text" id="name" name="name" value="{{ contact_us.name }}" />
</p><p>
<label for="email">{{ "contact_us.your_email" | trans }}</label></br>
<input type="email" id="email" name="email" value="{{ contact_us.email }}" />
</p><p>
<label for="message">{{ "contact_us.your_message" | trans }}</label></br>
<textarea type="message" id="message" name="message">{{ contact_us.message }}</textarea>
</p><p>
{{ "recaptcha.please_verify_your_humanity" | trans }}
{{ site.recaptcha_tags }}
</p>
<p><input type="submit" id="input" value="{{ "buttons.submit" | trans }}" /></p>
</form>
{% else %}
<h3>{{ "contact_us.your_message_as_received" | trans }}</h3>
<dl>
<dt>{{ "contact_us.from" | trans }}</dt>
<dd>{{ contact_us.name }} &lt;{{ contact_us.email }}&gt;</dd>
<dt>{{ "contact_us.message" | trans }}</dt>
<dd><pre>{{ contact_us.message }}</pre></dd>
</dl>
{% endunless %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment