Source

cmsplugin-contact / cmsplugin_contact / templates / cmsplugin_contact / contact.html

{% load i18n %}

{% if form %}
	<form action="." method="post">
		<p{% if form.username.errors %} class="error"{% endif %}>
			<label class="contact_field">{{ contact.username_label }}</label>
				{{ form.username }}
			{% if form.username.errors %}
				{% for error in form.username.errors %}
					<span class="error_msg">{{ error }}</span>
				{% endfor %}
			{% endif %}
		</p>
		<p{% if form.phone.errors %} class="error"{% endif %}>
			<label class="contact_field">{{ contact.phone_label }}</label>
				{{ form.phone }}
			{% if form.phone.errors %}
				{% for error in form.phone.errors %}
					<span class="error_msg">{{ error }}</span>
				{% endfor %}
			{% endif %}
		</p>
		<p{% if form.email.errors %} class="error"{% endif %}>
			<label class="contact_field">{{ contact.email_label }}</label>
				{{ form.email }}
			{% if form.email.errors %}
				{% for error in form.email.errors %}
					<span class="error_msg">{{ error }}</span>
				{% endfor %}
			{% endif %}
		</p>
		<p{% if form.subject.errors %} class="error"{% endif %}>
			<label class="contact_field">{{ contact.subject_label }}</label>
				{{ form.subject }}
			{% if form.subject.errors %}
				{% for error in form.subject.errors %}
					<span class="error_msg">{{ error }}</span>
				{% endfor %}
			{% endif %}
		</p>
		<p{% if form.content.errors %} class="error"{% endif %}>
			<label class="contact_field">{{ contact.content_label }}</label>
				{{ form.content }}
			{% if form.content.errors %}
				{% for error in form.content.errors %}
					<span class="error_msg">{{ error }}</span>
				{% endfor %}
			{% endif %}
		</p>
		{% if form.recaptcha_challenge_field %}
			<div{% if form.recaptcha_response_field.errors %} class="error"{% endif %}>
				{{ form.recaptcha_challenge_field }}
				{% if form.recaptcha_theme == "custom" %}
					<div id="recaptcha_widget" style="display:none">
					
					<div id="recaptcha_image"></div>
					<span class="recaptcha_only_if_incorrect_sol error_msg">{% trans "Incorrect please try again" %}</span>
					
					<label>
						<span class="recaptcha_only_if_image">{% trans "Enter the words above:" %}</span>
						<span class="recaptcha_only_if_audio">{% trans "Enter the numbers you hear:" %}</span>
					</label>
					
					<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
					
					<div><a href="javascript:Recaptcha.reload()">{% trans "Get another CAPTCHA" %}</a></div>
					<div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">{% trans "Get an audio CAPTCHA" %}</a></div>
					<div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">{% trans "Get an image CAPTCHA" %}</a></div>
					
					<div><a href="javascript:Recaptcha.showhelp()">{% trans "Help" %}</a>
					
					</div>
				{% endif %}
			
				{% if form.recaptcha_response_field.label %}<label class="contact_field">{{ form.recaptcha_response_field.label }}</label>{% endif %}
				{{ form.recaptcha_response_field }}
			{% if form.recaptcha_response_field.errors %}
				{% for error in form.recaptcha_response_field.errors %}
					<span class="error_msg">{% trans error %}</span>
				{% endfor %}
			{% endif %}
			</div>
		{% endif %}
		
		{% if form.accept_terms %}
			{{ form.accept_terms }}
		{% endif %}
        {% if contact.extra_info_content %}
            <p>{{ contact.extra_info_content }}</p>
        {% endif %}
		<p>
			<input type="submit"{% if contact.submit %} value="{{ contact.submit }}"{% endif %} />
		</p>
		
		{% csrf_token %}
	</form>

{% else %}
	{{ contact.thanks|safe }}
{% endif %}