|
|
|
@ -21,19 +21,11 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|
|
|
|
<%= if @form.source.type == :create do %>
|
|
|
|
|
<.input field={@form[:title]} type="text" label="Title" />
|
|
|
|
|
<.input field={@form[:cover_image_url]} type="text" label="Cover image url" />
|
|
|
|
|
<.input
|
|
|
|
|
field={@form[:description]}
|
|
|
|
|
type="textarea"
|
|
|
|
|
label="Description"
|
|
|
|
|
/>
|
|
|
|
|
<.input field={@form[:description]} type="textarea" label="Description" />
|
|
|
|
|
<.bids_inputs form={@form} myself={@myself} />
|
|
|
|
|
<.author_roles_inputs form={@form} myself={@myself} notify_component={@myself} />
|
|
|
|
|
<.input field={@form[:format]} type="text" label="Format" />
|
|
|
|
|
<.input
|
|
|
|
|
field={@form[:language]}
|
|
|
|
|
type="text"
|
|
|
|
|
label="Language"
|
|
|
|
|
/>
|
|
|
|
|
<.input field={@form[:language]} type="text" label="Language" />
|
|
|
|
|
<.input field={@form[:page_count]} type="number" label="Page count" />
|
|
|
|
|
<div>
|
|
|
|
|
<.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 %>
|
|
|
|
|
<.input field={@form[:title]} type="text" label="Title" />
|
|
|
|
|
<.input field={@form[:cover_image_url]} type="text" label="Cover image url" />
|
|
|
|
|
<.input
|
|
|
|
|
field={@form[:description]}
|
|
|
|
|
type="textarea"
|
|
|
|
|
label="Description"
|
|
|
|
|
/>
|
|
|
|
|
<.input field={@form[:description]} type="textarea" label="Description" />
|
|
|
|
|
<.bids_inputs form={@form} myself={@myself} />
|
|
|
|
|
<.author_roles_inputs form={@form} myself={@myself} notify_component={@myself} />
|
|
|
|
|
<.input field={@form[:format]} type="text" label="Format" />
|
|
|
|
|
<.input
|
|
|
|
|
field={@form[:language]}
|
|
|
|
|
type="text"
|
|
|
|
|
label="Language"
|
|
|
|
|
/>
|
|
|
|
|
<.input field={@form[:language]} type="text" label="Language" />
|
|
|
|
|
<.input field={@form[:page_count]} type="number" label="Page count" />
|
|
|
|
|
<div>
|
|
|
|
|
<.input field={@form[:publisher_id]} type="text" label="Publisher" type="hidden" show_errors?={false} />
|
|
|
|
@ -145,16 +129,30 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|
|
|
|
<tbody phx-hook="bidSort" id="bidSort" phx-target={@myself}>
|
|
|
|
|
<.inputs_for :let={bid_form} field={@form[:bids]}>
|
|
|
|
|
<tr data-id={bid_form.index}>
|
|
|
|
|
<td class="px-3 w-10 pt-2">
|
|
|
|
|
<svg class="w-6 h-6 text-gray-800 dark:text-white handle cursor-pointer" 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="m8 15 4 4 4-4m0-6-4-4-4 4"/>
|
|
|
|
|
<td class="px-3 w-10 h-10 pt-2 align-top group">
|
|
|
|
|
<svg
|
|
|
|
|
class="w-6 h-6 text-gray-800 dark:text-white handle cursor-pointer mt-2"
|
|
|
|
|
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="m8 15 4 4 4-4m0-6-4-4-4 4"
|
|
|
|
|
/>
|
|
|
|
|
</svg>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-3 w-36">
|
|
|
|
|
<td class="px-3 w-36 align-top group">
|
|
|
|
|
<label for={bid_form[:type].id} class="hidden">Type</label>
|
|
|
|
|
<.input field={bid_form[:type]} />
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-3">
|
|
|
|
|
<td class="px-3 align-top group">
|
|
|
|
|
<label for={bid_form[:bid].id} class="hidden">Id</label>
|
|
|
|
|
<.input field={bid_form[:bid]} />
|
|
|
|
|
</td>
|
|
|
|
@ -167,8 +165,20 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|
|
|
|
size="xs"
|
|
|
|
|
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">
|
|
|
|
|
<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
|
|
|
|
|
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>
|
|
|
|
|
</.button_link>
|
|
|
|
|
</td>
|
|
|
|
@ -229,12 +239,26 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|
|
|
|
<tbody phx-hook="authorRoleSort" id="authorRoleSort" phx-target={@myself}>
|
|
|
|
|
<.inputs_for :let={author_roles_form} field={@form[:author_roles]}>
|
|
|
|
|
<tr data-id={author_roles_form.index}>
|
|
|
|
|
<td class="px-3 w-10 pt-2">
|
|
|
|
|
<svg class="w-6 h-6 text-gray-800 dark:text-white handle cursor-pointer" 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="m8 15 4 4 4-4m0-6-4-4-4 4"/>
|
|
|
|
|
<td class="px-3 w-10 pt-2 align-top group">
|
|
|
|
|
<svg
|
|
|
|
|
class="w-6 h-6 text-gray-800 dark:text-white handle cursor-pointer mt-2"
|
|
|
|
|
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="m8 15 4 4 4-4m0-6-4-4-4 4"
|
|
|
|
|
/>
|
|
|
|
|
</svg>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-3 w-48">
|
|
|
|
|
<td class="px-3 w-48 align-top group">
|
|
|
|
|
<label for={author_roles_form[:author_id].id} class="hidden">Type</label>
|
|
|
|
|
<.input field={author_roles_form[:author_id]} type="hidden" show_errors?={false} />
|
|
|
|
|
<.selected_author
|
|
|
|
@ -244,7 +268,7 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|
|
|
|
class="mt-2 w-full"
|
|
|
|
|
/>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-3">
|
|
|
|
|
<td class="px-3 align-top group">
|
|
|
|
|
<label for={author_roles_form[:role].id} class="hidden">Id</label>
|
|
|
|
|
<.input field={author_roles_form[:role]} />
|
|
|
|
|
</td>
|
|
|
|
@ -257,8 +281,20 @@ defmodule DecentralisedBookIndexWeb.BookLive.FormComponent do
|
|
|
|
|
size="xs"
|
|
|
|
|
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">
|
|
|
|
|
<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
|
|
|
|
|
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>
|
|
|
|
|
</.button_link>
|
|
|
|
|
</td>
|
|
|
|
|