<!DOCTYPE html>
<html lang="en" data-th-fragment="header">
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
	
<!-- CSRF -->
<meta name="_csrf" th:content="${_csrf.token}"/>
<!-- default header name is X-CSRF-TOKEN -->
<meta name="_csrf_header" th:content="${_csrf.headerName}"/>

<!-- Tether core CSS -->
<link href="../../css/tether.min.css" th:href="@{/css/tether.min.css}"
	rel="stylesheet">

<!-- Bootstrap CSS -->
<link href="../../css/bootstrap.min.css"
	th:href="@{/css/bootstrap.min.css}" rel="stylesheet">

<!-- Font-Awesome CSS -->
<link href="../../css/font-awesome.min.css"
	th:href="@{/css/font-awesome.min.css}" rel="stylesheet">

<!-- NProgress CSS -->
<link href="../../css/nprogress.css" th:href="@{/css/nprogress.css}"
	rel="stylesheet">

<!-- thinker-md CSS -->
<link href="../../css/thinker-md.vendor.css"
	th:href="@{/css/thinker-md.vendor.css}" rel="stylesheet">

<!-- bootstrap tags CSS -->
<link href="../../css/bootstrap-tagsinput.css"
	th:href="@{/css/jquery.tagsinput.min.css}" rel="stylesheet">

<!-- bootstrap chosen CSS -->
<link href="../../css/component-chosen.min.css"
	th:href="@{/css/component-chosen.min.css}" rel="stylesheet">

<!-- toastr CSS -->
<link href="../../css/toastr.min.css" th:href="@{/css/toastr.min.css}"
	rel="stylesheet">

<!-- jQuery image cropping plugin CSS -->
<link href="../../css/cropbox.css" th:href="@{/css/cropbox.css}"
	rel="stylesheet">

<!-- Custom styles -->
<link href="../../css/style.css" th:href="@{/css/style.css}"
	rel="stylesheet">
<link href="../../css/thymeleaf-bootstrap-paginator.css"
	th:href="@{/css/thymeleaf-bootstrap-paginator.css}" rel="stylesheet">
<link href="../../css/blog.css" th:href="@{/css/blog.css}"
	rel="stylesheet">
</head>
<body>
	<nav class="navbar navbar-inverse bg-inverse navbar-toggleable-md">
		<div class="container">
			<button class="navbar-toggler navbar-toggler-right" type="button"
				data-toggle="collapse" data-target="#navbarsContainer"
				aria-controls="navbarsExampleContainer" aria-expanded="false"
				aria-label="Toggle navigation">
				<span class="navbar-toggler-icon"></span>
			</button>
			<a class="navbar-brand" href="/" th:href="@{/}">NewStarBlog</a>

			<div class="collapse navbar-collapse" id="navbarsContainer">

				<ul class="navbar-nav mr-auto">
					<li class="nav-item"><a class="nav-link"
						href="javascript:void(0)" th:attr="url='/blogs?order=new'">最新
							<span class="sr-only">(current)</span>
					</a></li>
					<li class="nav-item"><a class="nav-link"
						href="javascript:void(0)" th:attr="url='/blogs?order=hot'">最热</a>
					</li>
					<form class="form-inline mt-2 mt-md-0">
						<input class="form-control mr-sm-2" type="text" placeholder="搜索"
							id="indexkeyword" th:value="${keyword}"> <a
							href="javascript:void(0)"
							class="btn btn-outline-secondary my-2 my-sm-0" id="indexsearch"><i
							class="fa fa-search" aria-hidden="true"></i></a>
					</form>

				</ul>

				<div sec:authorize="isAuthenticated()" class="row">
					<div class="dropdown">
						<a class=" dropdown-toggle" href="/u/waylau"
							th:href="@{'/u/' + ${#authentication.principal.username}}"
							data-toggle="dropdown"><span sec:authentication="name"></span></a>
						<div class="dropdown-menu">
							<a class=" dropdown-item" href="/u/waylau"
								th:href="@{'/u/' + ${#authentication.principal.username}}">个人主页</a> <a
								class="dropdown-item" href="/u/waylau/profile"
								th:href="@{'/u/' + ${#authentication.principal.username}} + '/profile'">个人设置</a>
						</div>
					</div>
					<div>
						<a href="/u/waylau/blogs/edit"
							th:href="'/u/' + ${#authentication.principal.username} + '/blogs/edit'"
							class="btn btn-outline-success my-2 my-sm-0">写博客</a>
					</div>

					<form action="/logout" th:action="@{/logout}" method="post">
						<input class="btn btn-outline-success " type="submit" value="退出">
					</form>
				</div>

				<div sec:authorize="isAnonymous()">
					<a href="/login" class="btn btn-outline-success my-2 my-sm-0"
						type="submit">登录</a> <a href="/register"
						class="btn btn-outline-success my-2 my-sm-0" type="submit">注册</a>
				</div>
			</div>

		</div>
	</nav>
</body>
</html>