{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% load static %}

{% block modals%}
{% endblock %}

{% block script %}
{% endblock %}

{% block main %}
{% regroup item by PIC_L_Site as item_by_site %}

{% for site in item_by_site %}
<h1>{{ site.grouper }}</h1>
	{% regroup site.list by PIC_L_Service as item_by_service %}
	<table class="table table-sm mb-2">
	{% for service in item_by_service %}
		<thead><tr><th scope="col" colspan="4" class="m">{{ service.grouper }}</th><th scope="col">{{ service.list|length }}</th></tr></thead>
		<tbody>
			{% for item in service.list %}
				<tr>
					<td>&nbsp;</td>
					<td>
						{% if item.PIC_L_Chassi_Type == "PC"%}
							<i class="fas fa-desktop"></i>
						{% elif item.PIC_L_Chassi_Type == "CL" %}
							<i class="fas fa-network-wired"></i>
						{% elif item.PIC_L_Chassi_Type == "PORTABLE" %}
							<i class="fas fa-laptop"></i>
						{% elif item.PIC_L_Chassi_Type == "PANEL-PC" %}
							<i class="fas fa-tablet-alt"></i>
						{% elif item.PIC_L_Chassi_Type == "IMP" %}
							<i class="fas fa-print"></i>
						{% endif %}
						 {{item.get_PIC_L_Chassi_Type_display}} {% if item.PIC_Deg == 1%}/ DEG{% endif %}
					</td>
					<td>{{ item.PIC_Nom_netbios }}</td>
					<td>{{ item.PIC_Utilisateur }}</td>
					<td>{% if item.PIC_OS != none %}{{ item.PIC_OS }}{% else %}&nbsp;{% endif %}</td>
				</tr>
			{% endfor %}
		</tbody>
	{% endfor %}
	</table>

{% endfor %}
{% endblock %}

{% block right_panel %}
<div class="card-body">
	<div class="d-grid gap-2"><a class="btn btn-primary" href="/parc" role="button"><i class="fas fa-undo-alt"></i> Retour</a></div>
</div>
{% endblock %}