{% extends "repapp/base.html" %}
{% block title %}
    - Gäste
{% endblock title %}
{% block page_title %}
    Gäste
{% endblock page_title %}
{% block content %}
    <p>
        <a href="{% url 'create_guest' %}" class="btn btn-primary">Neuen Gast anlegen</a>
        <a href="javascript:history.back()" class="btn btn-primary">Zurück</a>
    </p>
    <table class="table">
        <thead>
            <tr>
                <th scope="col">ID</th>
                <th scope="col">Name</th>
                <th scope="col">Telefon</th>
                <th scope="col">Wohnort</th>
                <th scope="col">eMail Adresse</th>
                <th scope="col">Bearbeiten</th>
                <th scope="col">Löschen</th>
            </tr>
        </thead>
        <tbody>
            {% for guest in object_list %}
                <tr>
                    <th scope="row">{{ guest.pk }}</th>
                    <td>{{ guest.name }}</td>
                    <td>{{ guest.phone }}</td>
                    <td>{{ guest.residence }}</td>
                    <td>{{ guest.mail }}</td>
                    <td>
                        <a href="{% url 'edit_guest' guest.pk %}" class="btn btn-primary">Bearbeiten</a>
                    </td>
                </tr>
            {% empty %}
                <tr>
                    <td colspan="4">Es sind keine Gäste verfügbar.</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock content %}
