{% extends 'order_base.html' %}
{% load staticfiles %}
{% block extrastyle %}<link rel="stylesheet" href="{% static 'base/css/jquery-confirm.min.css' %}"/>{% endblock extrastyle %}
{% block content %}
    <article>
        <p class="tableTitle"><span>{{ request.user }}</span> 님의 방문목록</p>
        <table>
            <colgroup>
                <col width="10%">
                <col width="70%">
                <col width="10%">
                <col width="10%">
            </colgroup>
            <thead>
                <tr>
                    <th>No.</th>
                    <th>유치원명</th>
                    <th>수정</th>
                    <th>삭제</th>
                </tr>
            </thead>
            <tbody>
                {% for object in object_list %}
                    <tr>
                        <td>{{ object.id }}</td>
                        <td><a href="{% url 'order_contract:little_smart_list' object.id %}">{{ object.name }}</a></td>
                        <td><a href="{% url 'kindergarten:update' object.id %}"><button>수정</button></a></td>
                        <td><a class="kindergartenDelete" href="{% url 'kindergarten:delete' object.id %}"><button>삭제</button></a></td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
        {% include 'pagination/pagination.html' %}
        <a href="{% url 'kindergarten:search' %}"><div class="addVisiteList blackBtn">방문목록추가</div></a>
    </article>
{% endblock content %}
{% block extrascript %}
    <script type="text/javascript" src="{% static 'base/js/jquery-confirm.min.js' %}"></script>
    <script type="text/javascript">

        $("a.kindergartenDelete").confirm({
            title: 'Confirm!',
            content: '해당 방문목록을 삭제하시겠습니까?',
            useBootstrap: false,
            buttons: {
                confirm: function () {
                    location.href = this.$target.attr('href');
                },
                cancel: function () {
                }
            }
        });

    </script>
{% endblock extrascript %}