Some stuff
This commit is contained in:
@@ -1,29 +1,17 @@
|
||||
<.header>
|
||||
Item <%= @item.id %>
|
||||
<%= @item.title %>
|
||||
<:subtitle>This is a item record from your database.</:subtitle>
|
||||
<:actions>
|
||||
<.link patch={~p"/items/#{@item}/show/edit"} phx-click={JS.push_focus()}>
|
||||
<.button>Edit item</.button>
|
||||
</.link>
|
||||
</:actions>
|
||||
</.header>
|
||||
|
||||
<.list>
|
||||
<:item title="Title"><%= @item.title %></:item>
|
||||
<:item title="Description"><%= @item.description %></:item>
|
||||
<:item title="Url"><%= @item.url %></:item>
|
||||
<:item title="Desire"><%= @item.desire %></:item>
|
||||
</.list>
|
||||
<.simple_form for={@form} id="item-form" phx-change="validate" phx-submit="save">
|
||||
<.input field={@form[:title]} type="text" label="Title" />
|
||||
<.input field={@form[:description]} type="text" label="Description" />
|
||||
<.input field={@form[:url]} type="text" label="Url" />
|
||||
<.input field={@form[:image_url]} type="text" label="Image URL" />
|
||||
<.input field={@form[:desire]} type="number" label="Desire" />
|
||||
<:actions>
|
||||
<.button phx-disable-with="Saving...">Save Item</.button>
|
||||
</:actions>
|
||||
</.simple_form>
|
||||
|
||||
<.back navigate={~p"/items"}>Back to items</.back>
|
||||
|
||||
<.modal :if={@live_action == :edit} id="item-modal" show on_cancel={JS.patch(~p"/items/#{@item}")}>
|
||||
<.live_component
|
||||
module={WishWeb.ItemLive.FormComponent}
|
||||
id={@item.id}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
item={@item}
|
||||
patch={~p"/items/#{@item}"}
|
||||
/>
|
||||
</.modal>
|
||||
|
||||
Reference in New Issue
Block a user