haldis/app/templates/layout.html
Feliciaan De Palmenaer 7514396669 "I volunteer as Tribute"
2015-03-28 01:09:59 +01:00

61 lines
2.1 KiB
HTML

{% extends "bootstrap/base.html" %}
{% import "bootstrap/utils.html" as utils %}
{% set navbar = [
('home', 'Home'),
('order_bp.orders', 'Orders'),
('about', 'About'),
('stats', 'Stats'),
] -%}
{% if not current_user.is_anonymous() and current_user.is_admin() -%}
{% set navbar = navbar + [('admin.index', 'Admin')] -%}
{% endif -%}
{% set active_page = active_page|default('index') -%}
{% block title %}
FoodBot
{% endblock %}
{% block styles %}
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
{% endblock %}
{% block navbar %}
<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>
{% endblock %}
{% block content -%}
{{ utils.flashed_messages() }}
<div class="container">
{% block container -%}
{%- endblock %}
</div>
{%- endblock %}