[web] Simplify search page

This commit is contained in:
Alain Nussbaumer
2025-03-17 21:05:47 +01:00
parent 9b4d04000f
commit 9bea7fef7d
9 changed files with 192 additions and 258 deletions

View File

@@ -323,18 +323,6 @@
"music": {
"featured-playlists": "Ausgezeichnete Playlisten",
"new-releases": "Neuvorstellung"
},
"search": {
"albums": "Alben",
"artists": "Künstler",
"no-results": "Keine Ergebnisse gefunden",
"placeholder": "Suche",
"playlists": "Playlisten",
"show-albums": "Zeige das Album|Zeige alle {count} Alben",
"show-artists": "Zeige den Künstler|Zeige alle {count} Künstler",
"show-playlists": "Zeige die Playlist|Zeige alle {count} Playlisten",
"show-tracks": "Zeige den Track|Zeige alle {count} Tracks",
"tracks": "Tracks"
}
}
},

View File

@@ -323,18 +323,6 @@
"music": {
"featured-playlists": "Featured Playlists",
"new-releases": "New Releases"
},
"search": {
"albums": "Albums",
"artists": "Artists",
"no-results": "No results found",
"placeholder": "Search",
"playlists": "Playlists",
"show-albums": "Show the album|Show all {count} albums",
"show-artists": "Show the artist|Show all {count} artists",
"show-playlists": "Show the playlist|Show all {count} playlists",
"show-tracks": "Show the track|Show all {count} tracks",
"tracks": "Tracks"
}
}
},

View File

@@ -323,18 +323,6 @@
"music": {
"featured-playlists": "Listes de lecture en vedette",
"new-releases": "Nouvelle sorties"
},
"search": {
"albums": "Albums",
"artists": "Artistes",
"no-results": "Aucun résultat trouvé",
"placeholder": "Recherche",
"playlists": "Listes de lecture",
"show-albums": "Afficher lalbum|Afficher les {count} albums",
"show-artists": "Afficher lartiste|Afficher les {count} artistes",
"show-playlists": "Afficher la liste de lecture|Afficher les {count} listes de lecture",
"show-tracks": "Afficher la piste|Afficher les {count} pistes",
"tracks": "Pistes"
}
}
},

View File

@@ -323,18 +323,6 @@
"music": {
"featured-playlists": "特色列表",
"new-releases": "最新发行"
},
"search": {
"albums": "专辑",
"artists": "艺人",
"no-results": "未找到结果",
"placeholder": "搜索",
"playlists": "播放列表",
"show-albums": "显示专辑|显示所有 {count} 个专辑",
"show-artists": "显示艺人|显示所有 {count} 位艺人",
"show-playlists": "显示播放列表|显示所有 {count} 个播放列表",
"show-tracks": "显示曲目|显示所有 {count} 只曲目",
"tracks": "曲目"
}
}
},

View File

@@ -323,18 +323,6 @@
"music": {
"featured-playlists": "特色列表",
"new-releases": "最新發行"
},
"search": {
"albums": "專輯",
"artists": "藝人",
"no-results": "未找到結果",
"placeholder": "搜尋",
"playlists": "播放列表",
"show-albums": "顯示專輯|顯示所有 {count} 個專輯",
"show-artists": "顯示藝人|顯示所有 {count} 位藝人",
"show-playlists": "顯示播放列表|顯示所有 {count} 個播放列表",
"show-tracks": "顯示曲目|顯示所有 {count} 首曲目",
"tracks": "曲目"
}
}
},

View File

@@ -48,35 +48,33 @@
</div>
</section>
<tabs-search @search-library="search" @search-spotify="searchSpotify" />
<template v-for="[type, items] in results" :key="type">
<content-with-heading>
<template #heading>
<heading-title :content="{ title: $t(`page.search.${type}s`) }" />
</template>
<template #content>
<component :is="components[type]" :items="items" />
</template>
<template v-if="!expanded" #footer>
<nav v-if="showAllButton(items)" class="level">
<div class="level-item">
<control-button
:button="{
handler: () => expand(type),
title: $t(
`page.search.show-${type}s`,
{ count: $n(items.total) },
items.total
)
}"
/>
</div>
</nav>
<div v-if="!items.total" class="has-text-centered-mobile">
<i v-text="$t('page.search.no-results')" />
<content-with-heading v-for="[type, items] in results" :key="type">
<template #heading>
<heading-title :content="{ title: $t(`page.search.${type}s`) }" />
</template>
<template #content>
<component :is="components[type]" :items="items" />
</template>
<template v-if="!expanded" #footer>
<nav v-if="showAllButton(items)" class="level">
<div class="level-item">
<control-button
:button="{
handler: () => expand(type),
title: $t(
`page.search.show-${type}s`,
{ count: $n(items.total) },
items.total
)
}"
/>
</div>
</template>
</content-with-heading>
</template>
</nav>
<div v-if="!items.total" class="has-text-centered-mobile">
<i v-text="$t('page.search.no-results')" />
</div>
</template>
</content-with-heading>
</template>
<script>

View File

@@ -11,7 +11,7 @@
v-model="query"
class="input is-rounded"
type="text"
:placeholder="$t('page.spotify.search.placeholder')"
:placeholder="$t('page.search.placeholder')"
autocomplete="off"
/>
<mdicon class="icon is-left" name="magnify" size="16" />
@@ -31,49 +31,45 @@
</div>
</section>
<tabs-search @search-library="searchLibrary" @search-spotify="search" />
<template v-for="[type, items] in results" :key="type">
<content-with-heading>
<template #heading>
<heading-title
:content="{ title: $t(`page.spotify.search.${type}s`) }"
/>
</template>
<template #content>
<component :is="components[type]" :items="items.items" />
<vue-eternal-loading v-if="expanded" :load="searchNext">
<template #loading>
<div class="columns is-centered">
<div class="column has-text-centered">
<mdicon class="icon mdi-spin" name="loading" />
</div>
<content-with-heading v-for="[type, items] in results" :key="type">
<template #heading>
<heading-title :content="{ title: $t(`page.search.${type}s`) }" />
</template>
<template #content>
<component :is="components[type]" :items="items.items" />
<vue-eternal-loading v-if="expanded" :load="searchNext">
<template #loading>
<div class="columns is-centered">
<div class="column has-text-centered">
<mdicon class="icon mdi-spin" name="loading" />
</div>
</template>
<template #no-more>
<br />
</template>
</vue-eternal-loading>
</template>
<template v-if="!expanded" #footer>
<nav v-if="showAllButton(items)" class="level">
<div class="level-item">
<control-button
:button="{
handler: () => expand(type),
title: $t(
`page.spotify.search.show-${type}s`,
{ count: `${$n(items.total)}` },
items.total
)
}"
/>
</div>
</nav>
<div v-if="!items.total" class="has-text-centered-mobile">
<i v-text="$t(`page.spotify.search.no-results`)" />
</template>
<template #no-more>
<br />
</template>
</vue-eternal-loading>
</template>
<template v-if="!expanded" #footer>
<nav v-if="showAllButton(items)" class="level">
<div class="level-item">
<control-button
:button="{
handler: () => expand(type),
title: $t(
`page.search.show-${type}s`,
{ count: $n(items.total) },
items.total
)
}"
/>
</div>
</template>
</content-with-heading>
</template>
</nav>
<div v-if="!items.total" class="has-text-centered-mobile">
<i v-text="$t('page.search.no-results')" />
</div>
</template>
</content-with-heading>
</template>
<script>