29 lines
809 B
Plaintext
29 lines
809 B
Plaintext
|
<.header>
|
||
|
Todo <%= @todo.id %>
|
||
|
<:subtitle>This is a todo record from your database.</:subtitle>
|
||
|
<:actions>
|
||
|
<.link patch={~p"/todos/#{@todo}/show/edit"} phx-click={JS.push_focus()}>
|
||
|
<.button>Edit todo</.button>
|
||
|
</.link>
|
||
|
</:actions>
|
||
|
</.header>
|
||
|
|
||
|
<.list>
|
||
|
<:item title="Description"><%= @todo.description %></:item>
|
||
|
<:item title="Emoji"><%= @todo.emoji %></:item>
|
||
|
<:item title="Completed at"><%= @todo.completed_at %></:item>
|
||
|
</.list>
|
||
|
|
||
|
<.back navigate={~p"/todos"}>Back to todos</.back>
|
||
|
|
||
|
<.modal :if={@live_action == :edit} id="todo-modal" show on_cancel={JS.patch(~p"/todos/#{@todo}")}>
|
||
|
<.live_component
|
||
|
module={HomemanWeb.TodoLive.FormComponent}
|
||
|
id={@todo.id}
|
||
|
title={@page_title}
|
||
|
action={@live_action}
|
||
|
todo={@todo}
|
||
|
patch={~p"/todos/#{@todo}"}
|
||
|
/>
|
||
|
</.modal>
|