mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	add delete button for notifications
This commit is contained in:
		| @@ -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 %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user