templates/common/notifications.html.twig line 1

Open in your IDE?
  1. {% if notifications | length > 0 %}    
  2.     {% for n in notifications %}
  3.     <li class="dropdown-item">
  4.         <span class="text-muted">{{n.createdAt | date('d/m/y h:i')}}</span> 
  5.         {% if n.user %}
  6.         <span class="{{ n.user.id != user.id ? 'text-muted':''}}">{{n.user ? '('~ n.user.name ~ ')' : ''}}</span>
  7.         {% endif %}
  8.         <br>            
  9.         {% set seen = false %}
  10.         {% for ns in n.notificationsSeens %}
  11.             {% if ns.user.id == user.id %}
  12.                 {% set seen = true %}
  13.             {% endif %}
  14.         {% endfor %}
  15.         <span class="{{seen ? '' : 'fw-bold'}} text-wrap">{{ ((seen ? '' : '<i class="fa fa-eye-slash" aria-hidden="true"></i> ') ~ messages[n.id]) |raw}}</span>
  16.     </li>
  17.     {% endfor %}
  18. {% endif %}