base.html 3 KB
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <title>{% block title %}Travel Carbon Footprint Calculator{% endblock %}</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        
        {% block meta %}
        <meta name="description" content="{{ content.meta.description }}">
        {% for author in content.meta.authors -%}
        <meta name="author" content="{{ author.name }} <{{ author.email }}>">
        {% endfor %}
        {% endblock %}

        {% assets "common_css" %}
        <link rel="stylesheet" type="text/css" href="{{ ASSET_URL }}" />
        {% endassets %}

        {% block css %}
        {% endblock %}
    </head>

    <body>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">{{ content.meta.title }}</a>
            </div>
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li><a href="{{ url_for('.home') }}">Home</a></li>

{#                    {% if not current_user.is_authenticated %}#}
{#                        <li><a href="{{ url_for('.login') }}">Login</a></li>#}
{#                    {% else %}#}
{#                        <li><a href="{{ url_for('.logout') }}">Logout</a></li>#}
{#                    {% endif %}#}

{#                    <li><a href="{{ url_for('.restricted') }}">Login Restricted Page</a></li>#}
                </ul>
            </div><!--/.nav-collapse -->
        </div>

        <div class="container">
            {% with messages = get_flashed_messages(with_categories=true) %}
                {% if messages %}
                    {% for category, message in messages %}
                        <div class="alert alert-{{ category }} alert-dismissible" role="alert">
                          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                          {{ message }}
                        </div>
                    {% endfor %}
                {% endif %}
            {% endwith %}

            {% block body %}
            {% endblock %}
        </div>

        {% assets "common_js" %}
            <script type="text/javascript" src="{{ ASSET_URL }}"></script>
        {% endassets %}
        
        {% block js %}
        {% endblock %}
    </body>
</html>