src/Biceps/FrontBundle/Resources/views/Notifications/javascript-notification.html.twig line 1

Open in your IDE?
  1. <script type="text/javascript">
  2.     void function () {
  3.         let notifications = [],
  4.             duplicates = [];
  5.         {% for type in ['success', 'notice', 'warning', 'error'] %}
  6.         {% for message in app.session.flashbag.get(type) %}
  7.         if(duplicates.indexOf('{{ type }}{{ message | trans | e('js') }}') === -1) {
  8.             notifications.push({
  9.                 type: '{{ type }}',
  10.                 message: '{{ message | trans | e('js') }}'
  11.             });
  12.             duplicates.push('{{ type }}{{ message | trans | e('js') }}');
  13.         }
  14.         {% endfor %}
  15.         {% endfor %}
  16.         Biceps.extend({
  17.             notifications: notifications,
  18.         });
  19.     }();
  20. </script>