<!doctype html>

<html lang="en">
<head>
	
  <!-- Required meta tags -->
    <meta charset="utf-8">
    
	<!-- Make site responsive on mobile/tablet -->
	<meta name="viewport" content="width=device-width, initial-scale=1">

  	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

	<!-- Optional theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
	
	<link href="/stylesheets/app.css" rel="stylesheet">
	
  	<title>YelpCamp</title>
	
	
  

</head>

<body>
	
	<nav class="navbar navbar-default">
		<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">Toggle navigation</span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				</button>

				<a class="navbar-brand" href="/">YelpCamp</a>
			</div>
			
			<div id="navbar" class="collapse navbar-collapse">
			  <ul class="nav navbar-nav">
				<li class="<%= typeof page !== 'undefined' && page === 'campgrounds' ? 'active' : '' %>">
					<a href="/campgrounds">Home</a>
				</li>
			  </ul>
			  <ul class="nav navbar-nav navbar-right">
				  <% if(!currentUser){ %>
					  <li class="<%= typeof page !== 'undefined' && page === 'login' ? 'active' : '' %>">
						  <a href="/login">Login</a>
				  </li>
					  <li class="<%= typeof page !== 'undefined' && page === 'register' ? 'active' : '' %>">
						  <a href="/register">Sign Up</a>
				  </li>
				  <% } else { %>
					  <li><a href="#">Signed In As <%= currentUser.username %></a></li>
					  <li><a href="/logout">Logout</a></li>
				  <% } %>
			  </ul>
			</div>
		</div>
	</nav>
	
	
	<div class="container">
		<% if(error && error.length > 0){ %>
			<div class="alert alert-danger" role="alert">
				<%=error%>
			</div>
		<% } %>
		<% if(success && success.length > 0){ %>
			<div class="alert alert-success" role="alert">
				<%=success%>
			</div>
		<% } %>
	</div>