Thema extension proposal.
[redakcja.git] / src / documents / templates / documents / base.html
index 81af893..53ed63a 100644 (file)
@@ -2,6 +2,7 @@
 {% load pipeline i18n %}
 {% load static %}
 {% load documents %}
+{% load alerts %}
 <!DOCTYPE html>
 <html>
 <head lang="{{ LANGUAGE_CODE }}">
     </ul>
 
     <ul class="navbar-nav">
-        {% include "registration/head_login.html" %}
+
+      {% get_alerts as alerts %}
+      {% if alerts.count %}
+        <div class="nav-item dropdown">
+          <a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" title="Alert">
+            ðŸ””
+            <span class="badge badge-danger">{{ alerts.count }}</span>
+          </a>
+          <div class="dropdown-menu dropdown-menu-right" style="max-width:400px; overflow: hidden;">
+            {% for alert in alerts.items %}
+              <a class="dropdown-item" href="{{ alert.book.get_absolute_url }}">
+                {{ alert.book }}<br>
+                {{ alert.rule.description }}
+                {% if alert.comment %}
+                  <br><small>{{ alert.comment }}</small>
+                {% endif %}
+              </a>
+            {% endfor %}
+          </div>
+        </div>
+      {% endif %}
+      {% include "registration/head_login.html" %}
     </ul>
 </nav>