From ee7eaeabc049b05c6f4bf3eedc4aae82cfb861c3 Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 16 Oct 2018 13:09:53 -0400 Subject: [PATCH] touch up front end of notification system --- jinja2/base.html | 5 ++++- static/base.css | 10 +++++++++- static/base.js | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/jinja2/base.html b/jinja2/base.html index 9bd7864..7d7142d 100644 --- a/jinja2/base.html +++ b/jinja2/base.html @@ -20,7 +20,7 @@ {% if request.user.is_authenticated %} {{ request.user.username }} - +
{% for sub in get_sub_msgs(request=request) %}
@@ -29,6 +29,9 @@
{% endfor %} + {% if not get_sub_msgs(request=request) %} + No new notifications + {% endif %}
{% endif %} diff --git a/static/base.css b/static/base.css index fde21d0..5b5bb8d 100644 --- a/static/base.css +++ b/static/base.css @@ -63,10 +63,18 @@ a:hover { #subbtn { width: 1.5em; height: 1.5em; - background-color: orange; border: none; } +.newSubs { + background-color: orange; +} + +.noNewSubs { + background-color: #F0F0F0; +} + + #subscriptionsContent { display: none; position: absolute; diff --git a/static/base.js b/static/base.js index cf36df5..3892d18 100644 --- a/static/base.js +++ b/static/base.js @@ -28,4 +28,7 @@ function clear_notification(msg_id) { elem.parentNode.removeChild(elem); elem = document.getElementById('subbtn'); elem.innerText = elem.innerText - 1; + if (elem.innerText === '0') { + elem.className = 'noNewSubs'; + } }