Update the code format for components and LiveViews.
continuous-integration/drone/push Build is failing
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -50,7 +50,11 @@ defmodule DecentralisedBookIndexWeb.CoreComponents do
|
|||||||
data-cancel={JS.exec(@on_cancel, "phx-remove")}
|
data-cancel={JS.exec(@on_cancel, "phx-remove")}
|
||||||
class="relative z-50 hidden"
|
class="relative z-50 hidden"
|
||||||
>
|
>
|
||||||
<div id={"#{@id}-bg"} class="bg-zinc-50/90 dark:bg-gray-900/90 fixed inset-0 transition-opacity" aria-hidden="true" />
|
<div
|
||||||
|
id={"#{@id}-bg"}
|
||||||
|
class="bg-zinc-50/90 dark:bg-gray-900/90 fixed inset-0 transition-opacity"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
<div
|
<div
|
||||||
class="fixed inset-0 overflow-y-auto"
|
class="fixed inset-0 overflow-y-auto"
|
||||||
aria-labelledby={"#{@id}-title"}
|
aria-labelledby={"#{@id}-title"}
|
||||||
@@ -425,7 +429,8 @@ defmodule DecentralisedBookIndexWeb.CoreComponents do
|
|||||||
class={[
|
class={[
|
||||||
"mt-2 block w-full rounded-lg text-zinc-900 focus:ring-0 sm:text-sm sm:leading-6 min-h-[6rem] dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
|
"mt-2 block w-full rounded-lg text-zinc-900 focus:ring-0 sm:text-sm sm:leading-6 min-h-[6rem] dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
|
||||||
@errors == [] && "border-zinc-300 focus:border-zinc-400",
|
@errors == [] && "border-zinc-300 focus:border-zinc-400",
|
||||||
@errors != [] && "border-rose-400 focus:border-rose-400 dark:border-rose-400 dark:focus:border-rose-400"
|
@errors != [] &&
|
||||||
|
"border-rose-400 focus:border-rose-400 dark:border-rose-400 dark:focus:border-rose-400"
|
||||||
]}
|
]}
|
||||||
{@rest}
|
{@rest}
|
||||||
>{Phoenix.HTML.Form.normalize_value("textarea", @value)}</textarea>
|
>{Phoenix.HTML.Form.normalize_value("textarea", @value)}</textarea>
|
||||||
@@ -449,7 +454,8 @@ defmodule DecentralisedBookIndexWeb.CoreComponents do
|
|||||||
class={[
|
class={[
|
||||||
"mt-2 block w-full rounded-lg text-zinc-900 focus:ring-0 sm:text-sm sm:leading-6 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
|
"mt-2 block w-full rounded-lg text-zinc-900 focus:ring-0 sm:text-sm sm:leading-6 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
|
||||||
@errors == [] && "border-zinc-300 focus:border-zinc-400",
|
@errors == [] && "border-zinc-300 focus:border-zinc-400",
|
||||||
@errors != [] && "border-rose-400 focus:border-rose-400 dark:border-rose-400 dark:focus:border-rose-400"
|
@errors != [] &&
|
||||||
|
"border-rose-400 focus:border-rose-400 dark:border-rose-400 dark:focus:border-rose-400"
|
||||||
]}
|
]}
|
||||||
{@rest}
|
{@rest}
|
||||||
/>
|
/>
|
||||||
@@ -572,7 +578,10 @@ defmodule DecentralisedBookIndexWeb.CoreComponents do
|
|||||||
>
|
>
|
||||||
<div class="block py-4 pr-6">
|
<div class="block py-4 pr-6">
|
||||||
<span class="absolute -inset-y-px right-0 -left-4 group-hover:bg-zinc-50 sm:rounded-l-xl" />
|
<span class="absolute -inset-y-px right-0 -left-4 group-hover:bg-zinc-50 sm:rounded-l-xl" />
|
||||||
<span class={["p-4 relative font-sm text-gray-500 dark:text-gray-400", i == 0 && "p-4 medium text-gray-900 whitespace-nowrap dark:text-white"]}>
|
<span class={[
|
||||||
|
"p-4 relative font-sm text-gray-500 dark:text-gray-400",
|
||||||
|
i == 0 && "p-4 medium text-gray-900 whitespace-nowrap dark:text-white"
|
||||||
|
]}>
|
||||||
{render_slot(col, @row_item.(row))}
|
{render_slot(col, @row_item.(row))}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -120,9 +120,21 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.Buttons do
|
|||||||
]}
|
]}
|
||||||
{@rest}
|
{@rest}
|
||||||
>
|
>
|
||||||
<svg class="w-6 h-6 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
<svg
|
||||||
<path fill-rule="evenodd" d="M5 3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V7.414A2 2 0 0 0 20.414 6L18 3.586A2 2 0 0 0 16.586 3H5Zm3 11a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6H8v-6Zm1-7V5h6v2a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
|
class="w-6 h-6 dark:text-white"
|
||||||
<path fill-rule="evenodd" d="M14 17h-4v-2h4v2Z" clip-rule="evenodd"/>
|
aria-hidden="true"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M5 3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V7.414A2 2 0 0 0 20.414 6L18 3.586A2 2 0 0 0 16.586 3H5Zm3 11a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6H8v-6Zm1-7V5h6v2a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1Z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
/>
|
||||||
|
<path fill-rule="evenodd" d="M14 17h-4v-2h4v2Z" clip-rule="evenodd" />
|
||||||
</svg>
|
</svg>
|
||||||
{render_slot(@inner_block)}
|
{render_slot(@inner_block)}
|
||||||
</.success_button>
|
</.success_button>
|
||||||
@@ -147,9 +159,21 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.Buttons do
|
|||||||
]}
|
]}
|
||||||
{@rest}
|
{@rest}
|
||||||
>
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-2 -ml-0.5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
<svg
|
||||||
<path d="M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"></path>
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z" clip-rule="evenodd"></path>
|
class="h-4 w-4 mr-2 -ml-0.5"
|
||||||
|
viewBox="0 0 20 20"
|
||||||
|
fill="currentColor"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<path d="M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z">
|
||||||
|
</path>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
>
|
||||||
|
</path>
|
||||||
</svg>
|
</svg>
|
||||||
{render_slot(@inner_block)}
|
{render_slot(@inner_block)}
|
||||||
</.primary_button>
|
</.primary_button>
|
||||||
@@ -174,8 +198,22 @@ defmodule DecentralisedBookIndexWeb.Components.MyComponents.Buttons do
|
|||||||
]}
|
]}
|
||||||
{@rest}
|
{@rest}
|
||||||
>
|
>
|
||||||
<svg class="w-6 h-6 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
<svg
|
||||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18 17.94 6M18 18 6.06 6"/>
|
class="w-6 h-6 dark:text-white"
|
||||||
|
aria-hidden="true"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="none"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M6 18 17.94 6M18 18 6.06 6"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
{render_slot(@inner_block)}
|
{render_slot(@inner_block)}
|
||||||
</.primary_button>
|
</.primary_button>
|
||||||
|
|||||||
@@ -30,19 +30,11 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Index do
|
|||||||
<% else %>
|
<% else %>
|
||||||
<div class="flex flex-wrap flex-[3_1_auto]">
|
<div class="flex flex-wrap flex-[3_1_auto]">
|
||||||
<%= for author <- @page.results do %>
|
<%= for author <- @page.results do %>
|
||||||
<.author_card
|
<.author_card author={author} current_user={@current_user} />
|
||||||
author={author}
|
|
||||||
current_user={@current_user}
|
|
||||||
/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<.pagination
|
<.pagination endpoint={~p"/authors"} page={@page} page_params={@page_params} params={@params} />
|
||||||
endpoint={~p"/authors"}
|
|
||||||
page={@page}
|
|
||||||
page_params={@page_params}
|
|
||||||
params={@params}
|
|
||||||
/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -108,7 +108,10 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Show do
|
|||||||
@impl true
|
@impl true
|
||||||
def handle_params(%{"id" => id}, _, socket) do
|
def handle_params(%{"id" => id}, _, socket) do
|
||||||
author =
|
author =
|
||||||
Ash.get!(DecentralisedBookIndex.Metadata.Author, id, load: [:dbi_server], actor: socket.assigns.current_user)
|
Ash.get!(DecentralisedBookIndex.Metadata.Author, id,
|
||||||
|
load: [:dbi_server],
|
||||||
|
actor: socket.assigns.current_user
|
||||||
|
)
|
||||||
|
|
||||||
alternative_names = DecentralisedBookIndex.Metadata.get_author_alternative_names!(author)
|
alternative_names = DecentralisedBookIndex.Metadata.get_author_alternative_names!(author)
|
||||||
|
|
||||||
|
|||||||
@@ -21,19 +21,11 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|||||||
<%= if @form.source.type == :create do %>
|
<%= if @form.source.type == :create do %>
|
||||||
<.input field={@form[:title]} type="text" label="Title" />
|
<.input field={@form[:title]} type="text" label="Title" />
|
||||||
<.input field={@form[:cover_image_url]} type="text" label="Cover image url" />
|
<.input field={@form[:cover_image_url]} type="text" label="Cover image url" />
|
||||||
<.input
|
<.input field={@form[:description]} type="textarea" label="Description" />
|
||||||
field={@form[:description]}
|
|
||||||
type="textarea"
|
|
||||||
label="Description"
|
|
||||||
/>
|
|
||||||
<.bids_inputs form={@form} myself={@myself} />
|
<.bids_inputs form={@form} myself={@myself} />
|
||||||
<.author_roles_inputs form={@form} myself={@myself} notify_component={@myself} />
|
<.author_roles_inputs form={@form} myself={@myself} notify_component={@myself} />
|
||||||
<.input field={@form[:format]} type="text" label="Format" />
|
<.input field={@form[:format]} type="text" label="Format" />
|
||||||
<.input
|
<.input field={@form[:language]} type="text" label="Language" />
|
||||||
field={@form[:language]}
|
|
||||||
type="text"
|
|
||||||
label="Language"
|
|
||||||
/>
|
|
||||||
<.input field={@form[:page_count]} type="number" label="Page count" />
|
<.input field={@form[:page_count]} type="number" label="Page count" />
|
||||||
<div>
|
<div>
|
||||||
<.input field={@form[:publisher_id]} type="text" label="Publisher" type="hidden" show_errors?={false} />
|
<.input field={@form[:publisher_id]} type="text" label="Publisher" type="hidden" show_errors?={false} />
|
||||||
@@ -48,19 +40,11 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|||||||
<%= if @form.source.type == :update do %>
|
<%= if @form.source.type == :update do %>
|
||||||
<.input field={@form[:title]} type="text" label="Title" />
|
<.input field={@form[:title]} type="text" label="Title" />
|
||||||
<.input field={@form[:cover_image_url]} type="text" label="Cover image url" />
|
<.input field={@form[:cover_image_url]} type="text" label="Cover image url" />
|
||||||
<.input
|
<.input field={@form[:description]} type="textarea" label="Description" />
|
||||||
field={@form[:description]}
|
|
||||||
type="textarea"
|
|
||||||
label="Description"
|
|
||||||
/>
|
|
||||||
<.bids_inputs form={@form} myself={@myself} />
|
<.bids_inputs form={@form} myself={@myself} />
|
||||||
<.author_roles_inputs form={@form} myself={@myself} notify_component={@myself} />
|
<.author_roles_inputs form={@form} myself={@myself} notify_component={@myself} />
|
||||||
<.input field={@form[:format]} type="text" label="Format" />
|
<.input field={@form[:format]} type="text" label="Format" />
|
||||||
<.input
|
<.input field={@form[:language]} type="text" label="Language" />
|
||||||
field={@form[:language]}
|
|
||||||
type="text"
|
|
||||||
label="Language"
|
|
||||||
/>
|
|
||||||
<.input field={@form[:page_count]} type="number" label="Page count" />
|
<.input field={@form[:page_count]} type="number" label="Page count" />
|
||||||
<div>
|
<div>
|
||||||
<.input field={@form[:publisher_id]} type="text" label="Publisher" type="hidden" show_errors?={false} />
|
<.input field={@form[:publisher_id]} type="text" label="Publisher" type="hidden" show_errors?={false} />
|
||||||
@@ -181,8 +165,20 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|||||||
size="xs"
|
size="xs"
|
||||||
inverse
|
inverse
|
||||||
>
|
>
|
||||||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
<svg
|
||||||
<path fill-rule="evenodd" d="M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z" clip-rule="evenodd"/>
|
class="w-6 h-6 text-gray-800 dark:text-white"
|
||||||
|
aria-hidden="true"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</.button_link>
|
</.button_link>
|
||||||
</td>
|
</td>
|
||||||
@@ -285,8 +281,20 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|||||||
size="xs"
|
size="xs"
|
||||||
inverse
|
inverse
|
||||||
>
|
>
|
||||||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
<svg
|
||||||
<path fill-rule="evenodd" d="M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z" clip-rule="evenodd"/>
|
class="w-6 h-6 text-gray-800 dark:text-white"
|
||||||
|
aria-hidden="true"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M8.586 2.586A2 2 0 0 1 10 2h4a2 2 0 0 1 2 2v2h3a1 1 0 1 1 0 2v12a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a1 1 0 0 1 0-2h3V4a2 2 0 0 1 .586-1.414ZM10 6h4V4h-4v2Zm1 4a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Zm4 0a1 1 0 1 0-2 0v8a1 1 0 1 0 2 0v-8Z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</.button_link>
|
</.button_link>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -30,19 +30,11 @@ defmodule DecentralisedBookIndexWeb.BookLive.Index do
|
|||||||
<% else %>
|
<% else %>
|
||||||
<div class="flex flex-wrap flex-[3_1_auto]">
|
<div class="flex flex-wrap flex-[3_1_auto]">
|
||||||
<%= for book <- @page.results do %>
|
<%= for book <- @page.results do %>
|
||||||
<.book_card
|
<.book_card book={book} current_user={@current_user} />
|
||||||
book={book}
|
|
||||||
current_user={@current_user}
|
|
||||||
/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<.pagination
|
<.pagination endpoint={~p"/books"} page={@page} page_params={@page_params} params={@params} />
|
||||||
endpoint={~p"/books"}
|
|
||||||
page={@page}
|
|
||||||
page_params={@page_params}
|
|
||||||
params={@params}
|
|
||||||
/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<.modal :if={@live_action in [:new, :edit]} id="book-modal" show on_cancel={JS.patch(~p"/books")}>
|
<.modal :if={@live_action in [:new, :edit]} id="book-modal" show on_cancel={JS.patch(~p"/books")}>
|
||||||
|
|||||||
@@ -33,11 +33,27 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
|
|||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<%= if @book.cover_image_url != nil do %>
|
<%= if @book.cover_image_url != nil do %>
|
||||||
<img class="w-36 shadow-lg mt-14 mx-auto object-cover" src={@book.cover_image_url} alt={"#{@book.title} image"}/>
|
<img
|
||||||
|
class="w-36 shadow-lg mt-14 mx-auto object-cover"
|
||||||
|
src={@book.cover_image_url}
|
||||||
|
alt={"#{@book.title} image"}
|
||||||
|
/>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="relative w-36 h-36 overflow-hidden mt-14 mx-auto">
|
<div class="relative w-36 h-36 overflow-hidden mt-14 mx-auto">
|
||||||
<svg class="w-36 h-36 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
<svg
|
||||||
<path fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v15a3 3 0 0 0 3 3h12a1 1 0 1 0 0-2h-2v-2h2a1 1 0 0 0 1-1V4a2 2 0 0 0-2-2h-8v16h5v2H7a1 1 0 1 1 0-2h1V2H6Z" clip-rule="evenodd"/>
|
class="w-36 h-36 text-gray-800 dark:text-white"
|
||||||
|
aria-hidden="true"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M6 2a2 2 0 0 0-2 2v15a3 3 0 0 0 3 3h12a1 1 0 1 0 0-2h-2v-2h2a1 1 0 0 0 1-1V4a2 2 0 0 0-2-2h-8v16h5v2H7a1 1 0 1 1 0-2h1V2H6Z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -50,7 +66,9 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
|
|||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Publisher</dt>
|
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Publisher</dt>
|
||||||
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">{@book.publisher.name}</dd>
|
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">
|
||||||
|
{@book.publisher.name}
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Published</dt>
|
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Published</dt>
|
||||||
@@ -71,7 +89,9 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
|
|||||||
<dl>
|
<dl>
|
||||||
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Identifiers</dt>
|
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Identifiers</dt>
|
||||||
<%= for bid <- @book.bids do %>
|
<%= for bid <- @book.bids do %>
|
||||||
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">{bid.type}: {bid.bid}</dd>
|
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">
|
||||||
|
{bid.type}: {bid.bid}
|
||||||
|
</dd>
|
||||||
<% end %>
|
<% end %>
|
||||||
</dl>
|
</dl>
|
||||||
<%= if not is_nil(@book.dbi_server) do %>
|
<%= if not is_nil(@book.dbi_server) do %>
|
||||||
@@ -96,10 +116,7 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do
|
|||||||
<h1 class="text-lg font-semibold leading-8 text-zinc-800 dark:text-white">Editions</h1>
|
<h1 class="text-lg font-semibold leading-8 text-zinc-800 dark:text-white">Editions</h1>
|
||||||
<div class="flex flex-wrap flex-[3_1_auto]">
|
<div class="flex flex-wrap flex-[3_1_auto]">
|
||||||
<%= for book <- @alternative_editions do %>
|
<%= for book <- @alternative_editions do %>
|
||||||
<.book_card
|
<.book_card book={book} current_user={@current_user} />
|
||||||
book={book}
|
|
||||||
current_user={@current_user}
|
|
||||||
/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -73,12 +73,7 @@ defmodule DecentralisedBookIndexWeb.DbiServerLive.Index do
|
|||||||
</:action>
|
</:action>
|
||||||
</.table>
|
</.table>
|
||||||
|
|
||||||
<.pagination
|
<.pagination endpoint={~p"/servers"} page={@page} page_params={@page_params} params={@params} />
|
||||||
endpoint={~p"/servers"}
|
|
||||||
page={@page}
|
|
||||||
page_params={@page_params}
|
|
||||||
params={@params}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
@@ -87,7 +82,10 @@ defmodule DecentralisedBookIndexWeb.DbiServerLive.Index do
|
|||||||
@impl true
|
@impl true
|
||||||
def mount(_params, _session, socket) do
|
def mount(_params, _session, socket) do
|
||||||
if connected?(socket) do
|
if connected?(socket) do
|
||||||
Phoenix.PubSub.subscribe(DecentralisedBookIndex.PubSub, DecentralisedBookIndex.SyncWorkerManual.topic())
|
Phoenix.PubSub.subscribe(
|
||||||
|
DecentralisedBookIndex.PubSub,
|
||||||
|
DecentralisedBookIndex.SyncWorkerManual.topic()
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
{:ok,
|
{:ok,
|
||||||
|
|||||||
@@ -27,7 +27,9 @@ defmodule DecentralisedBookIndexWeb.DbiServerLive.Show do
|
|||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Sync on?</dt>
|
<dt class="mb-2 font-semibold leading-none text-gray-900 dark:text-white">Sync on?</dt>
|
||||||
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">{@dbi_server.sync_on?}</dd>
|
<dd class="mb-4 font-light text-gray-500 sm:mb-5 dark:text-gray-400">
|
||||||
|
{@dbi_server.sync_on?}
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<%= if not is_nil(@dbi_server.dbi_server) do %>
|
<%= if not is_nil(@dbi_server.dbi_server) do %>
|
||||||
<dl>
|
<dl>
|
||||||
@@ -57,7 +59,10 @@ defmodule DecentralisedBookIndexWeb.DbiServerLive.Show do
|
|||||||
|> assign(:page_title, page_title(socket.assigns.live_action))
|
|> assign(:page_title, page_title(socket.assigns.live_action))
|
||||||
|> assign(
|
|> assign(
|
||||||
:dbi_server,
|
:dbi_server,
|
||||||
Ash.get!(DecentralisedBookIndex.Metadata.DBIServer, id, load: [:dbi_server], actor: socket.assigns.current_user)
|
Ash.get!(DecentralisedBookIndex.Metadata.DBIServer, id,
|
||||||
|
load: [:dbi_server],
|
||||||
|
actor: socket.assigns.current_user
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ defmodule DecentralisedBookIndexWeb.PublisherLive.Show do
|
|||||||
|> assign(:page_title, page_title(socket.assigns.live_action))
|
|> assign(:page_title, page_title(socket.assigns.live_action))
|
||||||
|> assign(
|
|> assign(
|
||||||
:publisher,
|
:publisher,
|
||||||
Ash.get!(DecentralisedBookIndex.Metadata.Publisher, id, load: [:dbi_server], actor: socket.assigns.current_user)
|
Ash.get!(DecentralisedBookIndex.Metadata.Publisher, id,
|
||||||
|
load: [:dbi_server],
|
||||||
|
actor: socket.assigns.current_user
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,7 @@ defmodule DecentralisedBookIndexWeb.UserLive.Index do
|
|||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="pt-2 flex flex-col gap-2">
|
<div class="pt-2 flex flex-col gap-2">
|
||||||
<.table
|
<.table id="users" rows={@users} row_click={fn user -> JS.navigate(~p"/users/#{user}") end}>
|
||||||
id="users"
|
|
||||||
rows={@users}
|
|
||||||
row_click={fn user -> JS.navigate(~p"/users/#{user}") end}
|
|
||||||
>
|
|
||||||
<:col :let={user} label="Email">{user.email}</:col>
|
<:col :let={user} label="Email">{user.email}</:col>
|
||||||
|
|
||||||
<:col :let={user} label="Role">{user.role}</:col>
|
<:col :let={user} label="Role">{user.role}</:col>
|
||||||
@@ -48,12 +44,7 @@ defmodule DecentralisedBookIndexWeb.UserLive.Index do
|
|||||||
</:action>
|
</:action>
|
||||||
</.table>
|
</.table>
|
||||||
|
|
||||||
<.pagination
|
<.pagination endpoint={~p"/servers"} page={@page} page_params={@page_params} params={@params} />
|
||||||
endpoint={~p"/servers"}
|
|
||||||
page={@page}
|
|
||||||
page_params={@page_params}
|
|
||||||
params={@params}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user