<!-- 顶部菜单-->
<script src="/js/login.js"></script>

<nav class="navbar navbar-default navbar-fixed-top blog-nav-base">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">首页</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/"><strong class="web-settings-top-nav-site-name">${site.siteName}</strong></a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <%
                for(data in indexMenu){
                %>
                <li <%if(path==data.path){%> class="active"<%}%>  ><a href="${data.path!}">${data.cname!}</a></li>
                <%} %>
            </ul>

            <ul class="nav navbar-nav navbar-right">
                <%
                if(isEmpty(session.authContext)){%>
                    <li><a data-toggle="modal"  data-target="#login" href="#" onclick="loadQQJs('https://connect.qq.com/qc_jssdk.js','${site.appId!}','${site.qqCallBackUrl!}',function(){});"><i class="fa fa-sign-in"></i> 登录</a></li>


                    <%if(site.openReg){%>
                        <li><a data-toggle="modal"  data-target="#register" href="#"><i class="fa fa-sign-in"></i> 注册</a></li>
                    <%}%>

                <%}else{%>
                    <li><a data-toggle="modal"  data-target="#logout" href="#"><i class="fa fa-sign-out"></i> ${session.authContext.cname}</a></li>

                    <%if(array.contain(session.authContext.permissionPath,"/admin/console/page")){%>
                    <li><a href="/admin/console/page"><i class="fa fa-cog fa-spin"></i> 管理后台</a></li>
                <!--  target="_blank"-->
                    <%}%>
                <%}%>
            </ul>

            <form class="navbar-form navbar-right" id="search" action="/index">
                <input type="text" id="keyWord" name="keyWord" class="form-control" placeholder="请输入文章名称" value="${keyWord!}">
            </form>
        </div><!--/.nav-collapse -->
    </div>
</nav>