From 00c55533ea2f07ef7756654cf2f97846b920e259 Mon Sep 17 00:00:00 2001 From: Jake Fulmine Date: Sun, 2 Oct 2022 22:09:13 +0200 Subject: [PATCH] feat(dashboard): card list view --- dashboard/src/lib/group/CardView.svelte | 230 +++++++++++++++++ dashboard/src/lib/list/CardView.svelte | 96 +++++++ dashboard/src/lib/list/List.svelte | 26 +- dashboard/src/lib/list/ListControl.svelte | 43 +++- .../{CardsList.svelte => ListView.svelte} | 2 +- dashboard/src/lib/member/CardView.svelte | 240 ++++++++++++++++++ dashboard/src/pages/Dash.svelte | 27 +- dashboard/src/pages/Group.svelte | 21 +- dashboard/src/pages/Member.svelte | 21 +- dashboard/src/pages/Profile.svelte | 27 +- dashboard/src/pages/Random.svelte | 2 +- 11 files changed, 690 insertions(+), 45 deletions(-) create mode 100644 dashboard/src/lib/group/CardView.svelte create mode 100644 dashboard/src/lib/list/CardView.svelte rename dashboard/src/lib/list/{CardsList.svelte => ListView.svelte} (98%) create mode 100644 dashboard/src/lib/member/CardView.svelte diff --git a/dashboard/src/lib/group/CardView.svelte b/dashboard/src/lib/group/CardView.svelte new file mode 100644 index 00000000..c30edea9 --- /dev/null +++ b/dashboard/src/lib/group/CardView.svelte @@ -0,0 +1,230 @@ + + + + + +
+ +
+ {@html htmlName} ({group.id}) +
+
+
+ {#if view === "card"} + {if (event.key === "Enter") {avatarOpen = true}}} on:click={toggleAvatarModal} class="rounded avatar mx-auto w-100 h-auto mb-2" src={icon_url_resized} alt={altText}/> + +
+ Member avatar +
+
+ {#if group.display_name} +
{@html htmlDisplayName}
+ {/if} +
+
+ {@html htmlDesc} +
+
+ + + {#if !isPublic}{/if} + + + {#if !isPublic && isDash}{/if} + + + + + {#if !isPublic}Edit group{/if} + {#if !isPublic && isDash}View members{/if} + View page + + {:else if view === "groups"} + {#if memberList.length > 0} + Members +
+ + {#each memberList as member, index (member.id)} + {@html toHTML(member.name)} ({member.id}) + {/each} + + {:else} + This group has no members. + {/if} +
+ + + + + + + + + + + Edit group + Back to info + View page + + {:else if view === "edit"} + + + + +
+ +