{# 分页宏 #}
{% macro pagination(paginator, url) %}
    <ul class="pagination pagination-centered">
        {% for page in paginator.iter_pages() %}
            {% if page %}
                {% if page == paginator.page %}
                    <li class="active"><span>{{ page }}</span></li>
                {% else %}
                    <li><a href="{{ url }}?page={{ page }}">{{ page }}</a></li>
                {% endif %}
            {% else %}
                <li class="disabled"><span class="ellipsis">…</span></li>
            {% endif %}
        {% endfor %}
    </ul>
{% endmacro %}

{# 底部信息 #}
{% macro foot() %}
    <div class="wrap" style="margin-left: 160px;">
        <div class="border">
            Copyright ©2016 <span>www.kandianbao.com</span> All Rights Reserved. <span>看店宝</span> 版权所有;
            <a href="//www.miitbeian.gov.cn/" target="_blank" rel="nofollow">粤ICP备13046353号-7</a>
        </div>
        <div>
            免责声明： 所有数据均为用户查询淘宝网公开信息而生成，本站不承担任何相关法律责任！
        </div>
    </div>
{% endmacro %}


{# 客服链接 #}
{% macro service() %}
    <div>
        客服QQ和旺旺信息
    </div>
{% endmacro %}

{# 递归构建菜单树 #}
{% macro menus_tree(menus_list) %}
    {% for m in menus_list %}
        <li>
            <a href="{% if m.child %}#{% else %}{{ m.my.url | safe }}{% endif %}"><i class="fa fa-circle-o"></i>{{ m.my.name }}
                {% if m.child %}
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                {% endif %}
            </a>
            {% if m.child %}
                <ul class="treeview-menu">
                    {{ menus_tree(m.child) }}
                </ul>
            {% endif %}
        </li>
    {% endfor %}
{% endmacro %}

{#三级菜单栏#}
{% macro menus_tree_third_stage() %}
    <style>

    </style>

{% endmacro %}

{# 时间选择器js #}
{% macro form_js(form) %}
    {% for f in form if f.widget.input_type != 'hidden' %}
        {% if f.widget.data_role == 'datatime' %}
            <script>
                $(document).ready(function () {
                    $('#{{ f.id }}').datetimepicker({
                        format: "yyyy-mm-dd hh:ii",
                        language: 'zh-CN'
                    });
                });
            </script>
        {% endif %}
    {% endfor %}
{% endmacro %}