<header class="navbar navbar-static-top navbar-fixed-top manual-header" role="banner">
    <div class="container">
        <div class="navbar-header col-sm-12 col-md-8 col-lg-7">
            <div class="btn-group dropdown-menu-right pull-right slidebar visible-xs-inline-block visible-sm-inline-block">
                <button class="btn btn-default dropdown-toggle hidden-lg" type="button" data-toggle="dropdown"><i class="fa fa-align-justify"></i></button>
                <ul class="dropdown-menu" role="menu">
                    <li>
                        <a href="{{urlfor "HomeController.Index"}}" class="visible-xs" title="首页"><i class="fa fa-home"></i> 首页</a>
                    </li>
                    <li>
                        <a href="{{urlfor "CateController.List"}}" class="visible-xs" title="分类"><i class="fa fa-th"></i> 分类</a>
                    </li>
                    <li>
                        <a href="{{urlfor "LabelController.List"}}" class="visible-xs" title="标签"><i class="fa fa-tags"></i> 标签</a>
                    </li>
                    <li>
                        <a href="{{urlfor "BaseController.Search"}}" class="visible-xs visible-sm" title="搜索"><i class="fa fa-search"></i> 搜索</a>
                    </li>
                    <li><a href="https://gitee.com/TruthHun/BookStack" title="BookStack开源" target="_blank"><i class="fa fa-code"></i> 开源</a></li>
                {{if gt .Member.MemberId 0}}
                    <li>
                        <a href="{{urlfor "SettingController.Index"}}" title="个人中心"><i class="fa fa-user-o" aria-hidden="true"></i> 个人中心</a>
                    </li>
                    <li>
                        <a href="{{urlfor "UserController.Index" ":username" $.Member.Account}}" title="个人主页"><i class="fa fa-home" aria-hidden="true"></i> 个人主页</a>
                    </li>
                    <li>
                        <a href="{{urlfor "SettingController.Star"}}" title="我的收藏"><i class="fa fa-heart-o" aria-hidden="true"></i> 我的收藏</a>
                    </li>

                    <li>
                        <a href="{{urlfor "BookController.Index"}}" title="我的项目"><i class="fa fa-book" aria-hidden="true"></i> 我的项目</a>
                    </li>
                    <li>
                        <a href="{{urlfor "SettingController.Qrcode"}}" title="我的二维码"><i class="fa fa-qrcode" aria-hidden="true"></i> 我的二维码</a>
                    </li>
                {{if eq .Member.Role 0 }}
                    <li>
                        <a href="{{urlfor "ManagerController.Index"}}" title="管理后台"><i class="fa fa-university" aria-hidden="true"></i> 管理后台</a>
                    </li>
                {{end}}
                    <li>
                        <a href="{{urlfor "AccountController.Logout"}}" title="退出登录"><i class="fa fa-sign-out"></i> 退出登录</a>
                    </li>
                {{else}}
                    <li><a href="{{urlfor "AccountController.Oauth" ":oauth" "email"}}" title="注册"><i class="fa fa-user-plus"></i> 注册</a></li>
                    <li><a href="{{urlfor "AccountController.Login"}}" title="登录"><i class="fa fa-sign-in"></i> 登录</a></li>
                {{end}}
                </ul>
            </div>

            <a href="/" class="navbar-brand" title="{{.SITE_NAME}}">
                <img class="logo" src="/static/images/logo.png" alt="{{.SITE_NAME}}">
            </a>
            <nav class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li {{if .IsHome}}class="active"{{end}}>
                        <a href="{{urlfor "HomeController.Index" }}" title="首页">首页</a>
                    </li>
                    <li class="{{if .IsCate}}active{{end}}">
                        <a href="{{urlfor "CateController.List" }}" title="标签">分类</a>
                    </li>
                    <li class="{{if .IsLabel}}active{{end}}">
                        <a href="{{urlfor "LabelController.List" }}" title="标签">标签</a>
                    </li>
                    <li><a href="https://gitee.com/TruthHun/BookStack" title="BookStack开源" target="_blank">开源</a></li>
                </ul>
                <div class="searchbar pull-left visible-lg-inline-block visible-md-inline-block">
                    <form class="form-inline" action="{{urlfor "BaseController.Search"}}" method="get">
                        <input class="form-control" name="wd" type="search" style="width: 170px;" placeholder="请输入关键词..." value="{{.Keyword}}">
                        <button class="search-btn">
                            <i class="fa fa-search"></i>
                        </button>
                    </form>
                </div>
            </nav>


        </div>
        <nav class="navbar-collapse hidden-xs hidden-sm" role="navigation">
            <ul class="nav navbar-nav navbar-right">
                {{if gt .Member.MemberId 0}}
                <li>
                    <div class="img user-info" data-toggle="dropdown">
                        <img  onerror="this.src='/static/images/avatar.png'"  src="{{showImg .Member.Avatar "avatar"}}" class="img-circle userbar-avatar border" alt="{{.Member.Nickname}}">
                        <div class="userbar-content">
                            <span>{{.Member.Nickname}}</span>
                            <div>{{.Member.RoleName}}</div>
                        </div>
                        <i class="fa fa-chevron-down" aria-hidden="true"></i>
                    </div>
                    <ul class="dropdown-menu user-info-dropdown" role="menu">
                        <li>
                            <a href="{{urlfor "SettingController.Index"}}" title="个人中心"><i class="fa fa-user-o" aria-hidden="true"></i> 个人中心</a>
                        </li>
                        <li>
                            <a href="{{urlfor "UserController.Index" ":username" $.Member.Account}}" title="个人主页"><i class="fa fa-home" aria-hidden="true"></i> 个人主页</a>
                        </li>
                        <li>
                            <a href="{{urlfor "SettingController.Star"}}" title="我的收藏"><i class="fa fa-heart-o" aria-hidden="true"></i> 我的收藏</a>
                        </li>
                        <li>
                            <a href="{{urlfor "BookController.Index"}}" title="我的项目"><i class="fa fa-book" aria-hidden="true"></i> 我的项目</a>
                        </li>
                        <li>
                            <a href="{{urlfor "SettingController.Qrcode"}}" title="我的二维码"><i class="fa fa-qrcode" aria-hidden="true"></i> 我的二维码</a>
                        </li>
                        {{if eq .Member.Role 0  1}}
                        <li>
                            <a href="{{urlfor "ManagerController.Index"}}" title="管理后台"><i class="fa fa-university" aria-hidden="true"></i> 管理后台</a>
                        </li>
                        {{end}}
                        <li>
                            <a href="{{urlfor "AccountController.Logout"}}" title="退出登录"><i class="fa fa-sign-out"></i> 退出登录</a>
                        </li>
                    </ul>
                </li>
                {{else}}
                    <li><a href="{{urlfor "AccountController.Oauth" ":oauth" "email"}}" title="注册"><i class="fa fa-user-plus"></i> 注册</a></li>
                    <li><a href="{{urlfor "AccountController.Login"}}" title="登录"><i class="fa fa-sign-in"></i> 登录</a></li>
                {{end}}
            </ul>
        </nav>
    </div>
</header>