Commit b156bc271519fbbec685d6a354cf6c767c511f3d

Authored by fbormann
1 parent d66af035

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
... ... @@ -18,10 +18,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin):
18 18 context_object_name = 'objects'
19 19 paginate_by = 10
20 20  
21   - action_name = "Acessar"
22   - resource_name = "home"
23   - users = User.objects.all()
24   - message="testing login and notification broadcast"
  21 +
25 22  
26 23 def get_queryset(self):
27 24 if self.request.user.is_staff:
... ... @@ -45,7 +42,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin):
45 42 else:
46 43 self.template_name = "home_teacher_student_content.html"
47 44  
48   - super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/login")
  45 + #super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/")
49 46 return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs)
50 47  
51 48  
... ...
core/mixins.py
... ... @@ -44,9 +44,9 @@ class NotificationMixin(object):
44 44 action_name = ''
45 45 resource_name = ''
46 46  
47   - def createNotification(self, message='', actor=None, users = User.objects.all(), action_name = '', resource_name='', resource_link=''): #the default will be a broadcast
  47 + def createNotification(self, message='', actor=None, users = User.objects.all(), resource_slug='' ,action_name = '', resource_name='', resource_link=''): #the default will be a broadcast
48 48 action = Action.objects.filter(name = action_name)
49   - resource = Resource.objects.filter(name = resource_name)
  49 + resource = Resource.objects.filter(slug = resource_slug)
50 50 print(message)
51 51 if action.exists():
52 52 action = action[0]
... ...
core/static/css/base/amadeus.css
  1 +/* HEADER */
  2 +#notificationscroll{
  3 + max-height: 500%;
  4 + overflow: auto;
  5 +}
  6 +
  7 +/* HEADER */
  8 +
  9 +
1 10 .logoLogin{
2 11 padding-bottom: 1%;
3 12 width: 15%;
... ...
core/templates/base.html
... ... @@ -54,7 +54,7 @@
54 54 <ul class="nav navbar-nav navbar-right notifications">
55 55 <li class="" data-toggle="tooltip" data-placement="bottom" title data-original-title="notifications">
56 56 <a class="dropdown-toggle" data-toggle="dropdown"> <span class="badge notification-count">{{notifications.count}}</span><i class="fa fa-bell-o" aria-hidden="true"></i></a>
57   - <ul class="dropdown-menu">
  57 + <ul id="notification-dropdown" class="dropdown-menu">
58 58 <li class="dropdown-header">Notifications</li>
59 59 {% for notification in notifications %}
60 60 {% if notification.actor %} <!-- if the notification has a user-->
... ...
core/views.py
... ... @@ -93,7 +93,6 @@ def processNotification(self, notificationId):
93 93 notification = Notification.objects.get(id= notificationId)
94 94 notification.read = True
95 95 notification.save()
96   - print(notification.action_resource)
97 96 return redirect(notification.action_resource.resource.url)
98 97  
99 98 # class LoginClass(LoginView):
... ...