<!DOCTYPE html>
<html lang="fr">
<head>
    <title>{{ report['title'] }}</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='font-awesome-4.7.0/css/font-awesome.min.css') }}">
	<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='jquery-ui/jquery-ui.min.css') }}"/>
	<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='DataTables/datatables.min.css') }}"/>
	<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='datachecker.css') }}"/>
	 
	<script type="text/javascript" src="{{ url_for('static', filename='jquery-3.3.1.min.js') }}"></script>
	<script type="text/javascript" src="{{ url_for('static', filename='jquery-ui/jquery-ui.min.js') }}"></script>
	<script type="text/javascript" src="{{ url_for('static', filename='DataTables/datatables.min.js') }}"></script>
	<script type="text/javascript" src="{{ url_for('static', filename='datachecker.js') }}"> </script>
</head>
<body>
	<header>
		<a id="logo" href="\" title="Retour à l'accueil">
			<img src="{{ url_for('static', filename='mn_logo_mini.png') }}" />
		</a>
		<h1>Rapport de contrôle</h1>
	</header>
	
	<section id=main>
		
		<table style="text-align: left;">
			<tr>
				<th style="width: 150px;">Schéma</th>
				<td>{{ report['schema'] }}</td>
			</tr>
			<tr>
				<th>Fichier contrôlé</th>
				<td>{{ report['filename'] }}</td>
			</tr>
			<tr>
				<th>Temps de traitement</th>
				<td>{{ report['exec_time'] }}</td>
			</tr>
		</table>
		
		<h3>Check-Points</h3>
		<ul>
	    {% for chk in report['checkpoints'] %}
	    	{%- if chk['valid'] -%}
	    		<li><i class="fa fa-check valid"></i> <span>{{ chk['name'] }}</span></li>
	    	{% else %}
	    		<li><i class="fa fa-times error"></i> <span>{{ chk['name'] }}</span></li>
	    	{% endif %}
	    {% endfor %}
	    </ul>
    
        
    	{%- if report['errors'] -%}
	    	<h3>Détail des erreurs</h3>
	       
	       <table class="datatable cell-border display compact stripe">
	       	<thead>
	       		<tr>
		       		<th>Erreur</th>
		       		<th>Fichier</th>
		       		<th>Champs</th>
		       		<th>Description</th>
	       		</tr>
	       	</thead>
	       	<tbody>
	      		{% for typeerr in report['errors'] %}
	      			{% for err in report['errors'][typeerr]['list'] %}
		      			<tr>
			      			<td>{{ typeerr }}</td>
			       			<td>{{ err['filename'] }}</td>
			       			<td>{{ err['field'] }}</td>
			       			<td>{{ err['message'] }}</td>
		      			</tr>
		      		{% endfor %}
	      		{% endfor %}
	       	</tbody>
	       </table>
   		{% endif %}
    
    </section>
    
</body>

</html>