diff --git a/package.json b/package.json index 064a39ba..1f67042e 100644 --- a/package.json +++ b/package.json @@ -11,17 +11,16 @@ "bootstrap": "^4.5.2", "bootstrap-select": "^1.13.18", "chart.js": "^2.8.0", - "datatables.net": "^1.10.21", - "datatables.net-bs4": "^1.10.21", - "datatables.net-colreorder": "^1.5.1", - "datatables.net-colreorder-bs4": "^1.5.1", + "datatables.net": "^1.10.22", + "datatables.net-bs4": "^1.10.22", + "datatables.net-colreorder": "^1.5.2", + "datatables.net-colreorder-bs4": "^1.5.2", "datatables.net-plugins": "^1.10.20", - "datatables.net-responsive": "^2.2.5", - "datatables.net-responsive-bs4": "^2.2.5", "datatables.net-rowgroup": "^1.1.2", "datatables.net-rowgroup-bs4": "^1.1.2", - "datatables.net-select": "^1.3.0", - "datatables.net-select-bs4": "^1.3.0", + "datatables.net-select": "^1.3.1", + "datatables.net-select-bs4": "^1.3.1", + "dragscroll": "^0.0.8", "fullcalendar": "^3.10.1", "gettext-translator": "2.1.0", "jquery": "3.5.1", diff --git a/public/css/grocy.css b/public/css/grocy.css old mode 100644 new mode 100755 index bd9fae7e..adc4c228 --- a/public/css/grocy.css +++ b/public/css/grocy.css @@ -337,8 +337,12 @@ input::-webkit-inner-spin-button { display: none; } -.dataTables_scrollBody { - overflow: visible !important; +.grab-cursor { + cursor: grab; +} + +.grab-cursor:active { + cursor: grabbing; } /* Third party component customizations - toastr */ @@ -396,6 +400,12 @@ input::-webkit-inner-spin-button { } } +@media (max-width: 767.98px) { + .width-xs-sm-100 { + width: 100%; + } +} + body.fixed-nav { padding-top: 54px; } diff --git a/public/js/grocy.js b/public/js/grocy.js index a7b2019b..065b3f4c 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -650,6 +650,7 @@ $.extend(true, $.fn.dataTable.defaults, { 'deferRender': true, 'language': IsJsonString(__t('datatables_localization')) ? JSON.parse(__t('datatables_localization')) : {}, 'scrollY': false, + 'scrollX': true, 'colReorder': true, 'stateSave': true, 'stateSaveParams': function(settings, data) diff --git a/public/viewjs/batteries.js b/public/viewjs/batteries.js index 0829ebe4..18fc7891 100644 --- a/public/viewjs/batteries.js +++ b/public/viewjs/batteries.js @@ -7,6 +7,8 @@ }); $('#batteries-table tbody').removeClass("d-none"); batteriesTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() batteriesTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + batteriesTable.search("").draw(); +}); + $(document).on('click', '.battery-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-battery-name'); diff --git a/public/viewjs/batteriesjournal.js b/public/viewjs/batteriesjournal.js index 682f0bce..d8fc147c 100644 --- a/public/viewjs/batteriesjournal.js +++ b/public/viewjs/batteriesjournal.js @@ -8,6 +8,8 @@ }); $('#batteries-journal-table tbody').removeClass("d-none"); batteriesJournalTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#battery-filter").on("change", function() { @@ -32,6 +34,14 @@ $("#search").on("keyup", Delay(function() batteriesJournalTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#battery-filter").val("all"); + batteriesJournalTable.column(1).search("").draw(); + batteriesJournalTable.search("").draw(); +}); + if (typeof GetUriParam("battery") !== "undefined") { $("#battery-filter").val(GetUriParam("battery")); diff --git a/public/viewjs/batteriesoverview.js b/public/viewjs/batteriesoverview.js index 49a4869a..65108df0 100644 --- a/public/viewjs/batteriesoverview.js +++ b/public/viewjs/batteriesoverview.js @@ -7,6 +7,8 @@ }); $('#batteries-overview-table tbody').removeClass("d-none"); batteriesOverviewTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,14 @@ $("#search").on("keyup", Delay(function() batteriesOverviewTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#status-filter").val("all"); + batteriesOverviewTable.column(4).search("").draw(); + batteriesOverviewTable.search("").draw(); +}); + $("#status-filter").on("change", function() { var value = $(this).val(); @@ -135,8 +145,8 @@ function RefreshStatistics() } }); - $("#info-due-batteries").text(__n(dueCount, '%s battery is due to be charged', '%s batteries are due to be charged') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days')); - $("#info-overdue-batteries").text(__n(overdueCount, '%s battery is overdue to be charged', '%s batteries are overdue to be charged')); + $("#info-due-batteries").html('' + dueCount + ' ' + __n(dueCount, '%s battery is due to be charged', '%s batteries are due to be charged') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days')); + $("#info-overdue-batteries").html('' + overdueCount + ' ' + __n(overdueCount, '%s battery is overdue to be charged', '%s batteries are overdue to be charged')); }, function(xhr) { diff --git a/public/viewjs/chores.js b/public/viewjs/chores.js index 7d3ca85a..c4a145e5 100644 --- a/public/viewjs/chores.js +++ b/public/viewjs/chores.js @@ -7,6 +7,8 @@ }); $('#chores-table tbody').removeClass("d-none"); choresTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() choresTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + choresTable.search("").draw(); +}); + $(document).on('click', '.chore-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-chore-name'); diff --git a/public/viewjs/choresjournal.js b/public/viewjs/choresjournal.js index bfa48add..e4b1d398 100644 --- a/public/viewjs/choresjournal.js +++ b/public/viewjs/choresjournal.js @@ -8,6 +8,8 @@ }); $('#chores-journal-table tbody').removeClass("d-none"); choresJournalTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#chore-filter").on("change", function() { @@ -32,6 +34,14 @@ $("#search").on("keyup", Delay(function() choresJournalTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#chore-filter").val("all"); + choresJournalTable.column(1).search("").draw(); + choresJournalTable.search("").draw(); +}); + if (typeof GetUriParam("chore") !== "undefined") { $("#chore-filter").val(GetUriParam("chore")); diff --git a/public/viewjs/choresoverview.js b/public/viewjs/choresoverview.js index 1a3d33f5..ce2f5153 100644 --- a/public/viewjs/choresoverview.js +++ b/public/viewjs/choresoverview.js @@ -7,6 +7,8 @@ }); $('#chores-overview-table tbody').removeClass("d-none"); choresOverviewTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -52,6 +54,16 @@ $("#user-filter").on("change", function() } }); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#status-filter").val("all"); + $("#user-filter").val("all"); + choresOverviewTable.column(5).search("").draw(); + choresOverviewTable.column(6).search("").draw(); + choresOverviewTable.search("").draw(); +}); + $(".status-filter-message").on("click", function() { var value = $(this).data("status-filter"); @@ -200,9 +212,9 @@ function RefreshStatistics() } }); - $("#info-due-chores").text(__n(dueCount, '%s chore is due to be done', '%s chores are due to be done') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days')); - $("#info-overdue-chores").text(__n(overdueCount, '%s chore is overdue to be done', '%s chores are overdue to be done')); - $("#info-assigned-to-me-chores").text(__n(assignedToMeCount, '%s chore is assigned to me', '%s chores are assigned to me')); + $("#info-due-chores").html('' + dueCount + ' ' + __n(dueCount, '%s chore is due to be done', '%s chores are due to be done') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days')); + $("#info-overdue-chores").html('' + overdueCount + ' ' + __n(overdueCount, '%s chore is overdue to be done', '%s chores are overdue to be done')); + $("#info-assigned-to-me-chores").html('' + assignedToMeCount + ' ' + __n(assignedToMeCount, '%s chore is assigned to me', '%s chores are assigned to me')); }, function(xhr) { diff --git a/public/viewjs/equipment.js b/public/viewjs/equipment.js index 0bdb87e5..616152cf 100644 --- a/public/viewjs/equipment.js +++ b/public/viewjs/equipment.js @@ -9,6 +9,8 @@ }); $('#equipment-table tbody').removeClass("d-none"); equipmentTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); equipmentTable.on('select', function(e, dt, type, indexes) { @@ -66,6 +68,12 @@ $("#search").on("keyup", Delay(function() equipmentTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + equipmentTable.search("").draw(); +}); + $(document).on('click', '.equipment-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-equipment-name'); diff --git a/public/viewjs/locations.js b/public/viewjs/locations.js index 28947d3a..27c2db5a 100644 --- a/public/viewjs/locations.js +++ b/public/viewjs/locations.js @@ -7,6 +7,8 @@ }); $('#locations-table tbody').removeClass("d-none"); locationsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() locationsTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + locationsTable.search("").draw(); +}); + $(document).on('click', '.location-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-location-name'); diff --git a/public/viewjs/manageapikeys.js b/public/viewjs/manageapikeys.js index b274fe1c..c82f650f 100644 --- a/public/viewjs/manageapikeys.js +++ b/public/viewjs/manageapikeys.js @@ -7,6 +7,8 @@ }); $('#apikeys-table tbody').removeClass("d-none"); apiKeysTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); var createdApiKeyId = GetUriParam('CreatedApiKeyId'); if (createdApiKeyId !== undefined) @@ -25,6 +27,12 @@ $("#search").on("keyup", Delay(function() apiKeysTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + apiKeysTable.search("").draw(); +}); + $(document).on('click', '.apikey-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-apikey-apikey'); diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index 0bdf24f3..bdf400c5 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -402,6 +402,8 @@ var barcodeTable = $('#barcode-table').DataTable({ }); $('#barcode-table tbody').removeClass("d-none"); barcodeTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); Grocy.Components.UserfieldsForm.Load(); $("#name").trigger("keyup"); diff --git a/public/viewjs/productgroups.js b/public/viewjs/productgroups.js index af64c63d..8c818e63 100644 --- a/public/viewjs/productgroups.js +++ b/public/viewjs/productgroups.js @@ -7,6 +7,8 @@ }); $('#productgroups-table tbody').removeClass("d-none"); groupsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() groupsTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + groupsTable.search("").draw(); +}); + $(document).on('click', '.product-group-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-group-name'); diff --git a/public/viewjs/products.js b/public/viewjs/products.js index 5934c4b0..c6606aa7 100644 --- a/public/viewjs/products.js +++ b/public/viewjs/products.js @@ -7,6 +7,8 @@ }); $('#products-table tbody').removeClass("d-none"); productsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -30,6 +32,14 @@ $("#product-group-filter").on("change", function() productsTable.column(7).search(value).draw(); }); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#product-group-filter").val("all"); + productsTable.column(7).search("").draw(); + productsTable.search("").draw(); +}); + if (typeof GetUriParam("product-group") !== "undefined") { $("#product-group-filter").val(GetUriParam("product-group")); diff --git a/public/viewjs/quantityunitform.js b/public/viewjs/quantityunitform.js index 93afb585..ce52c788 100644 --- a/public/viewjs/quantityunitform.js +++ b/public/viewjs/quantityunitform.js @@ -122,6 +122,8 @@ var quConversionsTable = $('#qu-conversions-table').DataTable({ }); $('#qu-conversions-table tbody').removeClass("d-none"); quConversionsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); Grocy.Components.UserfieldsForm.Load(); $("#name").trigger("keyup"); diff --git a/public/viewjs/quantityunits.js b/public/viewjs/quantityunits.js index 9d5766a1..dbd9c3c8 100644 --- a/public/viewjs/quantityunits.js +++ b/public/viewjs/quantityunits.js @@ -7,6 +7,8 @@ }); $('#quantityunits-table tbody').removeClass("d-none"); quantityUnitsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() quantityUnitsTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + equipmentTable.search("").draw(); +}); + $(document).on('click', '.quantityunit-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-quantityunit-name'); diff --git a/public/viewjs/recipeform.js b/public/viewjs/recipeform.js index 07b418ea..16eedc45 100644 --- a/public/viewjs/recipeform.js +++ b/public/viewjs/recipeform.js @@ -97,6 +97,8 @@ var recipesIncludesTables = $('#recipes-includes-table').DataTable({ }); $('#recipes-includes-table tbody').removeClass("d-none"); recipesIncludesTables.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); Grocy.FrontendHelpers.ValidateForm('recipe-form'); $("#name").focus(); diff --git a/public/viewjs/recipes.js b/public/viewjs/recipes.js index 1e4d835b..6167773d 100644 --- a/public/viewjs/recipes.js +++ b/public/viewjs/recipes.js @@ -16,6 +16,8 @@ }); $('#recipes-table tbody').removeClass("d-none"); recipesTables.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); if ((typeof GetUriParam("tab") !== "undefined" && GetUriParam("tab") === "gallery") || window.localStorage.getItem("recipes_last_tab_id") == "gallery-tab") { @@ -66,6 +68,14 @@ $("#search").on("keyup", Delay(function() $(".recipe-gallery-item .card-title:not(:contains_case_insensitive(" + value + "))").parent().parent().parent().addClass("d-none"); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#status-filter").val("all"); + $("#search").trigger("keyup"); + $("#status-filter").trigger("change"); +}); + $("#status-filter").on("change", function() { var value = $(this).val(); diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index fe020075..947954a2 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -29,6 +29,8 @@ var shoppingListTable = $('#shoppinglist-table').DataTable({ }); $('#shoppinglist-table tbody').removeClass("d-none"); shoppingListTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $(document).on("click", "tr.dtrg-group", function() { @@ -48,6 +50,14 @@ $("#search").on("keyup", Delay(function() shoppingListTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#status-filter").val("all"); + $("#search").trigger("keyup"); + $("#status-filter").trigger("change"); +}); + $("#status-filter").on("change", function() { var value = $(this).val(); diff --git a/public/viewjs/shoppinglocations.js b/public/viewjs/shoppinglocations.js index 5843ba00..29202714 100644 --- a/public/viewjs/shoppinglocations.js +++ b/public/viewjs/shoppinglocations.js @@ -7,6 +7,8 @@ var locationsTable = $('#shoppinglocations-table').DataTable({ }); $('#shoppinglocations-table tbody').removeClass("d-none"); locationsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() locationsTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + locationsTable.search("").draw(); +}); + $(document).on('click', '.shoppinglocation-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-shoppinglocation-name'); diff --git a/public/viewjs/stockjournal.js b/public/viewjs/stockjournal.js index 0fba3da0..f3615892 100644 --- a/public/viewjs/stockjournal.js +++ b/public/viewjs/stockjournal.js @@ -8,6 +8,8 @@ }); $('#stock-journal-table tbody').removeClass("d-none"); stockJournalTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#product-filter").on("change", function() { @@ -32,6 +34,12 @@ $("#search").on("keyup", Delay(function() stockJournalTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + stockJournalTable.search("").draw(); +}); + if (typeof GetUriParam("product") !== "undefined") { $("#product-filter").val(GetUriParam("product")); diff --git a/public/viewjs/stockjournalsummary.js b/public/viewjs/stockjournalsummary.js index 1fae9a18..369d286e 100644 --- a/public/viewjs/stockjournalsummary.js +++ b/public/viewjs/stockjournalsummary.js @@ -4,3 +4,5 @@ var journalSummaryTable = $('#journal-summary-table').DataTable({ }); $('#journal-summary-table tbody').removeClass("d-none"); journalSummaryTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); diff --git a/public/viewjs/stockoverview.js b/public/viewjs/stockoverview.js old mode 100644 new mode 100755 index a864ff63..be9690b1 --- a/public/viewjs/stockoverview.js +++ b/public/viewjs/stockoverview.js @@ -10,8 +10,25 @@ { 'visible': false, 'targets': 8 } ], }); + +$('#stock-overview-table').on('column-sizing.dt', function(e, settings) +{ + var dtScrollWidth = $('.dataTables_scroll').width(); + var stockTableWidth = $('#stock-overview-table').width(); + + if (dtScrollWidth < stockTableWidth) + { + $('.dataTables_scrollBody').addClass("grab-cursor"); + } else + { + $('.dataTables_scrollBody').removeClass("grab-cursor"); + } +}); + $('#stock-overview-table tbody').removeClass("d-none"); stockOverviewTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#location-filter").on("change", function() { @@ -229,9 +246,9 @@ function RefreshStatistics() Grocy.Api.Get('stock/volatile?expiring_days=' + nextXDays, function(result) { - $("#info-expiring-products").text(__n(result.expiring_products.length, '%s product expires', '%s products expiring') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days')); - $("#info-expired-products").text(__n(result.expired_products.length, '%s product is already expired', '%s products are already expired')); - $("#info-missing-products").text(__n(result.missing_products.length, '%s product is below defined min. stock amount', '%s products are below defined min. stock amount')); + $("#info-expiring-products").html('' + result.expiring_products.length + ' ' + __n(result.expiring_products.length, '%s product expires', '%s products expiring') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days') + ''); + $("#info-expired-products").html('' + result.expired_products.length + ' ' + __n(result.expired_products.length, '%s product is already expired', '%s products are already expired') + ''); + $("#info-missing-products").html('' + result.missing_products.length + ' ' + __n(result.missing_products.length, '%s product is below defined min. stock amount', '%s products are below defined min. stock amount') + ''); }, function(xhr) { diff --git a/public/viewjs/taskcategories.js b/public/viewjs/taskcategories.js index d3953b43..92806f72 100644 --- a/public/viewjs/taskcategories.js +++ b/public/viewjs/taskcategories.js @@ -7,6 +7,8 @@ }); $('#taskcategories-table tbody').removeClass("d-none"); categoriesTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() categoriesTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + categoriesTable.search("").draw(); +}); + $(document).on('click', '.task-category-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-category-name'); diff --git a/public/viewjs/tasks.js b/public/viewjs/tasks.js index 7e93c03d..bd635f42 100644 --- a/public/viewjs/tasks.js +++ b/public/viewjs/tasks.js @@ -11,6 +11,8 @@ }); $('#tasks-table tbody').removeClass("d-none"); tasksTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -37,6 +39,15 @@ $("#status-filter").on("change", function() tasksTable.column(5).search(value).draw(); }); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#status-filter").val("all"); + $("#search").trigger("keyup"); + $("#status-filter").trigger("change"); + $("#show-done-tasks").trigger('checked', false); +}); + $(".status-filter-message").on("click", function() { var value = $(this).data("status-filter"); @@ -198,8 +209,8 @@ function RefreshStatistics() } }); - $("#info-due-tasks").text(__n(dueCount, '%s task is due to be done', '%s tasks are due to be done') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days')); - $("#info-overdue-tasks").text(__n(overdueCount, '%s task is overdue to be done', '%s tasks are overdue to be done')); + $("#info-due-tasks").html('' + dueCount + ' ' + __n(dueCount, '%s task is due to be done', '%s tasks are due to be done') + ' ' + __n(nextXDays, 'within the next day', 'within the next %s days')); + $("#info-overdue-tasks").html('' + overdueCount + ' ' + __n(overdueCount, '%s task is overdue to be done', '%s tasks are overdue to be done')); }, function(xhr) { diff --git a/public/viewjs/userentities.js b/public/viewjs/userentities.js index 74bbaf98..bcdbe503 100644 --- a/public/viewjs/userentities.js +++ b/public/viewjs/userentities.js @@ -7,6 +7,8 @@ }); $('#userentities-table tbody').removeClass("d-none"); userentitiesTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() userentitiesTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + userentitiesTable.search("").draw(); +}); + $(document).on('click', '.userentity-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-userentity-name'); diff --git a/public/viewjs/userfields.js b/public/viewjs/userfields.js index 5d5c2711..c15ba679 100644 --- a/public/viewjs/userfields.js +++ b/public/viewjs/userfields.js @@ -7,6 +7,8 @@ }); $('#userfields-table tbody').removeClass("d-none"); userfieldsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -31,6 +33,14 @@ $("#entity-filter").on("change", function() $("#new-userfield-button").attr("href", U("/userfield/new?entity=" + value)); }); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + $("#entity-filter").val("all"); + userfieldsTable.column(1).search("").draw(); + userfieldsTable.search("").draw(); +}); + $(document).on('click', '.userfield-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-userfield-name'); diff --git a/public/viewjs/userobjects.js b/public/viewjs/userobjects.js index 5a0f92e8..f13a49f6 100644 --- a/public/viewjs/userobjects.js +++ b/public/viewjs/userobjects.js @@ -7,6 +7,8 @@ }); $('#userobjects-table tbody').removeClass("d-none"); userobjectsTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() userobjectsTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + userobjectsTable.search("").draw(); +}); + $(document).on('click', '.userobject-delete-button', function(e) { var objectId = $(e.currentTarget).attr('data-userobject-id'); diff --git a/public/viewjs/users.js b/public/viewjs/users.js index d0d4c675..a00dae93 100644 --- a/public/viewjs/users.js +++ b/public/viewjs/users.js @@ -7,6 +7,8 @@ }); $('#users-table tbody').removeClass("d-none"); usersTable.columns.adjust().draw(); +$('.dataTables_scrollBody').addClass("dragscroll"); +dragscroll.reset(); $("#search").on("keyup", Delay(function() { @@ -19,6 +21,12 @@ $("#search").on("keyup", Delay(function() usersTable.search(value).draw(); }, 200)); +$("#clear-filter-button").on("click", function() +{ + $("#search").val(""); + usersTable.search("").draw(); +}); + $(document).on('click', '.user-delete-button', function(e) { var objectName = $(e.currentTarget).attr('data-user-username'); diff --git a/views/batteries.blade.php b/views/batteries.blade.php index 4cdbc2aa..71fde193 100644 --- a/views/batteries.blade.php +++ b/views/batteries.blade.php @@ -9,12 +9,27 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - {{ $__t('Configure userfields') }} @@ -25,7 +40,8 @@ - + @@ -37,12 +53,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/batteriesjournal.blade.php b/views/batteriesjournal.blade.php index da4e0ff8..8c31b170 100644 --- a/views/batteriesjournal.blade.php +++ b/views/batteriesjournal.blade.php @@ -8,12 +8,21 @@ @yield('title') + + + + + - + @@ -39,12 +48,21 @@ + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/batteriesoverview.blade.php b/views/batteriesoverview.blade.php index c30d79eb..49481b2c 100644 --- a/views/batteriesoverview.blade.php +++ b/views/batteriesoverview.blade.php @@ -14,8 +14,15 @@ @yield('title') - - + + + + {{ $__t('Journal') }} @@ -29,11 +36,25 @@ + + + + + + {{ $__t('Clear filter') }} + + - + @@ -63,7 +84,7 @@ + class="table table-sm table-striped nowrap w-100"> diff --git a/views/calendar.blade.php b/views/calendar.blade.php index d85456cc..afcffdaf 100644 --- a/views/calendar.blade.php +++ b/views/calendar.blade.php @@ -20,7 +20,14 @@ @yield('title') - + + + + diff --git a/views/chores.blade.php b/views/chores.blade.php index 368ac02f..e553eca9 100644 --- a/views/chores.blade.php +++ b/views/chores.blade.php @@ -9,12 +9,27 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - {{ $__t('Configure userfields') }} @@ -25,7 +40,8 @@ - + @@ -37,12 +53,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/choresjournal.blade.php b/views/choresjournal.blade.php index 917194c7..5dc2017d 100644 --- a/views/choresjournal.blade.php +++ b/views/choresjournal.blade.php @@ -8,12 +8,21 @@ @yield('title') + + + + + - + @@ -39,12 +48,21 @@ + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/choresoverview.blade.php b/views/choresoverview.blade.php index 6978c309..59f9c8d2 100644 --- a/views/choresoverview.blade.php +++ b/views/choresoverview.blade.php @@ -14,8 +14,15 @@ @yield('title') - - + + + + {{ $__t('Journal') }} @@ -34,11 +41,25 @@ data-user-filter="xx{{ GROCY_USER_ID }}xx" class="normal-message user-filter-message responsive-button"> @endif + + + + + + {{ $__t('Clear filter') }} + + - + @@ -85,7 +106,7 @@ + class="table table-sm table-striped nowrap w-100"> diff --git a/views/consume.blade.php b/views/consume.blade.php index a4530d63..0ed10697 100644 --- a/views/consume.blade.php +++ b/views/consume.blade.php @@ -13,10 +13,17 @@ @yield('title') - + + + + @if(!$embedded) {{ $__t('Scan mode') }} @if(boolval($userSettings['scan_mode_consume_enabled'])) {{ $__t('on') }} @else {{ $__t('off') }} @endif @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - + @@ -30,10 +46,19 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-striped nowrap w-100"> {{ $__t('Name') }} diff --git a/views/layout/default.blade.php b/views/layout/default.blade.php index 9d11932f..556c8b7d 100644 --- a/views/layout/default.blade.php +++ b/views/layout/default.blade.php @@ -57,8 +57,6 @@ rel="stylesheet"> - - - @@ -695,6 +691,7 @@ @if(!empty($__t('bootstrap-select_locale') && $__t('bootstrap-select_locale') != 'x'))@endif + diff --git a/views/locations.blade.php b/views/locations.blade.php index d8b1e5ad..c77e285a 100644 --- a/views/locations.blade.php +++ b/views/locations.blade.php @@ -9,12 +9,27 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - {{ $__t('Configure userfields') }} @@ -25,7 +40,8 @@ - + @@ -37,12 +53,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/manageapikeys.blade.php b/views/manageapikeys.blade.php index 5182017d..9cbf5c8e 100644 --- a/views/manageapikeys.blade.php +++ b/views/manageapikeys.blade.php @@ -18,8 +18,23 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} @@ -30,7 +45,8 @@ - + @@ -42,12 +58,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/productform.blade.php b/views/productform.blade.php index 20b28628..45dc2027 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -395,7 +395,7 @@ + class="table table-sm table-striped nowrap w-100"> @@ -455,7 +455,7 @@ + class="table table-sm table-striped nowrap w-100"> diff --git a/views/productgroups.blade.php b/views/productgroups.blade.php index 7577de9a..11d6ee83 100644 --- a/views/productgroups.blade.php +++ b/views/productgroups.blade.php @@ -9,12 +9,27 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - {{ $__t('Configure userfields') }} @@ -25,7 +40,8 @@ - + @@ -37,12 +53,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/products.blade.php b/views/products.blade.php index ab6a593d..6337a428 100644 --- a/views/products.blade.php +++ b/views/products.blade.php @@ -9,16 +9,31 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - {{ $__t('Configure userfields') }} - {{ $__t('Presets for new products') }} @@ -29,7 +44,8 @@ - + @@ -55,12 +71,21 @@ + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/purchase.blade.php b/views/purchase.blade.php index 176208ab..c4929a0d 100644 --- a/views/purchase.blade.php +++ b/views/purchase.blade.php @@ -13,10 +13,17 @@ @yield('title') - + + + + @if(!$embedded) {{ $__t('Scan mode') }} @if(boolval($userSettings['scan_mode_purchase_enabled'])) {{ $__t('on') }} @else {{ $__t('off') }} @endif + class="table table-sm table-striped nowrap w-100"> diff --git a/views/quantityunits.blade.php b/views/quantityunits.blade.php index 4b8ef59e..630ce3d0 100644 --- a/views/quantityunits.blade.php +++ b/views/quantityunits.blade.php @@ -9,12 +9,27 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - {{ $__t('Configure userfields') }} @@ -25,7 +40,8 @@ - + @@ -37,12 +53,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/recipeform.blade.php b/views/recipeform.blade.php index 35e6f539..fba45178 100644 --- a/views/recipeform.blade.php +++ b/views/recipeform.blade.php @@ -170,9 +170,16 @@ {{ $__t('Ingredients list') }} - + + + + {{ $__t('Add') }} @@ -181,7 +188,7 @@ + class="table table-sm table-striped nowrap w-100"> @@ -262,16 +269,23 @@ {{ $__t('Included recipes') }} - + + + + {{ $__t('Add') }} + class="table table-sm table-striped nowrap w-100"> diff --git a/views/recipes.blade.php b/views/recipes.blade.php index f4d3c22a..152d100b 100644 --- a/views/recipes.blade.php +++ b/views/recipes.blade.php @@ -14,16 +14,32 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - - + + @@ -35,7 +51,7 @@ - + {{ $__t('Status') }} @@ -49,6 +65,16 @@ + + + + + {{ $__t('Clear filter') }} + + + @@ -70,7 +96,7 @@ + class="table table-sm table-striped nowrap w-100"> diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index d443319e..cc921e22 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -131,6 +131,15 @@ + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/shoppinglocations.blade.php b/views/shoppinglocations.blade.php index fe226980..53429489 100644 --- a/views/shoppinglocations.blade.php +++ b/views/shoppinglocations.blade.php @@ -9,12 +9,27 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} - {{ $__t('Configure userfields') }} @@ -25,7 +40,8 @@ - + @@ -37,12 +53,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/stockentries.blade.php b/views/stockentries.blade.php index 40b2b159..4b8ad8cb 100644 --- a/views/stockentries.blade.php +++ b/views/stockentries.blade.php @@ -33,7 +33,7 @@ + class="table table-sm table-striped nowrap w-100"> diff --git a/views/stockjournal.blade.php b/views/stockjournal.blade.php index 7d095d46..4e88d132 100644 --- a/views/stockjournal.blade.php +++ b/views/stockjournal.blade.php @@ -7,8 +7,23 @@ @section('content') @yield('title') - - + + + + + + + + + {{ $__t('Journal summary') }} @@ -17,7 +32,8 @@ - + @@ -43,12 +59,21 @@ + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/stockjournalsummary.blade.php b/views/stockjournalsummary.blade.php index b40ec34e..f0c59696 100644 --- a/views/stockjournalsummary.blade.php +++ b/views/stockjournalsummary.blade.php @@ -16,7 +16,7 @@ + class="table table-sm table-striped nowrap w-100"> {{ $__t('Product') }} diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php old mode 100644 new mode 100755 index 75428490..3b05d267 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -17,22 +17,31 @@ - + @yield('title') + + - - + + + + {{ $__t('Journal') }} - {{ $__t('Stock entries') }} @if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) - {{ $__t('Location Content Sheet') }} @@ -53,6 +62,12 @@ data-status-filter="belowminstockamount" class="normal-message status-filter-message responsive-button"> + + + @@ -62,7 +77,8 @@ - + @@ -126,7 +142,7 @@ + class="table table-sm table-striped nowrap w-100"> diff --git a/views/taskcategories.blade.php b/views/taskcategories.blade.php index 7b0ea79d..dc637e92 100644 --- a/views/taskcategories.blade.php +++ b/views/taskcategories.blade.php @@ -9,8 +9,23 @@ @yield('title') - - + + + + + + + + + {{ $__t('Add') }} @@ -25,7 +40,8 @@ - + @@ -37,12 +53,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/tasks.blade.php b/views/tasks.blade.php index ebadb3cc..e4f1a291 100644 --- a/views/tasks.blade.php +++ b/views/tasks.blade.php @@ -21,7 +21,14 @@ @yield('title') - + + + + {{ $__t('Add') }} @@ -36,11 +43,25 @@ + + + + + + {{ $__t('Clear filter') }} + + - + @@ -81,7 +102,7 @@ + class="table table-sm table-striped nowrap w-100"> diff --git a/views/userentities.blade.php b/views/userentities.blade.php index 1bf8bc3b..128fe1f9 100644 --- a/views/userentities.blade.php +++ b/views/userentities.blade.php @@ -9,7 +9,22 @@ @yield('title') - + + + + + + + + + {{ $__t('Add') }} @@ -21,7 +36,8 @@ - + @@ -33,12 +49,21 @@ placeholder="{{ $__t('Search') }}"> + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/userfields.blade.php b/views/userfields.blade.php index d25ddc81..cac58642 100644 --- a/views/userfields.blade.php +++ b/views/userfields.blade.php @@ -9,7 +9,22 @@ @yield('title') - + + + + + + + + + {{ $__t('Add') }} @@ -21,7 +36,8 @@ - + @@ -47,12 +63,21 @@ + + + + {{ $__t('Clear filter') }} + + + + class="table table-sm table-striped nowrap w-100"> diff --git a/views/userobjects.blade.php b/views/userobjects.blade.php index 3b75f9c2..350fde4d 100644 --- a/views/userobjects.blade.php +++ b/views/userobjects.blade.php @@ -12,7 +12,22 @@ @yield('title') {{ $userentity->description }} - + + + + + + + + + {{ $__t('Add') }} @@ -28,7 +43,8 @@ - +