<!-- Copyright (C) 2024 Nastro_ -->
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at https://mozilla.org/MPL/2.0/. -->

{% extends "gestionale/base.html" %}
{% load static %}
{% block content %}
{% if user.is_authenticated %}
<div class="detail-content">
    <div class="flex jc-space-evenly-center">
        <div>
            <ul class="pure-ul">
                <li>Immagine Profilo: <img src="/media/{{ student.profile_image }}" alt="profile_image"></li>
            </ul>
        </div>
        <div>
            <ul class="pure-ul">
                <li>Id Student: {{ student.id }}</li>
                <li>Nome: {{ student.first_name }}</li>
                <li>Cognome: {{ student.last_name }}</li>
                <li>Data di Nascita: {{ student.birth_date }}</li>
                <li>Codice Fiscale: {{ student.codice_fiscale }}</li>
                <li>Sesso: {{ student.gender }}</li>
                <li>Id Studente Corso: {{ student.id_student_course }}</li>
                <li>Sigla Corso: {{ student.course_acronym }}</li>
            </ul>
        </div>
        <div>
            <ul class="pure-ul">
                <li>Email Studente: {{ student.email_user }}</li>
                <li>Numero di Telefono: {{ student.phone_number }}</li>
                <li>Comune di Residenza: {{ student.municipality_residence }}</li>
                <li>Provincia di Residenza: {{ student.province_residence }}</li>
                <li>Comune di Nascita: {{ student.municipality_birth }}</li>
                <li>Provincia di Nascita: {{ student.province_birth }}</li>
                <li>Nazione di Nascita: {{ student.nation_birth }}</li>
                <li>Data di Dimissioni: {{ student.resignation_date }}</li>
                <li>Status Studente: {{ student.student_status }}</li>
                <li>Corso: {{ student.course_id }}</li>
            </ul>
        </div>
    </div>
    <div class="margin-tb-2rem">
    <h3>Computer assegnati</h3>
    </div>
    <table class="pure-table pure-table-horizontal width-100">
        <thead>
        <tr>
            <td>Id Computer</td>
            <td>Status</td>
            <td>Data di Assegnazione</td>
            <td>Motivazione di Assegnazione</td>
            <td>Data di Restituzione</td>
            <td>Motivazione di Restituzione</td>
            <td>Eol</td>
            <td>Data Eol</td>
            <td>Note</td>
            <td>Cespite</td>
            <td>Seriale</td>
            <td>Azioni</td>
        </tr>
        </thead>
        <tbody>
        {% for computer in computers %}
        <tr>
            <td> {{ computer.id }}</td>
            <td> {{ computer.status }}</td>
            <td> {{ computer.assignment_date }}</td>
            <td> {{ computer.assignment_motivation }}</td>
            <td> {{ computer.return_date }}</td>
            <td> {{ computer.return_motivation }}</td>
            <td> {{ computer.eol }}</td>
            <td> {{ computer.eol_date }}</td>
            <td> {{ computer.notes }}</td>
            <td> {{ computer.cespite }}</td>
            <td> {{ computer.serial }}</td>
            <td>

                <a href="/edit/computer/{{ computer.id }}" class="pure-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                         class="bi bi-pencil-square" viewBox="0 0 16 16">
                        <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
                        <path fill-rule="evenodd"
                              d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"/>
                    </svg>
                </a>
                <a href="/delete/computer/{{ computer.id }}" class="pure-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16"
                         height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
                        <path
                                d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/>
                        <path
                                d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/>
                    </svg>
                </a>
                <a href="/reset/computer/{{ computer.id }}" class="pure-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                         class="bi bi-arrow-counterclockwise" viewBox="0 0 16 16">
                        <path fill-rule="evenodd" d="M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2z"/>
                        <path d="M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466"/>
                    </svg>
                </a>
            </td>
        </tr>
        {% endfor %}
        </tbody>
    </table>
    <div class="margin-tb-2rem">
    <h3>Accessori assegnati</h3>
    </div>
    <table class="pure-table pure-table-horizontal width-100">
        <thead>
        <tr>
            <td>Id Accessorio</td>
            <td>Descrizione</td>
            <td>Status</td>
            <td>Data di Assegnazione</td>
            <td>Motivazione di Assegnazione</td>
            <td>Data di Restituzione</td>
            <td>Motivazione di Restituzione</td>
            <td>Note</td>
            <td>Azioni</td>
        </tr>
        </thead>
        <tbody>
        {% for accessory in accessories %}
        <tr>
            <td> {{ accessory.id }}</td>
            <td> {{ accessory.description }}</td>
            <td> {{ accessory.status }}</td>
            <td> {{ accessory.assignment_date }}</td>
            <td> {{ accessory.assignment_motivation }}</td>
            <td> {{ accessory.return_date }}</td>
            <td> {{ accessory.return_motivation }}</td>
            <td> {{ accessory.notes }}</td>
            <td>
                <a href="/edit/accessory/{{ accessory.id }}" class="pure-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                         class="bi bi-pencil-square" viewBox="0 0 16 16">
                        <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
                        <path fill-rule="evenodd"
                              d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"/>
                    </svg>
                </a>
                <a href="/delete/accessory/{{ accessory.id }}" class="pure-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16"
                         height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
                        <path
                                d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/>
                        <path
                                d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/>
                    </svg>
                </a>
                <a href="/reset/accessory/{{ accessory.id }}" class="pure-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                         class="bi bi-arrow-counterclockwise" viewBox="0 0 16 16">
                        <path fill-rule="evenodd" d="M8 3a5 5 0 1 1-4.546 2.914.5.5 0 0 0-.908-.417A6 6 0 1 0 8 2z"/>
                        <path d="M8 4.466V.534a.25.25 0 0 0-.41-.192L5.23 2.308a.25.25 0 0 0 0 .384l2.36 1.966A.25.25 0 0 0 8 4.466"/>
                    </svg>
                </a>
            </td>
        </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
{% endif %}
{% endblock %}