{% with Notif = get_flashed_messages() %}
  {% if Notif %}
    {% for NotifText in Notif %}
    <script type="text/javascript">
      window.onload = function() { new PNotify('{{ NotifText }}');};
    </script>
   {% endfor %}
  {% endif %}
{% endwith %}


{% with errors = get_flashed_messages(category_filter=["error"]) %}
{% if errors %}

    {%- for NotifText in errors %}
    <script type="text/javascript">
      window.onload = function() { new PNotify({
        title: 'Erreur',
        text: '{{ NotifText }}',
        type: 'error',
        styling: 'fontawesome'
      });};
    </script>
    {% endfor -%}

{% endif %}
{% endwith %}


{% with info = get_flashed_messages(category_filter=["info"]) %}
{% if info %}

    {%- for NotifText in info %}
    <script type="text/javascript">
      window.onload = function() { new PNotify({
        title: 'Information',
        text: '{{ NotifText }}',
        type: 'info',
        styling: 'fontawesome'
      });};
    </script>
    {% endfor -%}

{% endif %}
{% endwith %}


{% with success = get_flashed_messages(category_filter=["success"]) %}
{% if success %}

    {%- for NotifText in success %}
    <script type="text/javascript">
      window.onload = function() { new PNotify({
        title: '',
        text: '{{ NotifText }}',
        type: 'success',
        styling: 'fontawesome'
      });};
    </script>
    {% endfor -%}

{% endif %}
{% endwith %}


{% with notice = get_flashed_messages(category_filter=["notice"]) %}
{% if notice %}

    {%- for NotifText in notice %}
    <script type="text/javascript">
      window.onload = function() { new PNotify({
        title: 'Attention',
        text: '{{ NotifText }}',
        type: 'notice',
        styling: 'fontawesome'
      });};
    </script>
    {% endfor -%}

{% endif %}
{% endwith %}
