templates/front/layout/messages.html.twig line 1

Open in your IDE?
  1. {% if app.session.flashBag.has('error') or app.session.flashBag.has('notice') or app.session.flashBag.has('js') or app.session.flashBag.has('popup') or app.session.flashBag.has('modal') or app.session.flashBag.has('html') %}
  2. <div class="{% if app.session.flashBag.has('error') %}messages errors{% endif %} {% if app.session.flashBag.has('notice') %}messages notices{% endif %}">
  3.     {% if app.session.flashBag.has('notice') %}
  4.         <div class="notice success" role="alert">
  5.             {% for msg in app.session.flashBag.get('notice') %}
  6.                 {{ msg|raw }}
  7.             {% endfor %}
  8.         </div>
  9.     {% endif %}
  10.     {% if app.session.flashBag.has('error') %}
  11.         <div class="alert error" role="alert">
  12.             {% for msg in app.session.flashBag.get('error') %}
  13.                 {{ msg|raw }}
  14.             {% endfor %}
  15.         </div>
  16.     {% endif %}
  17.     {% if app.session.flashBag.has('popup') %}
  18.         <script>
  19.             $(window).load(function(){
  20.             {% for msg in app.session.flashBag.get('modal') %}
  21.                 $.fancybox.open({
  22.                     content:'{{ msg|e('js') }}',
  23.                     type:'html',
  24.                     baseClass:'message-popup',
  25.                     modal:false
  26.                 });
  27.             {% endfor %}
  28.             });
  29.         </script>
  30.     {% endif %}
  31.     {% if app.session.flashBag.has('js') %}
  32.         <script>
  33.             $(document).ready(function(){
  34.             {% for msg in app.session.flashBag.get('js') %}
  35.                 {{ msg|raw }}
  36.             {% endfor %}
  37.             });
  38.         </script>
  39.     {% endif %}
  40.     {% if app.session.flashBag.has('html') %}
  41.         {% for msg in app.session.flashBag.get('html') %}
  42.             {{ msg|raw }}
  43.         {% endfor %}
  44.     {% endif %}
  45. </div>
  46. {% endif %}