mindoc/views/widgets/header.tpl

91 lines
5.1 KiB
Smarty
Raw Permalink Normal View History

2017-04-20 18:19:32 +08:00
<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-9 col-lg-8">
2018-03-13 14:14:56 +08:00
<a href="{{.BaseUrl}}/" class="navbar-brand" title="{{.SITE_NAME}}">
{{if .SITE_TITLE}}
{{.SITE_TITLE}}
{{else}}
{{.SITE_NAME}}
{{end}}
</a>
<nav class="collapse navbar-collapse col-sm-10">
<ul class="nav navbar-nav">
2018-02-28 16:43:19 +08:00
<li {{if eq .ControllerName "HomeController"}}class="active"{{end}}>
<a href="{{urlfor "HomeController.Index" }}" title="首页">首页</a>
</li>
2018-02-28 16:43:19 +08:00
<li {{if eq .ControllerName "LabelController"}}class="active"{{end}}>
<a href="{{urlfor "LabelController.List" }}" title="标签">标签</a>
</li>
</ul>
<div class="searchbar pull-left visible-lg-inline-block visible-md-inline-block">
<form class="form-inline" action="{{urlfor "SearchController.Index"}}" method="get">
<input class="form-control" name="keyword" type="search" style="width: 230px;" placeholder="请输入关键词..." value="{{.Keyword}}">
<button class="search-btn">
<i class="fa fa-search"></i>
</button>
</form>
</div>
</nav>
2017-04-20 18:19:32 +08:00
<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">
2017-05-12 19:14:29 +08:00
{{if gt .Member.MemberId 0}}
<li>
<a href="{{urlfor "SettingController.Index"}}" title="个人中心"><i class="fa fa-user" aria-hidden="true"></i> 个人中心</a>
</li>
<li>
<a href="{{urlfor "BookController.Index"}}" title="我的项目"><i class="fa fa-book" 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>
2017-05-12 19:14:29 +08:00
{{else}}
<li><a href="{{urlfor "AccountController.Login"}}" title="用户登录">登录</a></li>
2017-05-12 14:21:29 +08:00
{{end}}
2017-04-20 18:19:32 +08:00
</ul>
</div>
2017-05-12 14:21:29 +08:00
2017-04-20 18:19:32 +08:00
</div>
<nav class="navbar-collapse hidden-xs hidden-sm" role="navigation">
<ul class="nav navbar-nav navbar-right">
{{if gt .Member.MemberId 0}}
2017-04-20 18:19:32 +08:00
<li>
<div class="img user-info" data-toggle="dropdown">
2018-01-26 18:07:55 +08:00
<img src="{{cdnimg .Member.Avatar}}" onerror="this.src='{{cdnimg "/static/images/headimgurl.jpg"}}';" class="img-circle userbar-avatar" alt="{{.Member.Account}}">
2017-04-20 18:19:32 +08:00
<div class="userbar-content">
<span>{{.Member.Account}}</span>
<div>{{.Member.RoleName}}</div>
2017-04-20 18:19:32 +08:00
</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" aria-hidden="true"></i> 个人中心</a>
</li>
<li>
<a href="{{urlfor "BookController.Index"}}" title="我的项目"><i class="fa fa-book" aria-hidden="true"></i> 我的项目</a>
</li>
{{if eq .Member.Role 0 1}}
2017-04-20 18:19:32 +08:00
<li>
<a href="{{urlfor "ManagerController.Index"}}" title="管理后台"><i class="fa fa-university" aria-hidden="true"></i> 管理后台</a>
2017-04-20 18:19:32 +08:00
</li>
{{end}}
2017-04-20 18:19:32 +08:00
<li>
2017-04-21 18:20:35 +08:00
<a href="{{urlfor "AccountController.Logout"}}" title="退出登录"><i class="fa fa-sign-out"></i> 退出登录</a>
2017-04-20 18:19:32 +08:00
</li>
</ul>
</li>
{{else}}
<li><a href="{{urlfor "AccountController.Login"}}" title="用户登录">登录</a></li>
{{end}}
2017-04-20 18:19:32 +08:00
</ul>
</nav>
</div>
</header>