{% 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="card{{ errors ? ' errors' : '' }}">

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

				<fieldset class="subfield">
					<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:red; color:#FFF; padding: 2px; font-size:.9rem;}
			.errorfield label{ color:red; }
			.errorfield input{ outline: 1px solid red; }
		</style>
	</fieldset>
</form>