diff --git a/amadeus/context_processors.py b/amadeus/context_processors.py index 585e13e..b28efeb 100644 --- a/amadeus/context_processors.py +++ b/amadeus/context_processors.py @@ -2,6 +2,7 @@ from datetime import datetime from themes.models import Themes from notifications.models import Notification +from mural.models import MuralVisualizations def theme(request): context = {} @@ -22,4 +23,16 @@ def notifies(request): context['notifications_count'] = notifications + return context + +def mural_notifies(request): + context = {} + + notifications = 0 + + if request.user.is_authenticated: + notifications = MuralVisualizations.objects.filter(viewed = False, user = request.user).count() + + context['mural_notifications_count'] = notifications + return context \ No newline at end of file diff --git a/amadeus/settings.py b/amadeus/settings.py index 33b1493..af84506 100644 --- a/amadeus/settings.py +++ b/amadeus/settings.py @@ -109,6 +109,7 @@ TEMPLATES = [ 'django.contrib.messages.context_processors.messages', 'amadeus.context_processors.theme', 'amadeus.context_processors.notifies', + 'amadeus.context_processors.mural_notifies', ], }, }, diff --git a/amadeus/static/css/base/amadeus.css b/amadeus/static/css/base/amadeus.css index 81846a1..1394306 100755 --- a/amadeus/static/css/base/amadeus.css +++ b/amadeus/static/css/base/amadeus.css @@ -1043,7 +1043,7 @@ li.item .notify_badge { padding: 10px 0px 8px 0px; } -.post .post-comment .user-img { +.post .post-comment .user-img div { display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */ display: -ms-flexbox; /* TWEENER - IE 10 */ diff --git a/amadeus/static/css/base/amadeus_responsive.css b/amadeus/static/css/base/amadeus_responsive.css index cab4b14..942bfec 100644 --- a/amadeus/static/css/base/amadeus_responsive.css +++ b/amadeus/static/css/base/amadeus_responsive.css @@ -1,8 +1,12 @@ @media(min-width: 1200px) { - .mural .post_make .user-img { + .mural .post_make .user-img, .post .post-img { height: 70px; } + .post .post-comment .user-img div { + height: 38px; + } + .mural .post_make .user-img img { max-width: 70px; max-height: 70px; @@ -18,10 +22,14 @@ padding: 15px; } - .mural .post_make .user-img { + .mural .post_make .user-img, .post .post-img { height: 65px; } + .post .post-comment .user-img div { + height: 38px; + } + .mural .post_make .user-img img { max-width: 65px; max-height: 65px; @@ -87,7 +95,7 @@ display:none; } - .mural .post_make .user-img { + .mural .post_make .user-img, .post .post-img { height: 60px; } @@ -161,7 +169,7 @@ } @media(max-width: 680px) { - .mural .post_make .user-img { + .mural .post_make .user-img, .post .post-img { height: 50px; } diff --git a/amadeus/static/css/themes/green.css b/amadeus/static/css/themes/green.css index 97ed386..f12223d 100644 --- a/amadeus/static/css/themes/green.css +++ b/amadeus/static/css/themes/green.css @@ -496,7 +496,7 @@ a.add-row { background: #FFFFFF; } -.mural .post_make .user-img { +.mural .post_make .user-img, .post .post-img, .post .post-comment .user-img div { background: #CCCCCC; } diff --git a/amadeus/static/js/socket.js b/amadeus/static/js/socket.js index 42f0f99..3b17f75 100644 --- a/amadeus/static/js/socket.js +++ b/amadeus/static/js/socket.js @@ -15,6 +15,22 @@ socket.onmessage = function(e) { $('.posts').prepend(content.complete); $('.no-subjects').attr('style', 'display:none'); + } else { + $('.mural_badge').each(function () { + var actual = $(this).text(); + + if (actual != "+99") { + actual = parseInt(actual, 10) + 1; + + if (actual > 99) { + actual = "+99"; + } + + $(this).text(actual); + } + + $(this).show(); + }); } if (("Notification" in window)) { diff --git a/amadeus/templates/base.html b/amadeus/templates/base.html index f2a65a4..4f1557e 100644 --- a/amadeus/templates/base.html +++ b/amadeus/templates/base.html @@ -190,9 +190,10 @@ -