fix: expand and display tag name in list view (#742)
Co-authored-by: Christian Beutel <> Co-authored-by: Flomp <Flomp@users.noreply.github.com>
This commit is contained in:
@@ -130,13 +130,13 @@
|
||||
{handleFromRecordWithIRI(trail)}
|
||||
</p>
|
||||
{/if}
|
||||
{#if trail.tags.length}
|
||||
{#if trail.tags.length && trail.expand?.tags}
|
||||
<div class="flex flex-wrap gap-1 mb-3 items-center">
|
||||
{#each expandedTags ? trail.tags : trail.tags.slice(0, 2) as t}
|
||||
<Chip text={t} closable={false} primary={false}></Chip>
|
||||
{#each expandedTags ? trail.expand.tags : trail.expand.tags.slice(0, 2) as tag}
|
||||
<Chip text={tag.name} closable={false} primary={false}></Chip>
|
||||
{/each}
|
||||
|
||||
{#if trail.tags.length > 2}
|
||||
{#if trail.expand.tags.length > 2}
|
||||
<button
|
||||
onclick={toggleExpandTags}
|
||||
class="text-sm text-gray-500 hover:underline focus:outline-none"
|
||||
@@ -145,7 +145,7 @@
|
||||
{#if expandedTags}
|
||||
Show less
|
||||
{:else}
|
||||
+{trail.tags.length - 2} more
|
||||
+{trail.expand.tags.length - 2} more
|
||||
{/if}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
@@ -79,7 +79,7 @@ export async function lists_search_filter(filter: ListFilter, page: number = 1,
|
||||
export async function lists_show(id: string, handle?: string, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
|
||||
|
||||
const r = await f(`/api/v1/list/${id}?` + new URLSearchParams({
|
||||
expand: "author,trails,trails.author,trails.category,list_share_via_list.actor",
|
||||
expand: "author,trails,trails.author,trails.category,trails.tags,list_share_via_list.actor",
|
||||
...(handle ? { handle } : {})
|
||||
}), {
|
||||
method: 'GET',
|
||||
|
||||
Reference in New Issue
Block a user