{% extends "base.html" %}
{% block content %}

<div class="container mt-4">

    <h3>Inspection & Exit History</h3>

    <hr>

    <h5>Unit Inspections</h5>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>Unit</th>
                <th>Tenant</th>
                <th>Notes</th>
                <th>Date</th>
            </tr>
        </thead>
        <tbody>
            {% for i in inspections %}
            <tr>
                <td>{{ i.unit.unit_number }}</td>
                <td>{{ i.tenant.get_full_name }}</td>
                <td>{{ i.notes }}</td>
                <td>{{ i.created_at }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    <hr>

    <h5>Exit Records</h5>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>Tenant</th>
                <th>Unit</th>
                <th>Type</th>
                <th>Reason</th>
                <th>Date</th>
            </tr>
        </thead>
        <tbody>
            {% for e in exits %}
            <tr>
                <td>{{ e.tenant.get_full_name }}</td>
                <td>{{ e.unit.unit_number }}</td>
                <td>{{ e.exit_type }}</td>
                <td>{{ e.reason }}</td>
                <td>{{ e.created_at }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

</div>

{% endblock %}