From b156bc271519fbbec685d6a354cf6c767c511f3d Mon Sep 17 00:00:00 2001 From: fbormann Date: Tue, 20 Sep 2016 11:54:38 -0300 Subject: [PATCH] review #53, scroll of notifiation is done, I'll create another issue to work on how to make the ajax calls work, in parallel, I'm working the notifications decorators, which are not working properly --- app/views.py | 7 ++----- core/mixins.py | 4 ++-- core/static/css/base/amadeus.css | 9 +++++++++ core/templates/base.html | 2 +- core/views.py | 1 - 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/views.py b/app/views.py index 2d76967..90ce690 100644 --- a/app/views.py +++ b/app/views.py @@ -18,10 +18,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): context_object_name = 'objects' paginate_by = 10 - action_name = "Acessar" - resource_name = "home" - users = User.objects.all() - message="testing login and notification broadcast" + def get_queryset(self): if self.request.user.is_staff: @@ -45,7 +42,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): else: self.template_name = "home_teacher_student_content.html" - super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/login") + #super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/") return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs) diff --git a/core/mixins.py b/core/mixins.py index 162da2f..d2bde1b 100644 --- a/core/mixins.py +++ b/core/mixins.py @@ -44,9 +44,9 @@ class NotificationMixin(object): action_name = '' resource_name = '' - def createNotification(self, message='', actor=None, users = User.objects.all(), action_name = '', resource_name='', resource_link=''): #the default will be a broadcast + def createNotification(self, message='', actor=None, users = User.objects.all(), resource_slug='' ,action_name = '', resource_name='', resource_link=''): #the default will be a broadcast action = Action.objects.filter(name = action_name) - resource = Resource.objects.filter(name = resource_name) + resource = Resource.objects.filter(slug = resource_slug) print(message) if action.exists(): action = action[0] diff --git a/core/static/css/base/amadeus.css b/core/static/css/base/amadeus.css index 9a17ec8..ec0a9ca 100644 --- a/core/static/css/base/amadeus.css +++ b/core/static/css/base/amadeus.css @@ -1,3 +1,12 @@ +/* HEADER */ +#notificationscroll{ + max-height: 500%; + overflow: auto; +} + +/* HEADER */ + + .logoLogin{ padding-bottom: 1%; width: 15%; diff --git a/core/templates/base.html b/core/templates/base.html index 25a9dae..1e46c08 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -54,7 +54,7 @@