{# Card d'une notification dans la liste /notifications. Args : - notif : Notification entity (avec actor + targetReview + targetReview.work pré-fetched) Texte généré selon notif.type : - review_liked → "{actor} a aimé ta critique de {book}" - review_commented → "{actor} a commenté ta critique de {book}" - user_followed → "{actor} te suit maintenant" Le wrapper
  • est cliquable et mène à la cible : - review_* → page critique - user_followed → profil de l'actor #} {% set actor = notif.actor %} {% set actor_avatar = user_avatar(actor) %} {% set actor_name = actor.displayName ?: actor.username %} {% if notif.type.value == 'user_followed' %} {% set link = path('app_profile_show', { handle: actor.username }) %} {% elseif notif.targetReview %} {% set link = path('app_review_show', { publicId: notif.targetReview.publicId }) %} {% else %} {% set link = path('app_home') %} {% endif %}
  • {% if actor_avatar %} {% else %} {% endif %}

    {{ actor_name }} {% if notif.type.value == 'review_liked' %} a aimé ta critique de {{ notif.targetReview.work.title }} {% elseif notif.type.value == 'review_commented' %} a commenté ta critique de {{ notif.targetReview.work.title }} {% elseif notif.type.value == 'user_followed' %} te suit maintenant {% endif %}

    {{ notif.createdAt|date('d M Y · H:i') }}