diff --git a/dashboard/src/components/list/PageControl.svelte b/dashboard/src/components/list/PageControl.svelte index 965c1c6b..c5c28aa2 100644 --- a/dashboard/src/components/list/PageControl.svelte +++ b/dashboard/src/components/list/PageControl.svelte @@ -28,8 +28,34 @@ } function resetPage() { - pageOptions.currentPage = 1; -} + pageOptions.currentPage = 1; + } + + function updateItemsPerPage(event) { + resetPage(); + if (event.target?.value === 'card') { + switch (pageOptions.itemsPerPage) { + case 10: pageOptions.itemsPerPage = 12; + break; + case 25: pageOptions.itemsPerPage = 24; + break; + case 50: pageOptions.itemsPerPage = 60; + break; + default: pageOptions.itemsPerPage = 24; + break; + } + } else if (event.target?.value === 'list') { + switch (pageOptions.itemsPerPage) { + case 12: pageOptions.itemsPerPage = 10; + break; + case 24: pageOptions.itemsPerPage = 25; + break; + case 60: pageOptions.itemsPerPage = 50; + break; + default: pageOptions.itemsPerPage = 25 + } + } + } @@ -54,20 +80,6 @@ - Order @@ -77,20 +89,10 @@ - View mode - + updateItemsPerPage(e)}> diff --git a/dashboard/src/routes/Dash/Group/Group.svelte b/dashboard/src/routes/Dash/Group/Group.svelte index 063ddf43..dd9c54a9 100644 --- a/dashboard/src/routes/Dash/Group/Group.svelte +++ b/dashboard/src/routes/Dash/Group/Group.svelte @@ -184,6 +184,7 @@ {memberErr} {:else if lists.rawList && lists.rawList.length > 0} + {lists.processedList.length} {pageOptions.type}s ({lists.currentPage.length} shown) {#if pageOptions.view === "card"} @@ -207,6 +208,13 @@ min-height: 100%; z-index: -30; } + + .itemcounter { + width: 100%; + text-align: center; + display: inline-block; + margin-bottom: 0.5rem; + } diff --git a/dashboard/src/routes/Dash/Member/Member.svelte b/dashboard/src/routes/Dash/Member/Member.svelte index 43a830bb..25a67930 100644 --- a/dashboard/src/routes/Dash/Member/Member.svelte +++ b/dashboard/src/routes/Dash/Member/Member.svelte @@ -182,6 +182,7 @@ {groupErr} {:else if lists.rawList && lists.rawList.length > 0} + {lists.processedList.length} {pageOptions.type}s ({lists.currentPage.length} shown) {#if pageOptions.view === "card"} @@ -205,6 +206,13 @@ min-height: 100%; z-index: -30; } + + .itemcounter { + width: 100%; + text-align: center; + display: inline-block; + margin-bottom: 0.5rem; + }