95 lines
3.5 KiB
HTML
95 lines
3.5 KiB
HTML
{% extends "users/base.html" %}
|
|
{% block content %}
|
|
<div class="content-section col-5">
|
|
<h3>Alle Benachrichtigungen</h3>
|
|
<hr>
|
|
<button href="#" class="btn btn-primary mb-2" data-toggle="tooltip" data-placement="top" title="Alle Benachrichtigung löschen" onclick="javascript:delNotify(false)">Alle Benachrichtigungen löschen</button>
|
|
{% for notification in usernotifications %}
|
|
|
|
<div class="card mb-2 notifydelclass" id="notify_{{notification.pk}}">
|
|
<div class="card-body">
|
|
<button href="#" class="btn btn-secondary btn-sm" style="float: right;" onclick="javascript:delNotify({{notification.pk}})"><i class="fas fa-trash"></i></button>
|
|
<p class="card-text">
|
|
{% if notification.notificationtype == "agencynews" %}
|
|
<a href="/news/news/{{notification.elementid}}/single" class="" style="text-decoration: none; color: #000000">
|
|
{{notification.notificationtext}}
|
|
</a><br />
|
|
{% elif notification.notificationtype == "newstandard" %}
|
|
<a href="/standards/standard/{{notification.elementid}}/single" class="" style="text-decoration: none; color: #000000">
|
|
{{notification.notificationtext}}
|
|
</a><br />
|
|
{% elif notification.notificationtype == "messagereceived" %}
|
|
<a href="/messages/sl/{{notification.elementid}}" class="" style="text-decoration: none; color: #000000">
|
|
{{notification.notificationtext}}
|
|
</a><br />
|
|
{% else %}
|
|
{{notification.notificationtext}}<br />
|
|
{% endif %}
|
|
<small>Am {{notification.created}}</small>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<!-- CONFIRMA DELETE ALL NOTIFICATIONS -->
|
|
<div class="modal fade" id="delAllNotifictaions" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="agencyDelFunction" aria-hidden="true">
|
|
<div class="modal-dialog " role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="exampleModalLongTitle">Alle Benachrichtigungen löschen</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
Möchten Sie alle Benachrichtigungen löschen?
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="javascript:doDelAllNotifications()">Alle Benachrichtigungen löschen</button>
|
|
<button type="button" class="btn" data-dismiss="modal">Abbrechen</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var todelnotifyid = false;
|
|
function delNotify(notifydelid){
|
|
todelnotifyid = notifydelid;
|
|
if(!notifydelid){
|
|
$("#delAllNotifictaions").modal("toggle");
|
|
}
|
|
else{
|
|
$.ajax(
|
|
{
|
|
type: "GET",
|
|
url: "/notifications/delsingle",
|
|
data : {
|
|
action : "delsingle",
|
|
todelid : notifydelid
|
|
},
|
|
success: function( data )
|
|
{
|
|
$("#notify_" + todelnotifyid).remove();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function doDelAllNotifications(){
|
|
$.ajax(
|
|
{
|
|
type: "GET",
|
|
url: "/notifications/delall",
|
|
data : {
|
|
action : "delall"
|
|
},
|
|
success: function( data )
|
|
{
|
|
$(".notifydelclass").remove();
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
{% endblock content %} |