<.header> Listing Dings <:actions> <.link patch={~p"/dings/new"}> <.button>New Ding <.table id="dings" rows={@streams.dings} row_click={fn {_id, ding} -> JS.navigate(~p"/dings/#{ding}") end} > <:col :let={{_id, ding}} label="Title"><%= ding.title %> <:col :let={{_id, ding}} label="Count"><%= ding.count %> <:col :let={{_id, ding}} label="Target count"><%= ding.target_count %> <:col :let={{_id, ding}} label="Ding type"><%= ding.ding_type %> <:col :let={{_id, ding}} label="Target type"><%= ding.target_type %> <:col :let={{_id, ding}} label="Status"><%= ding.status %> <:action :let={{_id, ding}}>
<.link navigate={~p"/dings/#{ding}"}>Show
<.link patch={~p"/dings/#{ding}/edit"}>Edit <:action :let={{id, ding}}> <.link phx-click={JS.push("delete", value: %{id: ding.id}) |> hide("##{id}")} data-confirm="Are you sure?" > Delete <.modal :if={@live_action in [:new, :edit]} id="ding-modal" show on_cancel={JS.patch(~p"/dings")}> <.live_component module={DingeWeb.DingLive.FormComponent} id={@ding.id || :new} title={@page_title} action={@live_action} ding={@ding} user={@current_user} patch={~p"/dings"} />