mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
show delete button only selective
This commit is contained in:
parent
cefc4af861
commit
a653f322b3
@ -29,7 +29,7 @@ function updateNotificationTables() {
|
||||
// this allows the global notification panel to update the tables
|
||||
window.updateNotifications = updateNotificationTables
|
||||
|
||||
function loadNotificationTable(table, options={}) {
|
||||
function loadNotificationTable(table, options={}, enableDelete=false) {
|
||||
|
||||
var params = options.params || {};
|
||||
var read = typeof(params.read) === 'undefined' ? true : params.read;
|
||||
@ -90,7 +90,11 @@ function loadNotificationTable(table, options={}) {
|
||||
{
|
||||
formatter: function(value, row, index, field) {
|
||||
var bRead = getReadEditButton(row.pk, row.read)
|
||||
if (enableDelete) {
|
||||
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>";
|
||||
} else {
|
||||
var bDel = '';
|
||||
}
|
||||
var html = "<div class='btn-group float-right' role='group'>" + bRead + bDel + "</div>";
|
||||
return html;
|
||||
}
|
||||
@ -121,7 +125,7 @@ loadNotificationTable("#history-table", {
|
||||
name: 'history',
|
||||
url: '{% url 'api-notifications-list' %}',
|
||||
no_matches: function() { return '{% trans "No notification history found" %}'; },
|
||||
});
|
||||
}, true);
|
||||
|
||||
$("#history-refresh").on('click', function() {
|
||||
$("#history-table").bootstrapTable('refresh');
|
||||
|
Loading…
Reference in New Issue
Block a user