{% extends 'base.html.twig' %}
{% block title %}Notifications - Na+{% endblock %}
{% block body %}
Notifications
{# Compteurs par catégorie #}
{% if notifications|length > 0 %}
{% set cntFollow = notifications|filter(n => n.type == 'follow_request' and not n.isRead)|length %}
{% set cntFollowOk = notifications|filter(n => n.type == 'follow_accepted' and not n.isRead)|length %}
{% set cntMsg = notifications|filter(n => n.type == 'new_message' and not n.isRead)|length %}
{% set cntComment = notifications|filter(n => n.type == 'new_comment' and not n.isRead)|length %}
{% set cntLike = notifications|filter(n => n.type == 'new_like' and not n.isRead)|length %}
{% set cntCommunity = notifications|filter(n => n.type starts with 'community' and not n.isRead)|length %}
{% if cntFollow + cntFollowOk + cntMsg + cntComment + cntLike + cntCommunity > 0 %}