Update the select components to show the message about no records.

dev
KKlochko 4 weeks ago
parent e226e696da
commit bf333aad07

@ -42,18 +42,26 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.SelectAuthor do
</div> </div>
</form> </form>
<%= for author <- @page.results do %> <%= if Enum.empty?(@page.results) do %>
<div <div class="flex justify-center ">
phx-click="select-author" <p class="text-lg font-semibold py-5 dark:text-white">
phx-target={@notify_component} No Authors
phx-value-author={author.id} </p>
phx-value-path={@form_path}
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{author.name}
</h5>
</div> </div>
<% else %>
<%= for author <- @page.results do %>
<div
phx-click="select-author"
phx-target={@notify_component}
phx-value-author={author.id}
phx-value-path={@form_path}
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{author.name}
</h5>
</div>
<% end %>
<% end %> <% end %>
</div> </div>
""" """

@ -42,17 +42,25 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.SelectAuthorAlias do
</div> </div>
</form> </form>
<%= for author_alias <- @page.results do %> <%= if Enum.empty?(@page.results) do %>
<div <div class="flex justify-center ">
phx-click="select-author-alias" <p class="text-lg font-semibold py-5 dark:text-white">
phx-target={@notify_component} No Authors
phx-value-author-alias={author_alias.author_alias_registry_id} </p>
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{author_alias.name}
</h5>
</div> </div>
<% else %>
<%= for author_alias <- @page.results do %>
<div
phx-click="select-author-alias"
phx-target={@notify_component}
phx-value-author-alias={author_alias.author_alias_registry_id}
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{author_alias.name}
</h5>
</div>
<% end %>
<% end %> <% end %>
</div> </div>
""" """

@ -42,17 +42,25 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.SelectBookEdition do
</div> </div>
</form> </form>
<%= for book_edition <- @page.results do %> <%= if Enum.empty?(@page.results) do %>
<div <div class="flex justify-center ">
phx-click="select-book-edition" <p class="text-lg font-semibold py-5 dark:text-white">
phx-target={@notify_component} No Books
phx-value-book-edition={book_edition.book_editions_registry_id} </p>
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{book_edition.title}
</h5>
</div> </div>
<% else %>
<%= for book_edition <- @page.results do %>
<div
phx-click="select-book-edition"
phx-target={@notify_component}
phx-value-book-edition={book_edition.book_editions_registry_id}
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{book_edition.title}
</h5>
</div>
<% end %>
<% end %> <% end %>
</div> </div>
""" """

@ -42,17 +42,25 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.SelectPublisher do
</div> </div>
</form> </form>
<%= for publisher <- @page.results do %> <%= if Enum.empty?(@page.results) do %>
<div <div class="flex justify-center ">
phx-click="select-publisher" <p class="text-lg font-semibold py-5 dark:text-white">
phx-target={@notify_component} No Publishers
phx-value-publisher={publisher.id} </p>
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{publisher.name}
</h5>
</div> </div>
<% else %>
<%= for publisher <- @page.results do %>
<div
phx-click="select-publisher"
phx-target={@notify_component}
phx-value-publisher={publisher.id}
class="w-full bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700 mx-auto my-3 hover:bg-gray-100 dark:hover:bg-gray-700"
>
<h5 class="mb-1 text-lg font-medium text-gray-900 dark:text-white px-2 pt-1">
{publisher.name}
</h5>
</div>
<% end %>
<% end %> <% end %>
</div> </div>
""" """

Loading…
Cancel
Save