diff --git a/web/src/lib/components/base/skeleton_card.svelte b/web/src/lib/components/base/skeleton_card.svelte index 81cae29c..aee56e80 100644 --- a/web/src/lib/components/base/skeleton_card.svelte +++ b/web/src/lib/components/base/skeleton_card.svelte @@ -1,5 +1,10 @@ + + + {/if} -
+
{list.name}
{#if list.public} - + {/if} @@ -70,6 +67,21 @@ {/if}
+ {#if list.expand?.author} +

+ {$_("by")} + avatar + {list.expand?.author.username} +

+ {/if}
diff --git a/web/src/lib/components/list/list_panel.svelte b/web/src/lib/components/list/list_panel.svelte index 4c0691b2..7f4bb60e 100644 --- a/web/src/lib/components/list/list_panel.svelte +++ b/web/src/lib/components/list/list_panel.svelte @@ -42,8 +42,12 @@ list.author == $currentUser?.id || list.expand?.list_share_via_list?.some((s) => s.permission == "edit"); + $: allowShare = + list.author == $currentUser?.id && + !list.expand?.trails?.some((t) => t.author !== $currentUser?.id); + $: dropdownItems = [ - ...(list.author == $currentUser?.id + ...(allowShare ? [{ text: $_("share"), value: "share", icon: "share" }] : []), ...(allowEdit @@ -122,7 +126,23 @@

{list.name}

- + {#if list.expand?.author} +

+ {$_("by")} + avatar + {list.expand.author.username} +

+ {/if}
void) | undefined = undefined; export let closeModal: (() => void) | undefined = undefined; @@ -34,7 +35,7 @@
    - {#each $lists as list} + {#each lists as list}
  • handleSelect(list)} diff --git a/web/src/lib/components/list/list_share_modal.svelte b/web/src/lib/components/list/list_share_modal.svelte index 69a41b98..33fe8fde 100644 --- a/web/src/lib/components/list/list_share_modal.svelte +++ b/web/src/lib/components/list/list_share_modal.svelte @@ -3,7 +3,6 @@ import type { List } from "$lib/models/list"; import { ListShare } from "$lib/models/list_share"; import { TrailShare } from "$lib/models/trail_share"; - import type { User } from "$lib/models/user"; import { list_share_create, list_share_delete, @@ -11,19 +10,15 @@ list_share_update, shares, } from "$lib/stores/list_share_store"; - import { lists } from "$lib/stores/list_store"; - import { show_toast } from "$lib/stores/toast_store"; import { trail_share_create, trail_share_delete, trail_share_index, } from "$lib/stores/trail_share_store"; - import { users_search } from "$lib/stores/user_store"; import { getFileURL } from "$lib/util/file_util"; import { createEventDispatcher } from "svelte"; import { _ } from "svelte-i18n"; import Button from "../base/button.svelte"; - import Search, { type SearchItem } from "../base/search.svelte"; import type { SelectItem } from "../base/select.svelte"; import Select from "../base/select.svelte"; import UserSearch from "../user_search.svelte"; @@ -116,8 +111,8 @@ trails: list.expand?.trails ?? [], list_share_via_list: fetchedShares, }; - lists.set($lists); - sharesLoading = false; + sharesLoading = false; + dispatch("update", list) } diff --git a/web/src/lib/components/share_info.svelte b/web/src/lib/components/share_info.svelte index e967e462..2f8893e4 100644 --- a/web/src/lib/components/share_info.svelte +++ b/web/src/lib/components/share_info.svelte @@ -52,7 +52,7 @@ > {#if showInfo}