{% extends '@ajax-layout/layout.twig' %}

{% block body %}
	<form method="post" name="form_refus" id="form_refus" >
		<div class="clearfix">
      		<div class="row">
        		{{ inputTextarea('Commentaires de refus' | trad, 'comment_refus', post.comment_refus, path('Ajax.validator.isStringAvecEspace'), "{'sizeMin' : '1', 'sizeMax' : '3000'}", "","","","","rows='10'", true) }}
			</div>
		</div>
	</form>
	<div class="modal-footer">
		<button class="principal" onClick="sendForm('{{ path('Consultation.ReferencementAO.refuserReferencementAO', {codeTrait:codeTrait}) }}');">{{ 'Valider' | trad }}</button>
		<button class="secondaire" onclick="desactivePopup();">{{ 'Annuler' | trad }}</button>
	</div>
	
	<script>
    	function sendForm(path)
    	{
        	$.ajax({
        	  	dataType : 'html',
            	url: path,
            	data: $('#form_refus').serialize(),
            	type: "POST",
            	success: function(result){
            		$("#modal-body").html(result);
            	}
            });
    	}
	</script>
{% endblock %}