{% if recaptcha_webkey %}
	
	<script src="https://www.google.com/recaptcha/api.js" async defer></script>

{% endif %}
<form method="POST" action="{{ url_for(routename) }}" enctype="multipart/form-data">

	<fieldset class="tmFieldset{{ errors ? ' errors' : '' }}">

		{% for field in fields %}
				
			{% if field.type == 'fieldset' %}

				<fieldset class="tmSubfield">
					<legend>{{ translate(field.legend) }}</legend>
					{% for field in field.fields %}
					
						{% include '/partials/fields.twig' with {'itemName' : itemName, 'object' : object } %}
					
					{% endfor %}
				</fieldset>

			{% else %}

				{% include '/partials/fields.twig' with {'itemName' : itemName, 'object' : object} %}

			{% endif %}

		{% endfor %}
		
		<div class="personal-mail">
			<label>Personal Mail</label>
			<input type="text" name="personal-honey-mail">
		</div>

		{% if captchaoptions == 'standard' %}
			
			{{ captcha(true) }}
		
		{% elseif captchaoptions == 'aftererror' %}

			{{ captcha(old) }}

		{% else %}

			{{ clearcaptcha() }}
		
		{% endif %}
		
		{% if recaptcha_webkey %}
			<p><div class="g-recaptcha" data-sitekey="{{ recaptcha_webkey }}"></div></p>
		{% endif %}

		<input type="submit" value="{{ buttonlabel ? buttonlabel : 'send' }}" />
		
		<style>
			.personal-mail{ display:none }
			.error{ margin-top:4px; background:rgb(244 63 94); color:#FFF; padding: 2px; font-size:.9rem;}
			.errorfield input{ outline: 1px solid rgb(244 63 94); }
		</style>
	</fieldset>
</form>