From 291fbfbdf4adb0db5c4c64bfffc0effc89ff6f1e Mon Sep 17 00:00:00 2001 From: KKlochko Date: Wed, 16 Apr 2025 21:56:06 +0300 Subject: [PATCH] Remove the table from Book and Author Index LiveViews. --- .../live/author_live/index.ex | 31 --------------- .../live/book_live/index.ex | 39 ------------------- 2 files changed, 70 deletions(-) diff --git a/lib/decentralised_book_index_web/live/author_live/index.ex b/lib/decentralised_book_index_web/live/author_live/index.ex index 442dad4..8764443 100644 --- a/lib/decentralised_book_index_web/live/author_live/index.ex +++ b/lib/decentralised_book_index_web/live/author_live/index.ex @@ -17,37 +17,6 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Index do current_user={@current_user} /> - <.table - id="authors" - rows={@streams.authors} - row_click={fn {_id, author} -> JS.navigate(~p"/authors/#{author}") end} - > - <:col :let={{_id, author}} label="Id">{author.id} - - <:col :let={{_id, author}} label="Name">{author.name} - - <:col :let={{_id, author}} label="Description">{author.description} - - <:col :let={{_id, author}} label="Avatar url">{author.avatar_url} - - <:action :let={{_id, author}}> -
- <.link navigate={~p"/authors/#{author}"}>Show -
- - <.link patch={~p"/authors/#{author}/edit"}>Edit - - - <:action :let={{id, author}}> - <.link - phx-click={JS.push("delete", value: %{id: author.id}) |> hide("##{id}")} - data-confirm="Are you sure?" - > - Delete - - - - <%= if Enum.empty?(@page.results) do %>
diff --git a/lib/decentralised_book_index_web/live/book_live/index.ex b/lib/decentralised_book_index_web/live/book_live/index.ex index 5bcdfa8..9671f63 100644 --- a/lib/decentralised_book_index_web/live/book_live/index.ex +++ b/lib/decentralised_book_index_web/live/book_live/index.ex @@ -19,45 +19,6 @@ defmodule DecentralisedBookIndexWeb.BookLive.Index do current_user={@current_user} /> - <.table - id="books" - rows={@streams.books} - row_click={fn {_id, book} -> JS.navigate(~p"/books/#{book}") end} - > - <:col :let={{_id, book}} label="Id">{book.id} - - <:col :let={{_id, book}} label="Title">{book.title} - - <:col :let={{_id, book}} label="Description">{book.description} - - <:col :let={{_id, book}} label="Published">{book.published} - - <:col :let={{_id, book}} label="Language">{book.language} - - <:col :let={{_id, book}} label="Format">{book.format} - - <:col :let={{_id, book}} label="Page count">{book.page_count} - - <:col :let={{_id, book}} label="Cover image url">{book.cover_image_url} - - <:action :let={{_id, book}}> -
- <.link navigate={~p"/books/#{book}"}>Show -
- - <.link patch={~p"/books/#{book}/edit"}>Edit - - - <:action :let={{id, book}}> - <.link - phx-click={JS.push("delete", value: %{id: book.id}) |> hide("##{id}")} - data-confirm="Are you sure?" - > - Delete - - - - <%= if Enum.empty?(@page.results) do %>