Benachrichtigungen noch verlinkt und Default-Link auf Benachrichtigungen gesetzt
This commit is contained in:
parent
1ba4da5b89
commit
71771d3183
Binary file not shown.
|
|
@ -111,5 +111,5 @@ def save_news(sender, instance, **kwargs):
|
||||||
)
|
)
|
||||||
|
|
||||||
if(user.profile.news_push):
|
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()
|
newnotification.save()
|
||||||
|
|
|
||||||
|
|
@ -490,6 +490,8 @@ getDimensions();
|
||||||
*/
|
*/
|
||||||
newunknownotificationscounter = 0;
|
newunknownotificationscounter = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function loadUnsendNotifications(){
|
function loadUnsendNotifications(){
|
||||||
$.ajax(
|
$.ajax(
|
||||||
{
|
{
|
||||||
|
|
@ -503,7 +505,7 @@ function loadUnsendNotifications(){
|
||||||
notifications = data['unknownnotification'];
|
notifications = data['unknownnotification'];
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for (var key in notifications) {
|
for (var key in notifications) {
|
||||||
$("#notification_items").append('<a id="notifyid_'+notifications[i]['not_id']+'" class="dropdown-item d-flex align-items-center" onclick="removeNotification('+notifications[i]['not_id']+')"><div><div class="small text-gray-500">'+notifications[i]['date']+'</div>'+notifications[i]['text']+'</div></a>')
|
$("#notification_items").append('<a href="/'+notifications[i]['elelink']+'" id="notifyid_'+notifications[i]['not_id']+'" class="dropdown-item d-flex align-items-center"><div><div class="small text-gray-500">'+notifications[i]['date']+'</div>'+notifications[i]['text']+'</div></a>')
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
newunknownotificationscounter = newunknownotificationscounter + 1;
|
newunknownotificationscounter = newunknownotificationscounter + 1;
|
||||||
}
|
}
|
||||||
|
|
@ -530,7 +532,7 @@ function loadUnviewnNotifications(){
|
||||||
i = 0;
|
i = 0;
|
||||||
for (var key in notifications) {
|
for (var key in notifications) {
|
||||||
if(newunknownotificationscounter <= 5){
|
if(newunknownotificationscounter <= 5){
|
||||||
$("#notification_items").append('<a id="notifyid_'+notifications[i]['not_id']+'" class="dropdown-item d-flex align-items-center" onclick="removeNotification('+notifications[i]['not_id']+')"><div><div class="small text-gray-500">'+notifications[i]['date']+'</div>'+notifications[i]['text']+'</div></a>')
|
$("#notification_items").append('<a href="/'+notifications[i]['elelink']+'" id="notifyid_'+notifications[i]['not_id']+'" class="dropdown-item d-flex align-items-center"><div><div class="small text-gray-500">'+notifications[i]['date']+'</div>'+notifications[i]['text']+'</div></a>')
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -559,6 +561,7 @@ function removeNotification(notifyid){
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
console.log();
|
||||||
$("#notification_items").html("");
|
$("#notification_items").html("");
|
||||||
loadUnsendNotifications();
|
loadUnsendNotifications();
|
||||||
loadUnviewnNotifications();
|
loadUnviewnNotifications();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue