39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
<h1>Listing Prompt requests</h1>
|
|
|
|
<%= if @live_action in [:new, :edit] do %>
|
|
<.modal return_to={Routes.prompt_request_index_path(@socket, :index)}>
|
|
<.live_component
|
|
module={DiffuserWeb.PromptRequestLive.FormComponent}
|
|
id={@prompt_request.id || :new}
|
|
title={@page_title}
|
|
action={@live_action}
|
|
prompt_request={@prompt_request}}
|
|
/>
|
|
</.modal>
|
|
<% end %>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Prompt</th>
|
|
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="prompt_requests">
|
|
<%= for prompt_request <- @prompt_requests do %>
|
|
<tr id={"prompt_request-#{prompt_request.id}"}>
|
|
<td><%= prompt_request.prompt %></td>
|
|
|
|
<td>
|
|
<span><%= live_redirect "Show", to: Routes.prompt_request_show_path(@socket, :show, prompt_request) %></span>
|
|
<span><%= live_patch "Edit", to: Routes.prompt_request_index_path(@socket, :edit, prompt_request) %></span>
|
|
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: prompt_request.id, data: [confirm: "Are you sure?"] %></span>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<span><%= live_patch "New Prompt request", to: Routes.prompt_request_index_path(@socket, :new) %></span>
|