diff --git a/users/__pycache__/signals.cpython-38.pyc b/users/__pycache__/signals.cpython-38.pyc index 67bc5a7..63ab878 100644 Binary files a/users/__pycache__/signals.cpython-38.pyc and b/users/__pycache__/signals.cpython-38.pyc differ diff --git a/users/signals.py b/users/signals.py index 0fddb1c..cfadaeb 100644 --- a/users/signals.py +++ b/users/signals.py @@ -111,5 +111,5 @@ def save_news(sender, instance, **kwargs): ) if(user.profile.news_push): - newnotification = UserNotification(touser=user, notificationtext="Neue Agenturnews: " + instance.name, notificationtype="agencynews") + newnotification = UserNotification(touser=user, notificationtext="Neue Agenturnews: " + instance.name, notificationtype="agencynews", elementid=instance.pk) newnotification.save() diff --git a/users/templates/users/base.html b/users/templates/users/base.html index baf8a9d..43d95d0 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -490,6 +490,8 @@ getDimensions(); */ newunknownotificationscounter = 0; + + function loadUnsendNotifications(){ $.ajax( { @@ -503,7 +505,7 @@ function loadUnsendNotifications(){ notifications = data['unknownnotification']; var i = 0; for (var key in notifications) { - $("#notification_items").append(''+notifications[i]['date']+''+notifications[i]['text']+'') + $("#notification_items").append(''+notifications[i]['date']+''+notifications[i]['text']+'') i = i + 1; newunknownotificationscounter = newunknownotificationscounter + 1; } @@ -530,7 +532,7 @@ function loadUnviewnNotifications(){ i = 0; for (var key in notifications) { if(newunknownotificationscounter <= 5){ - $("#notification_items").append(''+notifications[i]['date']+''+notifications[i]['text']+'') + $("#notification_items").append(''+notifications[i]['date']+''+notifications[i]['text']+'') i = i + 1; } } @@ -559,6 +561,7 @@ function removeNotification(notifyid){ } $(document).ready(function(){ + console.log(); $("#notification_items").html(""); loadUnsendNotifications(); loadUnviewnNotifications();