{# 头部定义 #}
{%- extends "admin/layout.html" -%}
{% block title %}看店宝{% endblock %}
{% block keywords %}看店宝{% endblock %}
{%- block description -%}看店宝{%- endblock -%}

{# 内容部分定义 ,将content部分内容替换成自己的内容,
<head>\
<body>\</html> 已经在layout.html里面,不需要在这里写了#}
{% block content %}
<div class="content-wrapper">
    <!-- Main content -->
    <section class="content">
        <!-- Main row -->
        <div class="row">
            <!-- Left col -->
            <section class="col-lg-12 connectedSortable middle">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="pull-left header"><i class="fa fa-inbox"></i> 菜单列表：</li>
                    </ul>
                    <br>
                    <a class="btn btn-primary btn-sm add-menu" href="{{ url_for('admin.menu_add') }}">添加菜单</a>
                    <div class="tab-content no-padding">
                        <div style="position: relative; height: auto;">
                            <div class="box-body">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>菜单名</th>
                                        <th>父级菜单名</th>
                                        <th>菜单地址</th>
                                        <th>菜单权限限制</th>
                                        <th>菜单排序</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for m in menus %}
                                    <tr>
                                        <td width="2%">{{ loop.index }}</td>
                                        <td width="5%">{% if m.name %}{{ m.name }}{% else %}-{% endif %}</td>
                                        <td width="5%">{% if m.father %}{{ m.father }}{% else %}-{% endif %}</td>
                                        <td width="5%">{% if m.url %}{{ m.url }}{% else %}-{% endif %}</td>
                                        <td width="5%">{% if m.permissions %}{{ m.permissions }}{% else %}-{% endif %}</td>
                                        <td width="5%">{% if m.sort %}{{ m.sort }}{% else %}-{% endif %}</td>
                                        <td width="10%">
                                            <a href="{{ url_for('admin.menu_edit', mid=m.id) }}">编辑</a> |
                                            <a href="{{ url_for('admin.menu_del', mid=m.id) }}" class="del">删除</a>
                                        </td>
                                    </tr>
                                    {% else %}
                                    <tr>
                                        <td colspan="9">未查询到该记录!</td>
                                    </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
    <!-- /.content -->
</div>

{% endblock %}