<.header> Listing Authors <:actions> <.link patch={~p"/authors/new"}> <.button>New Author <.table id="authors" rows={@authors} row_click={&JS.navigate(~p"/authors/#{&1}")}> <:col :let={author} label="Name"><%= author.name %> <:col :let={author} label="Description"><%= author.description %> <:col :let={author} label="Homepage name"><%= author.homepage_name %> <:col :let={author} label="Homepage url"><%= author.homepage_url %> <:action :let={author}>
<.link navigate={~p"/authors/#{author}"}>Show
<.link patch={~p"/authors/#{author}/edit"}>Edit <:action :let={author}> <.link phx-click={JS.push("delete", value: %{id: author.id})} data-confirm="Are you sure?"> Delete <:action :let={author}> <.link navigate={~p"/articles/new?author_id=#{author}"}> New article <.modal :if={@live_action in [:new, :edit]} id="author-modal" show on_cancel={JS.navigate(~p"/authors")} > <.live_component module={OutlookWeb.AuthorLive.FormComponent} id={@author.id || :new} title={@page_title} action={@live_action} author={@author} navigate={~p"/authors"} />