Repeat unread notifications count in user sidebar.
authorAlexandre Segura <mex.zktk@gmail.com>
Tue, 21 Mar 2017 11:36:42 +0100
changeset 456 2eabe92f91e6
parent 455 aff03a86c471
child 457 312239eca2e1
Repeat unread notifications count in user sidebar.
src/iconolab/templates/iconolab/user_base.html
--- a/src/iconolab/templates/iconolab/user_base.html	Tue Mar 21 11:36:00 2017 +0100
+++ b/src/iconolab/templates/iconolab/user_base.html	Tue Mar 21 11:36:42 2017 +0100
@@ -1,5 +1,7 @@
 {% extends 'iconolab_base.html' %}
 
+{% load notifications_tags %}
+
 {% block content %}
   <div class="page-header">
     <h1>{% if profile_user == request.user %}Mon espace:{% else %}Profil : {% endif %} {{profile_user.username}}</h1>
@@ -18,6 +20,11 @@
         {% if profile_user == request.user %}
         <a href="{% url 'user_notifications' %}"
           class="list-group-item {% if request.resolver_match.url_name == 'user_notifications' %}active{% endif%}">
+          {% notifications_unread as unread_count %}
+
+          {% if unread_count %}
+          <span class="badge badge-warning">{{ unread_count }}</span>
+          {% endif %}
           Notifications
         </a>
         <a href="{% url 'user_settings' %}"