<!DOCTYPE html>
<html lang="en">
	<head>
		<title>YelpCamp</title>
		
		<meta charset="utf-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    	
		<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
		<link rel="stylesheet" type="text/css" href="/stylesheets/app.css">
	</head>
	<body>		
		<nav id="navbar" class="navbar navbar-expand-md navbar-light fixed-top">
			<div class="container-fluid">
				<a id="brand" class="navbar-brand" href="/">Yelp Camp</a>
			  	<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
			    	<span class="navbar-toggler-icon"></span>
			  	</button>
			  	<div class="collapse navbar-collapse" id="navbarCollapse">
			    	<ul class="navbar-nav mr-auto">
				      	<li class="nav-item">
				      		<hr class="d-block d-md-none">
				        	<a class="nav-link" href="/campgrounds">Home</a>
				      	</li>
				      	<% if(currentUser && currentUser.isAdmin){ %>
					      	<li class="nav-item">
					        	<a class="nav-link" href="/admin">Admin panel</a>
					      	</li>
					     <% } %>					     
			    	</ul>
			    	<ul class="navbar-nav ml-auto">   		
			    		<% if(!currentUser){ %>
				    		<li class="nav-item">
				    			<hr class="d-block d-md-none">
						     	<a class="nav-link login-signup" href="/login">Login</a>
						     </li>
				    		<li class="nav-item">
						     	<a class="nav-link login-signup" href="/register">Sign up</a>
						    </li>
						<% } else { %>
							<li class="nav-item">
								<hr class="d-block d-md-none">
						     	<a class="nav-link login-signup" href="/users/<%= currentUser._id %>"><i class="fas fa-user"></i> <%= currentUser.username %></i></a>
						     </li>
				    		<li class="nav-item">
						     	<a id="red-logout-link" class="nav-link" href="/logout">Logout</a>
						    </li>
						<% } %>
			    	</ul>
			  	</div>
		  	</div>
		</nav>
		<% if(error && error.length > 0){ %>
		<div class="container">
			<div class="alert alert-danger alert-dismissible fade show" role="alert">
				<%= error %>
				<button type="button" class="close" data-dismiss="alert" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
		</div>
		<% } else if(success && success.length > 0){%>
		<div class="container">
			<div class="alert alert-success alert-dismissible fade show" role="alert">
				<%= success %>
				<button type="button" class="close" data-dismiss="alert" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
		</div>
		<% } %>
		<div class="container">
		
		