diff --git a/pages.php b/pages.php index 2218f0b..a450419 100644 --- a/pages.php +++ b/pages.php @@ -43,7 +43,8 @@ define("PAGES", [ "navbar" => true, "icon" => "archive", "styles" => [ - "static/css/datatables.min.css" + "static/css/datatables.min.css", + "static/css/tables.css" ], "scripts" => [ "static/js/datatables.min.js", diff --git a/pages/categories.php b/pages/categories.php index db17fbf..cfacc25 100644 --- a/pages/categories.php +++ b/pages/categories.php @@ -1,5 +1,4 @@ - - + + + + @@ -25,12 +26,15 @@ redirectifnotloggedin(); 'catname' ]); foreach ($cats as $cat) { + $itemcount = $database->count('items', ['catid' => $cat['catid']]); ?> + + - - + + + + \ No newline at end of file diff --git a/static/js/categories.js b/static/js/categories.js index 62ce56a..41b66d7 100644 --- a/static/js/categories.js +++ b/static/js/categories.js @@ -3,13 +3,32 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ $('#cattable').DataTable({ + responsive: { + details: { + display: $.fn.dataTable.Responsive.display.modal({ + header: function (row) { + var data = row.data(); + return " " + data[2]; + } + }), + renderer: $.fn.dataTable.Responsive.renderer.tableAll({ + tableClass: 'table' + }), + type: "column" + } + }, columnDefs: [ { targets: 0, + className: 'control', + orderable: false + }, + { + targets: 1, orderable: false } ], order: [ - [1, 'asc'] + [2, 'asc'] ] }); \ No newline at end of file