{% extends 'custom_admin_base.html' %}
{% block content %}
    {% include 'custom_admin_user_sub.html' %}
    <div class="admin-list">
        <form action="{% url 'accounts:custom_user_search' %}" method="get" class="search-form">
            <input type="text" name="search-word" placeholder="이름으로검색"><input type="submit" value="검색">
        </form>
        <table cellpadding="0" cellspacing="0">
            <colgroup>
                <col />
                <col />
                <col />
                <col />
                <col />
            </colgroup>
            <thead>
                <tr>
                    <th>No.</th>
                    <th>이름</th>
                    <th>메일</th>
                    <th>전화번호</th>
                    <th>벤더</th>
                </tr>
            </thead>
            <tbody>
            {% if object_list %}
                {% for user in object_list %}
                    <tr onclick="as.getUserInfo({{ user.pk }})">
                        <th>{{ user.pk }}</th>
                        <td>{{ user.userprofile.user_name }}</td>
                        <td>{{ user.email }}</td>
                        <td>{{ user.userprofile.mobile }}</td>
                        <td>{{ user.userprofile.company }}</td>
                    </tr>
                {% endfor %}
            {% else %}
                <tr>
                    <td colspan="5">적합한 유저 목록이 없습니다</td>
                </tr>
            {% endif %}
            </tbody>
        </table>
        <div class="button-block">
            <a href="{% url 'accounts:register' %}" class="admin-add-button">신규등록</a>
            <a href="{% url 'accounts:custom_admin_list' %}" class="admin-add-button">전체목록</a>
        </div>
        {% include 'pagination/pagination.html' %}
    </div>
{% endblock content %}