{% extends "private_info/main-base.html" %}
{% load static %}
{% block main-content %}
    <div style="width: 100%;">
        <table class="table" style="table-layout: fixed;word-break: break-all;word-wrap: break-word">
            <div>
                <div style="float: left">
                    <ul class='myul'>
{#                        <li><a onclick="getValues()" href="" class="btn btn-outline-secondary input-sm">批量删除</a></li>#}
                        <li><a href="{% url 'private_info:vn-data-new' data_type=ext_info.data_type %}" class="btn btn-outline-secondary">添加</a></li>
                    </ul>
                </div>
                <div style="float: right">
                    <form method="get" action="{% url 'private_info:vn-data' data_type=ext_info.data_type %}">
                        <input type="text" name="query_text" value="{{ ext_info.query_text }}">
                        <input type="submit" value="查询" name="submit" class="btn btn-outline-secondary"/>
                    </form>
                </div>
            </div>
            <tr>
{#                <th width="25"><input type="checkbox" id="checkAll" onclick="checkAll()"></th>#}
                <th>信息ID</th>
                <th>信息摘要</th>
                {% if ext_info.data_type == 'simple' %}
                    <th>信息内容</th>
                {% endif %}
                <th>操作</th>
            </tr>
            <tr>
                {% for item in info_list %}
{#                    <td><input type="checkbox" onclick="checkOne()" value="{{ item.id }}" name="item"></td>#}
                    <td>{{ item.id }}</td>
                    <td>{{ item.desc }}</td>
                    {% if ext_info.data_type == 'simple' %}
                        <td>{{ item.content | linebreaksbr }}</td>
                    {% endif %}
                    <td><a class="btn btn-outline-secondary input-sm"
                           href="{% url 'private_info:vn-data-delete' ext_info.data_type item.id %}">删除</a>
                        {% if ext_info.data_type != 'simple' %}
                            <a class="btn btn-outline-secondary"
                               href="{% url 'private_info:vn-data-display' ext_info.data_type item.id %}">查看</a>
                        {% endif %}
                        <a class="btn btn-outline-secondary"
                           href="{% url 'private_info:vn-data-modify' ext_info.data_type item.id %}">修改</a>
                    </td>
                    </tr>
                {% endfor %}
        </table>
    </div>
    <!--底部分页按钮显示-->
    {#        <div style="position: absolute;top: 30  %;left: 44%">#}
    {#            <nav aria-label="Page navigation">#}
    {#                <div class="pagination">#}
    {#                    <ul class="pagination">#}
    {#                        {% if page.has_previous %}#}
    {#                            <li><a href="/curd/{{ page.previous_page_number }}?query={{ query }}" aria-label="Previous">#}
    {#                                <span aria-hidden="true">&laquo;</span></a></li>#}
    {#                        {% endif %}#}
    {##}
    {#                        {% for num in page.paginator.page_range %}#}
    {#                            {% if pindex == page.number %}#}
    {#                                <li><a href="">{{ num }}</a></li>#}
    {#                            {% else %}#}
    {#                                <li><a href="/curd/{{ num }}?query={{ query }}">{{ num }}</a></li>#}
    {#                            {% endif %}#}
    {#                        {% endfor %}#}
    {##}
    {#                        {% if page.has_next %}#}
    {#                            <li><a href="{% url 'person:curdindex' page.next_page_number %}?query={{ query }}"#}
    {#                                   aria-label="Next">#}
    {#                                <span aria-hidden="true">&raquo;</span></a></li>#}
    {#                        {% endif %}#}
    {#                    </ul>#}
    {#                </div>#}
    {#            </nav>#}
    {#        </div>#}
{% endblock %}
