Search v1 (#19)

* Adds description to media items; hooks it up to indexing/media downloading

* Added a search method using postgres fulltext search

* Hooked up search functionality to the search form

* Added persistence to the search form when on search page
This commit is contained in:
Kieran
2024-02-13 14:46:14 -08:00
committed by GitHub
parent 219320ce11
commit 060e340558
25 changed files with 261 additions and 25 deletions
@@ -16,7 +16,7 @@
</.link>
</nav>
</div>
<div class="rounded-sm border border-stroke bg-white px-5 pb-2.5 pt-6 shadow-default dark:border-strokedark dark:bg-boxdark sm:px-7.5 xl:pb-1">
<div class="rounded-sm border border-stroke bg-white px-5 py-5 shadow-default dark:border-strokedark dark:bg-boxdark sm:px-7.5">
<div class="max-w-full overflow-x-auto">
<div class="flex flex-col gap-10 dark:text-white">
<h3 class="mt-14 font-bold text-xl">Relationships</h3>
@@ -35,10 +35,10 @@
<.list_items_from_map map={Map.from_struct(@source)} />
<h3 class="font-bold text-xl">Downloaded Media</h3>
<%= if length(@downloaded_media) > 0 do %>
<%= if match?([_|_], @downloaded_media) do %>
<.table rows={@downloaded_media} table_class="text-black dark:text-white">
<:col :let={media_item} label="Title">
<%= String.slice(media_item.title, 0..50) %>...
<%= StringUtils.truncate(media_item.title, 50) %>
</:col>
<:col :let={media_item} label="" class="flex place-content-evenly">
<.link
@@ -54,10 +54,10 @@
<% end %>
<h3 class="font-bold text-xl">Pending Media</h3>
<%= if length(@pending_media) > 0 do %>
<%= if match?([_|_], @pending_media) do %>
<.table rows={@pending_media} table_class="text-black dark:text-white">
<:col :let={media_item} label="Title">
<%= String.slice(media_item.title, 0..50) %>...
<%= StringUtils.truncate(media_item.title, 50) %>
</:col>
<:col :let={media_item} label="" class="flex place-content-evenly">
<.link