From 5083a181def59d12c368ddde0647bd1d2564fdd0 Mon Sep 17 00:00:00 2001 From: Jake Fulmine Date: Sun, 20 Aug 2023 16:44:22 +0200 Subject: [PATCH] feat(dashboard): add tiny list view --- .../src/components/group/TinyGroupView.svelte | 71 +++++++++++++++++++ .../src/components/list/GroupList.svelte | 4 +- .../src/components/list/ListControl.svelte | 6 ++ .../src/components/list/MemberList.svelte | 4 +- dashboard/src/components/list/TinyView.svelte | 30 ++++++++ .../components/member/TinyMemberView.svelte | 71 +++++++++++++++++++ 6 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 dashboard/src/components/group/TinyGroupView.svelte create mode 100644 dashboard/src/components/list/TinyView.svelte create mode 100644 dashboard/src/components/member/TinyMemberView.svelte diff --git a/dashboard/src/components/group/TinyGroupView.svelte b/dashboard/src/components/group/TinyGroupView.svelte new file mode 100644 index 00000000..4103adcc --- /dev/null +++ b/dashboard/src/components/group/TinyGroupView.svelte @@ -0,0 +1,71 @@ + + + + + + +

+ + {group.name} ({group.id}) +

+
+
+
+ + \ No newline at end of file diff --git a/dashboard/src/components/list/GroupList.svelte b/dashboard/src/components/list/GroupList.svelte index 6092aef2..fdd3c2da 100644 --- a/dashboard/src/components/list/GroupList.svelte +++ b/dashboard/src/components/list/GroupList.svelte @@ -13,6 +13,7 @@ import api from '../../api'; import type { ListOptions, PageOptions } from './types'; import { createShortList, filterList, getPageAmount, paginateList } from './functions'; + import TinyView from './TinyView.svelte'; $: memberList = getContext>("members") $: groupList = getContext>("groups") @@ -36,6 +37,7 @@ // set the default items per page based on settings and view // this probably should be moved to it's own function if (pageOptions.view === "card") pageOptions.itemsPerPage = 24; + else if (pageOptions.view === "tiny") pageOptions.itemsPerPage = 36; else if (settings && settings.accessibility && settings.accessibility.expandedcards) pageOptions.itemsPerPage = 10; else pageOptions.itemsPerPage = 25; @@ -86,7 +88,7 @@ {#if pageOptions.view === "card"} {:else if pageOptions.view === "tiny"} - tiny! + {:else} {/if} diff --git a/dashboard/src/components/list/ListControl.svelte b/dashboard/src/components/list/ListControl.svelte index 11cc0db1..ae12b855 100644 --- a/dashboard/src/components/list/ListControl.svelte +++ b/dashboard/src/components/list/ListControl.svelte @@ -25,6 +25,11 @@ let itemsPerPageSelection = { $: { if (pageOptions.view === "card") itemsPerPageSelection = { small: 12, default: 24, + large: 48 + } + else if (pageOptions.view === "tiny") itemsPerPageSelection = { + small: 18, + default: 36, large: 60 } else { @@ -173,6 +178,7 @@ function resetPage() { onViewChange(e)} > + diff --git a/dashboard/src/components/list/MemberList.svelte b/dashboard/src/components/list/MemberList.svelte index 17d7d7bb..6ea46340 100644 --- a/dashboard/src/components/list/MemberList.svelte +++ b/dashboard/src/components/list/MemberList.svelte @@ -13,6 +13,7 @@ import api from '../../api'; import type { ListOptions, List, PageOptions } from './types'; import { createShortList, filterList, getPageAmount, paginateList } from './functions'; + import TinyView from './TinyView.svelte'; $: memberList = getContext>("members") $: groupList = getContext>("groups") @@ -36,6 +37,7 @@ // set the default items per page based on settings and view // this probably should be moved to it's own function if (pageOptions.view === "card") pageOptions.itemsPerPage = 24; + else if (pageOptions.view === "tiny") pageOptions.itemsPerPage = 36; else if (settings && settings.accessibility && settings.accessibility.expandedcards) pageOptions.itemsPerPage = 10; else pageOptions.itemsPerPage = 25; @@ -86,7 +88,7 @@ {#if pageOptions.view === "card"} {:else if pageOptions.view === "tiny"} - tiny! + {:else} {/if} diff --git a/dashboard/src/components/list/TinyView.svelte b/dashboard/src/components/list/TinyView.svelte new file mode 100644 index 00000000..b46d6528 --- /dev/null +++ b/dashboard/src/components/list/TinyView.svelte @@ -0,0 +1,30 @@ + + + + {#if pageOptions.type === "member"} + {#each memberList as item (item.uuid)} + + + + {/each} + {:else if pageOptions.type === "group"} + {#each groupList as item (item.uuid)} + + + + {/each} + {/if} + \ No newline at end of file diff --git a/dashboard/src/components/member/TinyMemberView.svelte b/dashboard/src/components/member/TinyMemberView.svelte new file mode 100644 index 00000000..8c6f84f4 --- /dev/null +++ b/dashboard/src/components/member/TinyMemberView.svelte @@ -0,0 +1,71 @@ + + + + + + +

+ + {member.name} ({member.id}) +

+
+
+
+ + \ No newline at end of file