  {% 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" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      {% if category == 'success' %}
        <h4>Success!</h4>
      {% endif %}
      {% if category == 'error' %}
        <h4>Something went wrong...</h4>
      {% endif %}
      {% if category == 'warning' %}
        <h4>That was close!</h4>
      {% endif %}
      {{ message }}
      </div>
    {% endfor %}

  {% endif %}
  {% endwith %}