forked from pratzs/Tripsters-coder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact page for shopify
49 lines (44 loc) · 1.68 KB
/
contact page for shopify
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% form 'contact' %}
{% if form.posted_successfully? %}
<div class="successForm feedback">
{{ 'contact.form.post_success' | t }}
</div>
{% endif %}
{% if form.errors %}
<div class="errorForm feedback">
<!-- {{ form.errors.size }} or {{ form.errors | size }} -->
<p>Your contact form has {{ form.errors | size | pluralize: "an error", "a few errors" }}. To submit your form, make the following changes and try again:</p>
{% for field in form.errors %}
<p>The {{ field | capitalize | replace: 'Body', 'Message' }} field {{ form.errors.messages[field] }}.</p>
{% endfor %}
</div>
{% endif %}
<div id="contactFormWrapper">
<p>
<label>{{ 'contact.form.name' | t }}</label>
<input type="text" required id="contactFormName" name="contact[name]">
</p>
<p>
<label>{{ 'contact.form.email' | t }}</label>
<input type="email" required id="contactFormEmail" name="contact[email]">
</p>
<p>
<label>{{ 'contact.form.phone' | t }}</label>
<input type="telephone" id="contactFormTelephone" name="contact[phone]">
</p>
<p>
<label>{{ 'contact.form.message' | t }}</label>
<textarea required rows="10" id="contactFormMessage" name="contact[body]"></textarea>
</p>
<p>
<input type="submit" id="contactFormSubmit" value="{{ 'contact.form.send' | t }}" />
</p>
</div>
{% endform %}
<style>
.contact-form {margin:1em 0}
.feedback {padding:0.5em 0.7em;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px}
.feedback p {padding:0.5em 0 !important;margin:0 !important}
.successForm {background:#bde0a8;color:green}
.errorForm {background:#eebdbd;color:red}
</style>