{% from "helpers.html" import input %}
<!DOCTYPE html>
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bootstrap.css') }}">
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='responsive.css') }}">
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='pygments.css') }}">
	</head>

	<body>
		<div class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container">
					<div class="row">
						<div class="span12">
							<a href="#" class="brand">{{ config.TITLE }}</a>
							<ul class="nav">
								<li><a href="{{ url_for('wiki.home') }}">Home</a></li>
								<li><a href="{{ url_for('wiki.index') }}">Index</a></li>
								<li><a href="{{ url_for('wiki.tags') }}">Tags</a></li>
								<li><a href="{{ url_for('wiki.search') }}">Search</a></li>
								<li><a href="{{ url_for('wiki.settings')}}">Settings</a></li>
								<li><a href="{{ url_for('wiki.ebook')}}">eBook Creator</a></li>
								<li class="divider-vertical"></li>
								<li><a href="{{ url_for('wiki.create') }}">New Page</a></li>
								<li class="divider-vertical"></li>
								<li class="divider-vertical"></li>
								<li><a href="{{ url_for('wiki.admin') }}">New User</a></li>
								<li class="divider-vertical"></li>
								<li></li>
							</ul>

							<ul class="nav pull-right">
								{% if current_user.is_authenticated %}
									<li><a href="{{ url_for('wiki.user_logout') }}">Logout</a></li>
								{% else %}
									<li><a href="{{ url_for('wiki.user_login') }}">Login</a></li>
								{% endif %}
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="container">
			<div class="row">
				<div class="span10 offset1">
					{% block header %}
						<div class="page-header">
							<h1>{% block title %}{{ page.title }}{% endblock title %}</h1>
						</div>
					{% endblock header %}
				</div>
			</div>
			<div class="row">
				<div class="span7 offset1">
					{% with messages = get_flashed_messages(with_categories=True) %}
						{% if messages %}
							{% for category, message in messages %}
								<div class="alert alert-{{ category }}">
									<button type="button" class="close" data-dismiss="alert">&times;</button>
									{{ message }}
								</div>
							{% endfor %}
						{% endif %}
					{% endwith %}
					{% if form and form.errors %}
						<div class="alert alert-error">Errors occured verifying your input. Please check the marked fields below.</div>
					{% endif %}
					{% block content %}
					{% endblock content %}
				</div>
				<div class="span3">
					{% block sidebar %}
					{% endblock sidebar %}
				</div>
			</div>
		</div>
		<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.0/jquery.min.js "></script>
		<script type="text/javascript">
			if (typeof jQuery == 'undefined') {
				document.write(unescape("%3Cscript src='{{ url_for('static', filename='jquery.min.js') }}' type='text/javascript'%3E%3C/script%3E"));
			}
		</script>
		<script src="{{ url_for('static', filename='bootstrap.min.js') }}"></script>
		<script type="text/javascript">
			{% block postscripts %}
			{% endblock postscripts %}
		</script>
	</body>
</html>
