mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add delete button for notifications
This commit is contained in:
parent
679647433a
commit
cefc4af861
@ -90,7 +90,8 @@ function loadNotificationTable(table, options={}) {
|
||||
{
|
||||
formatter: function(value, row, index, field) {
|
||||
var bRead = getReadEditButton(row.pk, row.read)
|
||||
var html = "<div class='btn-group float-right' role='group'>" + bRead + "</div>";
|
||||
var bDel = "<button title='{% trans "Delete Notification" %}' class='notification-delete btn btn-outline-secondary' type='button' pk='" + row.pk + "'><span class='fas fa-trash-alt icon-red'></span></button>";
|
||||
var html = "<div class='btn-group float-right' role='group'>" + bRead + bDel + "</div>";
|
||||
return html;
|
||||
}
|
||||
}
|
||||
@ -126,5 +127,15 @@ $("#history-refresh").on('click', function() {
|
||||
$("#history-table").bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
$("#history-table").on('click', '.notification-delete', function() {
|
||||
constructForm(`/api/notifications/${$(this).attr('pk')}/`, {
|
||||
method: 'DELETE',
|
||||
title: '{% trans "Delete Notification" %}',
|
||||
onSuccess: function(data) {
|
||||
updateNotificationTables();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
enableSidebar('notifications');
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user