Return artists first in universal search
This commit is contained in:
@@ -22,15 +22,28 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Empty state -->
|
||||
<.empty_state :if={@search_query == ""} />
|
||||
|
||||
<!-- No results -->
|
||||
<.no_results :if={@search_query != "" and @total_results == 0} query={@search_query} />
|
||||
|
||||
<!-- Search results -->
|
||||
<div :if={@total_results > 0} class="max-h-148 md:max-h-164 overflow-y-auto">
|
||||
<!-- Collection results -->
|
||||
<.search_result_group
|
||||
:if={length(@search_results.artists) > 0}
|
||||
title="Artists"
|
||||
count={length(@search_results.artists)}
|
||||
total_count={@search_counts.artists_count}
|
||||
class="border-t border-zinc-200 dark:border-zinc-700"
|
||||
>
|
||||
<.search_result_artist
|
||||
:for={%{artist: artist, image_data_hash: image_data_hash} <- @search_results.artists}
|
||||
artist={artist}
|
||||
image_data_hash={image_data_hash}
|
||||
phx-click="navigate_to_artist"
|
||||
phx-value-id={artist.musicbrainz_id}
|
||||
phx-target={@myself}
|
||||
/>
|
||||
</.search_result_group>
|
||||
</div>
|
||||
<.search_result_group
|
||||
:if={length(@search_results.collection) > 0}
|
||||
title="Collection"
|
||||
@@ -57,8 +70,6 @@
|
||||
/>
|
||||
</:actions>
|
||||
</.search_result_group>
|
||||
|
||||
<!-- Wishlist results -->
|
||||
<.search_result_group
|
||||
:if={length(@search_results.wishlist) > 0}
|
||||
title="Wishlist"
|
||||
@@ -86,27 +97,6 @@
|
||||
/>
|
||||
</:actions>
|
||||
</.search_result_group>
|
||||
|
||||
<!-- Artists results -->
|
||||
<.search_result_group
|
||||
:if={length(@search_results.artists) > 0}
|
||||
title="Artists"
|
||||
count={length(@search_results.artists)}
|
||||
total_count={@search_counts.artists_count}
|
||||
class="border-t border-zinc-200 dark:border-zinc-700"
|
||||
>
|
||||
<.search_result_artist
|
||||
:for={%{artist: artist, image_data_hash: image_data_hash} <- @search_results.artists}
|
||||
artist={artist}
|
||||
image_data_hash={image_data_hash}
|
||||
phx-click="navigate_to_artist"
|
||||
phx-value-id={artist.musicbrainz_id}
|
||||
phx-target={@myself}
|
||||
/>
|
||||
</.search_result_group>
|
||||
</div>
|
||||
|
||||
<!-- Footer with keyboard shortcuts -->
|
||||
<.results_footer total_results={@total_results} />
|
||||
</.structured_modal>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user