<!DOCTYPE html>
<title>Basic Layout</title>

<!-- Includes layout/header.html into template -->
{% include "layout/header.html" %}

<!-- Sets active_page variable for active tab -->
{% set active_page = "index" %}

<!-- Prints successful flashed messages from Flask -->
{% for message in get_flashed_messages(category_filter=["success"]) %}
    <div class="alert alert-success alert-block">
    <h4>Success!</h4>
    {% for n in message.split("<br>") %}
  	{{ n }} <br>
    {% endfor %}
    </div>
{% endfor %}

<!-- Prints general success messages from javascript -->
<div id="discard_many" class="alert alert-success" style="display:none;"></div>


<!-- Prints error flashed messages from Flask -->
{% for message in get_flashed_messages(category_filter=["error"]) %}
    <div class="alert alert-error">
    {% for n in message.split("<br>") %}
    	{{ n }} <br>
    {% endfor %}
    </div>
{% endfor %}

<!-- Prints login flashed messages from Flask -->
{% for message in get_flashed_messages(category_filter=["login"]) %}
    <div class=alert>
    {% for n in message.split("<br>") %}
    	{{ n }} <br>
    {% endfor %}
    </div>
{% endfor %}

<!-- Prints errors from any forms.  -->
{% if form and form.errors %}
	<div class=alert>
    	{% for field_name, field_errors in form.errors|dictsort if field_errors %}
            {% for error in field_errors %}
    			{{ error }} <br>
    		{% endfor %}
    	{% endfor %}
    </div>
{% endif %}

  
<body>
	<div class="container">
    	<!-- Includes layout/nav.html into template -->
    	{% include "layout/nav.html" %}

    	<div class="container">
    		
			{% block body %}{% endblock %}
		</div> <!-- /container -->

    	<!-- Includes layout/footer.html into template -->
    	{% include "layout/footer.html" %}
    </div>
    

</body>