feat(dashboard): add more views/filter/sort options to group/member pages

This commit is contained in:
Jake Fulmine 2023-09-21 13:19:29 +02:00
parent 87430e5748
commit 94e848ee4c
3 changed files with 82 additions and 35 deletions

View file

@ -15,6 +15,8 @@
import { filterList, paginateList, getPageAmount } from '../../../components/list/functions';
import PageControl from "../../../components/list/PageControl.svelte";
import { writable, type Writable } from "svelte/store";
import TinyView from "../../../components/list/TinyView.svelte";
import TextView from "../../../components/list/TextView.svelte";
// get the state from the navigator so that we know which tab to start on
let location = useLocation();
@ -110,6 +112,7 @@
function getDefaultItemsPerpage(): number {
if (listView === 'card') return 24;
else if (listView === 'tiny') return 36;
else if (settings && settings.accessibility && settings.accessibility.expandedcards)
return 10;
else return 25;
@ -184,6 +187,10 @@
<ListPagination bind:currentPage={pageOptions.currentPage} {pageAmount} />
{#if pageOptions.view === "card"}
<CardView {pageOptions} currentList={currentPage} />
{:else if pageOptions.view === "tiny"}
<TinyView {pageOptions} currentList={currentPage} />
{:else if pageOptions.view === "text"}
<TextView {pageOptions} currentList={currentPage} {listOptions} />
{:else}
<ListView {pageOptions} currentList={currentPage} fullListLength={groupMembers.length}/>
{/if}

View file

@ -15,6 +15,8 @@
import { filterList, getPageAmount, paginateList } from '../../../components/list/functions';
import PageControl from "../../../components/list/PageControl.svelte";
import { writable, type Writable } from "svelte/store";
import TinyView from "../../../components/list/TinyView.svelte";
import TextView from "../../../components/list/TextView.svelte";
// get the state from the navigator so that we know which tab to start on
let location = useLocation();
@ -113,6 +115,7 @@
function getDefaultItemsPerpage(): number {
if (listView === 'card') return 24;
else if (listView === 'tiny') return 36;
else if (settings && settings.accessibility && settings.accessibility.expandedcards)
return 10;
else return 25
@ -186,6 +189,10 @@
<ListPagination bind:currentPage={pageOptions.currentPage} {pageAmount} />
{#if pageOptions.view === "card"}
<CardView {pageOptions} currentList={currentPage} />
{:else if pageOptions.view === "tiny"}
<TinyView {pageOptions} currentList={currentPage} />
{:else if pageOptions.view === "text"}
<TextView {pageOptions} currentList={currentPage} {listOptions} />
{:else}
<ListView {pageOptions} currentList={currentPage} fullListLength={memberGroups.length}/>
{/if}