From f02ce614e72b2f90ecbbb52830dcb94cace64fe9 Mon Sep 17 00:00:00 2001 From: fbormann Date: Thu, 15 Sep 2016 00:04:35 -0300 Subject: [PATCH] Fixed notification icon and added context-processor fully functional now, error on login when using context-processor fixed #41 --- amadeus/settings.py | 4 ++-- core/context_processors.py | 9 ++++++--- core/static/css/base/header.css | 4 ++++ core/templates/base.html | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/amadeus/settings.py b/amadeus/settings.py index 6878198..b18cffe 100644 --- a/amadeus/settings.py +++ b/amadeus/settings.py @@ -94,8 +94,8 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'amadeus', - 'USER': 'amadeus_admin', - 'PASSWORD': 'amadeus', + 'USER': 'postgres', + 'PASSWORD': 'felipe', 'HOST': '127.0.0.1', 'PORT': '5432', } diff --git a/core/context_processors.py b/core/context_processors.py index d0f4aa6..cc8602f 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -1,6 +1,9 @@ from .models import Notification def notifications(request): - return { - 'notifications': Notifications.objects.filter(user= request.user, read=False).order_by('-datetime') - } \ No newline at end of file + if request.user.is_authenticated: + return { + 'notifications': Notification.objects.filter(user= request.user, read=False).order_by('-datetime') + } + else: + return request \ No newline at end of file diff --git a/core/static/css/base/header.css b/core/static/css/base/header.css index a7e2099..deb3afb 100644 --- a/core/static/css/base/header.css +++ b/core/static/css/base/header.css @@ -21,6 +21,10 @@ transform:scale(1.1); } +.notification-count{ + background-color: #cc0000; +} + /* ID */ .notifications{ diff --git a/core/templates/base.html b/core/templates/base.html index 56e7d32..02ecf17 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -53,7 +53,7 @@