Update the routes and Author's Index page.
This commit is contained in:
@@ -6,8 +6,10 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Index do
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.header class="pb-2">
|
||||
Listing Authors
|
||||
<.header class="pb-2 ">
|
||||
<h1 class="text-lg font-semibold leading-8 text-zinc-800 dark:text-white">
|
||||
Listing Authors
|
||||
</h1>
|
||||
</.header>
|
||||
|
||||
<.author_search
|
||||
@@ -47,12 +49,28 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Index do
|
||||
</:action>
|
||||
</.table>
|
||||
|
||||
<.pagination
|
||||
endpoint={~p"/authors"}
|
||||
page={@page}
|
||||
page_params={@page_params}
|
||||
params={@params}
|
||||
/>
|
||||
<%= if Enum.empty?(@page.results) do %>
|
||||
<div class="flex justify-center ">
|
||||
<div>
|
||||
<p class="text-xl font-semibold py-5">
|
||||
No Authors
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="flex flex-wrap flex-[3_1_auto]">
|
||||
<%= for author <- @page.results do %>
|
||||
<.author_card author={author} />
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<.pagination
|
||||
endpoint={~p"/authors"}
|
||||
page={@page}
|
||||
page_params={@page_params}
|
||||
params={@params}
|
||||
/>
|
||||
<% end %>
|
||||
|
||||
<.modal
|
||||
:if={@live_action in [:new, :edit]}
|
||||
|
||||
Reference in New Issue
Block a user