<!DOCTYPE html>
<html>

<head>
    <title>{{'CMS_WEBNAME'|sysconfig}}后台管理</title>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{'CMS_BASEHOST'|sysconfig}}/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="{{'CMS_BASEHOST'|sysconfig}}/static/css/admin.css">
    <script src="{{'CMS_BASEHOST'|sysconfig}}/static/js/jquery.min.js"></script>
    <script src="{{'CMS_BASEHOST'|sysconfig}}/static/js/respond.min.js"></script>
    <script src="{{'CMS_BASEHOST'|sysconfig}}/static/js/ad.js"></script>
    <script src="{{'CMS_BASEHOST'|sysconfig}}/static/js/bootstrap.min.js"></script>
</head>

<body>

    <div class="blog-masthead clearfix">
        <nav class="blog-nav">
            <a class="blog-nav-item active" href="/{{module_name}}/index/index"><span
                    class="glyphicon glyphicon-star"></span> <strong>后台管理中心</strong> <span
                    class="glyphicon glyphicon-star-empty"></span></a>
            <a class="blog-nav-item" href="{{'CMS_BASEHOST'|sysconfig}}" target="_blank"><span
                    class="glyphicon glyphicon-home"></span> 网站主页</a>
            <a class="blog-nav-item" href="/{{module_name}}/index/upcache"><span
                    class="glyphicon glyphicon-refresh"></span> 更新缓存</a>
            <a class="blog-nav-item" id="navexit" href="/{{module_name}}/login/loginout"><span
                    class="glyphicon glyphicon-off"></span> 注销</a>
            <a class="blog-nav-item pull-right" href="javascript:;"><small>您好：<span
                        class="glyphicon glyphicon-user"></span>
                    {{admin_info.name}}{{admin_info.role_name}}</small></a>
        </nav>
    </div>
    <div class="container-fluid">
        <div class="row">
            <!-- 左边开始 -->
            <div class="col-sm-3 col-md-2 sidebar">
                <div class="menu">
                    <ul class="leftmenu">
                        {% for  first in menus %}
                            {% if first.child|length == 0 and first.deep ==0 %} {% else %}
                        <!-- 一级菜单 -->
                        <li><a href="{% if first.child %} javascript:; {% else %} /{{first.module}}/{{first.controller}}/{{first.action}} {% endif %}"
                                class="{% if first.child %} inactive {% endif %} {% if menus|length== 0 %}  active {% endif %}"> {% if first.icon %}<small class="{{first.icon}}"></small>{% endif %}
                                {{first.name}}</a>
                            <!-- 二级菜单 -->
                             {% if first.child %}
                            <ul style="display: none">
                                {% for second in first.child %}
                                <li><a target="appiframe"
                                        href="{% if second.child %} javascript:;{% else %} /{{second.module}}/{{second.controller}}/{{second.action}} {% endif %}"
                                        class="{% if second.child %} inactive {% endif %}"><small
                                            class="glyphicon glyphicon-hand-right"></small>
                                       {{second.name}}</a>
                                    <!-- 三级菜单 -->
                                    {% if second.child %}
                                    <ul>{% for third in second.child %}
                                        <li><a target="appiframe"
                                                href="/{{third.module}}/{{third.controller}}/{{third.action}}"><small
                                                    class="glyphicon glyphicon-menu-right"></small>
                                                {{third.name}}</a>
                                            </li>
                                        {% endfor %}
                                    </ul>{% endif %}
                                </li>
                                {% endfor %}
                            </ul>{% endif %}
                        </li>
                        {% endif %}
                        {% endfor %}
                    </ul>
                </div>
                <script type="text/javascript">
                    $(document).ready(function () {
                        $('.inactive').click(function () {
                            var className = $(this).parents('li').parents().attr('class');

                            if ($(this).siblings('ul').css('display') == 'none') {
                                if (className == "leftmenu") {
                                    $(this).parents('li').siblings('li').children('ul').parent('li')
                                        .children('a').removeClass('active');
                                    $(this).parents('li').siblings('li').children('ul').slideUp(100);
                                    $(this).parents('li').children('ul').children('li').children('ul')
                                        .parent('li').children('a').removeClass('active');
                                    $(this).parents('li').children('ul').children('li').children('ul')
                                        .slideUp(100);
                                }

                                $(this).addClass('active');
                                $(this).siblings('ul').slideDown(100);
                            } else {
                                $(this).removeClass('active');
                                $(this).siblings('ul').slideUp(100);
                            }
                        });

                        $('.active').trigger("click");
                    });
                </script>
            </div><!-- 左边结束 -->

            <!-- 右边开始 -->
            <div class="col-sm-9 col-md-10 rightbox">
                <div id="mainbox">
                    <script type="text/javascript">
                        var viewH = document.documentElement.clientHeight;
                        var mainbox = document.getElementById("mainbox");
                        mainbox.style.height = (viewH - 75) + "px";
                    </script>
                    <iframe src="/fladmin/index/welcome" frameborder="0" scrolling="yes"
                        width="100%" height="100%" allowtransparency="true" id="appiframe" name="appiframe"></iframe>
                </div>
            </div><!-- 右边结束 -->
        </div>
    </div>
</body>

</html>