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

40 lines
1.2 KiB
Plaintext

<h1>Listing Ammo groups</h1>
<%= if @live_action in [:new, :edit] do %>
<%= live_modal CanneryWeb.AmmoGroupLive.FormComponent,
id: @ammo_group.id || :new,
title: @page_title,
action: @live_action,
ammo_group: @ammo_group,
return_to: Routes.ammo_group_index_path(@socket, :index) %>
<% end %>
<table>
<thead>
<tr>
<th>Count</th>
<th>Price paid</th>
<th>Notes</th>
<th></th>
</tr>
</thead>
<tbody id="ammo_groups">
<%= for ammo_group <- @ammo_groups do %>
<tr id="ammo_group-<%= ammo_group.id %>">
<td><%= ammo_group.count %></td>
<td><%= ammo_group.price_paid %></td>
<td><%= ammo_group.notes %></td>
<td>
<span><%= live_redirect "Show", to: Routes.ammo_group_show_path(@socket, :show, ammo_group) %></span>
<span><%= live_patch "Edit", to: Routes.ammo_group_index_path(@socket, :edit, ammo_group) %></span>
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: ammo_group.id, data: [confirm: "Are you sure?"] %></span>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= live_patch "New Ammo group", to: Routes.ammo_group_index_path(@socket, :new) %></span>