{% block body %}
    <div id="refreshTab" style="padding-top: 5px;">
		<div class="clearfix">
			<a class="ajouter_blanc_v2 button_v2 white-tooltip" style="float: right;margin-left:5px!important;" id="btnAddCompany" href="{{ path('Reception.CreationBR.creatEdit', {order: order, type: type, mode: mode, init: '0', tab: 'newDoc'}) }}">
				<span class="infos_tooltip left">
					{{ 'Ajouter un document' | trad }}
				</span>
			</a>
		</div>
		<div id="refreshPJ">
			{% set Count = 0 %}
			{% for key, document in documentsList %}
				{% if documentsList[key - 1].TYPE_PJ !=  document.TYPE_PJ  %}
					{% set Count = Count + 1 %}
					<h4>{{ document.PJLIBELLE }}</h4>
					<table class="table table-hover tableV2">
						<thead class="thead-dark" style="display: none;">
							<th scope="col" colspan="6"></th>
						</thead>
						<tbody>
				{% endif %}
							<tr id="document_{{ document.NO_ORDRE }}">
								<td width="25%"><b>{{ document.TITRE }}</b></td>
								<td width="10%">{{ document.DT_VALID | dateTrad }}</td>
								<td width="20%">{{ document.NOM }} ({{ document.AUTEUR }})</td>
								<td>{{ shortLibelle(document.CONTMEMO, 45) }}</td>
								<td>
									<a href="{{ path('Reception.CreationBR.ajaxDownloadDoc', {id: order, ordre: document.NO_ORDRE}) }}">
										{{ document.NOM_ORI }}
									</a>
								</td>
								<td width="10%">
									{{ hover_action('document_' ~ document.NO_ORDRE, 'modifier_v2' , "window.location.href ='" ~ path('Reception.CreationBR.creatEdit', {order: order, type: type, mode: mode, init: '0', tab: 'newDoc', idDoc: document.NO_ORDRE}) ~ "'", 'float: right;margin-right:5px;') }}
									{{ hover_action('document_' ~ document.NO_ORDRE, 
                                    'Supprimer_v2', 
                                    "popupConfirmation("
                                        ~ path('Ajax.Erreur.popupConfirmationSuppresion')|json 
                                        ~ ",\'\', "   
                                        ~ path('Reception.CreationBR.ajaxDeleteDoc', {ordre: document.NO_ORDRE})|json 
                                        ~ ", " 
                                        ~ ('Etes-vous sûr de vouloir supprimer le document'| trad ~ " " ~ (document.TITRE) ~ " ?")|json 
                                        ~ ", \'refreshPJ\')", 
                                    'float: right;margin-right:5px;') }}
								</td>
							</tr>
					{% if documentsList[key+1].TYPE_PJ !=  document.TYPE_PJ  %}
						</tbody>
					</table>
					{% endif %}
			{% endfor %}
		</div>
	</div>
{% endblock %}

