cannery/lib/cannery_web/live/container_live/index.html.leex

42 lines
1.2 KiB
Plaintext

<h1>Listing Containers</h1>
<%= if @live_action in [:new, :edit] do %>
<%= live_modal CanneryWeb.ContainerLive.FormComponent,
id: @container.id || :new,
title: @page_title,
action: @live_action,
container: @container,
return_to: Routes.container_index_path(@socket, :index) %>
<% end %>
<table>
<thead>
<tr>
<th>Name</th>
<th>Desc</th>
<th>Type</th>
<th>Location</th>
<th></th>
</tr>
</thead>
<tbody id="containers">
<%= for container <- @containers do %>
<tr id="container-<%= container.id %>">
<td><%= container.name %></td>
<td><%= container.desc %></td>
<td><%= container.type %></td>
<td><%= container.location %></td>
<td>
<span><%= live_redirect "Show", to: Routes.container_show_path(@socket, :show, container) %></span>
<span><%= live_patch "Edit", to: Routes.container_index_path(@socket, :edit, container) %></span>
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: container.id, data: [confirm: "Are you sure?"] %></span>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= live_patch "New Container", to: Routes.container_index_path(@socket, :new) %></span>