diff --git a/data/interfaces/default/edit_user.html b/data/interfaces/default/edit_user.html index 37aba8bb..0a266196 100644 --- a/data/interfaces/default/edit_user.html +++ b/data/interfaces/default/edit_user.html @@ -58,6 +58,12 @@ DOCUMENTATION :: END
Uncheck this if you do not want this keep any history on this user's activity.
+ % if data['user_id']: +DANGER ZONE! Click the purge button to remote all history logged for this user. This is permanent!
+Delete | Time | User | Platform | @@ -60,8 +63,21 @@ } } history_table = $('#history_table').DataTable(history_table_options); - var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: 'Select columns', buttonClass: 'btn btn-dark' }); + var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' }); $(colvis.button()).appendTo('div.colvis-button-bar'); + + $('#row-edit-mode').click(function() { + if ($(this).hasClass('active')) { + $('.delete-control').each(function() { + $(this).addClass('hidden'); + }); + } else { + $('.delete-control').each(function() { + $(this).removeClass('hidden'); + }); + } + }); + }); diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 79798f3f..bb4d4ca0 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -256,7 +256,7 @@ DOCUMENTATION :: END history_table = $('#history_table').DataTable(history_table_options); history_table.column(4).visible(false); - var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: 'Select columns', buttonClass: 'btn btn-dark' }); + var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' }); $(colvis.button()).appendTo('div.colvis-button-bar'); }); @@ -274,7 +274,7 @@ DOCUMENTATION :: END } } history_table = $('#history_table').DataTable(history_table_options); - var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: 'Select columns', buttonClass: 'btn btn-dark' }); + var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: ' Select columns', buttonClass: 'btn btn-dark' }); $(colvis.button()).appendTo('div.colvis-button-bar'); }); diff --git a/data/interfaces/default/js/tables/history_table.js b/data/interfaces/default/js/tables/history_table.js index 51df2ab9..e2aacc8a 100644 --- a/data/interfaces/default/js/tables/history_table.js +++ b/data/interfaces/default/js/tables/history_table.js @@ -25,10 +25,11 @@ history_table_options = { "processing": false, "serverSide": true, "pageLength": 25, - "order": [ 0, 'desc'], + "order": [ 1, 'desc'], + "autoWidth": false, "columnDefs": [ { - "targets": [0], + "targets": [1], "data":"date", "createdCell": function (td, cellData, rowData, row, col) { if (rowData['stopped'] === null) { @@ -41,7 +42,7 @@ history_table_options = { "className": "no-wrap" }, { - "targets": [1], + "targets": [2], "data":"friendly_name", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { @@ -57,7 +58,7 @@ history_table_options = { "className": "no-wrap hidden-xs" }, { - "targets": [2], + "targets": [3], "data":"player", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { @@ -67,7 +68,7 @@ history_table_options = { "className": "modal-control no-wrap hidden-sm hidden-xs" }, { - "targets": [3], + "targets": [4], "data":"ip_address", "createdCell": function (td, cellData, rowData, row, col) { if (cellData) { @@ -87,7 +88,7 @@ history_table_options = { "className": "no-wrap hidden-xs modal-control-ip" }, { - "targets": [4], + "targets": [5], "data":"full_title", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { @@ -106,7 +107,7 @@ history_table_options = { } }, { - "targets": [5], + "targets": [6], "data":"started", "createdCell": function (td, cellData, rowData, row, col) { if (cellData === null) { @@ -119,7 +120,7 @@ history_table_options = { "className": "no-wrap hidden-sm hidden-xs" }, { - "targets": [6], + "targets": [7], "data":"paused_counter", "render": function ( data, type, full ) { if (data !== null) { @@ -132,7 +133,7 @@ history_table_options = { "className": "no-wrap hidden-xs" }, { - "targets": [7], + "targets": [8], "data":"stopped", "createdCell": function (td, cellData, rowData, row, col) { if (cellData === null) { @@ -145,7 +146,7 @@ history_table_options = { "className": "no-wrap hidden-md hidden-xs" }, { - "targets": [8], + "targets": [9], "data":"duration", "render": function ( data, type, full ) { if (data !== null) { @@ -158,7 +159,7 @@ history_table_options = { "className": "no-wrap hidden-xs" }, { - "targets": [9], + "targets": [10], "data":"percent_complete", "render": function ( data, type, full ) { if (data > 80) { @@ -173,7 +174,17 @@ history_table_options = { "orderable": false, "className": "no-wrap hidden-md hidden-xs", "width": "10px" - } + }, + { + "targets": [0], + "data": null, + "createdCell": function (td, cellData, rowData, row, col) { + $(td).html(''); + }, + "className": "delete-control no-wrap hidden", + "searchable": false, + "orderable": false + }, ], "drawCallback": function (settings) { // Jump to top of page @@ -183,6 +194,11 @@ history_table_options = { $('.info-modal').each(function() { $(this).tooltip(); }); + if ($('#row-edit-mode').hasClass('active')) { + $('.delete-control').each(function() { + $(this).removeClass('hidden'); + }); + } }, "preDrawCallback": function(settings) { var msg = "
---|