62 lines
No EOL
2.4 KiB
HTML
62 lines
No EOL
2.4 KiB
HTML
{% set navbar = [
|
|
('home', 'Home'),
|
|
('about', 'About'),
|
|
('stats', 'Stats'),
|
|
] -%}
|
|
{% if current_user.is_admin() -%}
|
|
{% set navbar = navbar + [('admin.index', 'Admin')] -%}
|
|
{% endif -%}
|
|
{% set active_page = active_page|default('index') -%}
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head lang="en">
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>FoodBot</title>
|
|
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
|
|
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-default navbar-fixed-top">
|
|
<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="{{ url_for('home') }}">FOODBOT</a>
|
|
</div>
|
|
<div id="navbar" class="navbar-collapse collapse">
|
|
<ul class="nav navbar-nav">
|
|
{% for id, text in navbar -%}
|
|
<li class="{{ 'active' if id == active_page else '' }}">
|
|
<a href="{{ url_for(id) }}">{{ text|e }}</a>
|
|
</li>
|
|
{% endfor -%}
|
|
</ul>
|
|
<ul class="nav navbar-nav navbar-right">
|
|
{% if current_user.is_anonymous() %}
|
|
<li><a href="{{ url_for('login') }}">Login</a></li>
|
|
{% else %}
|
|
<li><a href="#">{{ current_user.username }}</a></li>
|
|
<li><a href="{{ url_for('logout') }}">Logout</a></li>
|
|
{% endif %}
|
|
</ul>
|
|
</div><!--/.nav-collapse -->
|
|
</div>
|
|
</nav>
|
|
<div class="container">
|
|
{% block content %}
|
|
{% endblock %}
|
|
</div>
|
|
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
|
|
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
|
</body>
|
|
</html> |