{% for key, flashMessages in app.session.flashbag.all() %}
  {% for flashMessage in flashMessages %}
    <div class="{{ key }} message">
      <a class="message-close" href="javascript:void(0);" title="fermer"><img alt="close" src="{{ asset('bundles/muzichcore/img/1317386146_cancel.png') }}" /></a>
      <h3>{{ flashMessage|trans({}, 'flash') }}</h3>
    </div>
  
    {% if key == 'success' %}
    <script type="text/javascript" >
      $(document).ready(function(){
        window.setTimeout(function(){
          $('div.success').slideUp();
        }, 6000);
      });
    </script>
    {% endif %}
  {% endfor %}
{% endfor %}