[WIP] Simplified overviews on mobile (#1115)

* Simplified stock overview on mobile.

* Stock table horizontally scrollable

* Use the new mobile views for all pages (except the shopping list page, use the existing special handling there for now)
And add a clear filter button to all pages

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
4lloyd
2020-11-07 14:53:45 +01:00
committed by GitHub
parent 9aa9bd1cc7
commit 76cbf796b6
63 changed files with 948 additions and 156 deletions

View File

@@ -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('<span class="d-block d-md-none">' + dueCount + ' <i class="fas fa-clock"></i></span><span class="d-none d-md-block">' + __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('<span class="d-block d-md-none">' + overdueCount + ' <i class="fas fa-times-circle"></i></span><span class="d-none d-md-block">' + __n(overdueCount, '%s task is overdue to be done', '%s tasks are overdue to be done'));
},
function(xhr)
{