46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
<h1>Listing Ammo types</h1>
|
|
|
|
<%= if @live_action in [:new, :edit] do %>
|
|
<%= live_modal CanneryWeb.AmmoTypeLive.FormComponent,
|
|
id: @ammo_type.id || :new,
|
|
title: @page_title,
|
|
action: @live_action,
|
|
ammo_type: @ammo_type,
|
|
return_to: Routes.ammo_type_index_path(@socket, :index) %>
|
|
<% end %>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Desc</th>
|
|
<th>Case material</th>
|
|
<th>Bullet type</th>
|
|
<th>Weight</th>
|
|
<th>Manufacturer</th>
|
|
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="ammo_types">
|
|
<%= for ammo_type <- @ammo_types do %>
|
|
<tr id="ammo_type-<%= ammo_type.id %>">
|
|
<td><%= ammo_type.name %></td>
|
|
<td><%= ammo_type.desc %></td>
|
|
<td><%= ammo_type.case_material %></td>
|
|
<td><%= ammo_type.bullet_type %></td>
|
|
<td><%= ammo_type.weight %></td>
|
|
<td><%= ammo_type.manufacturer %></td>
|
|
|
|
<td>
|
|
<span><%= live_redirect "Show", to: Routes.ammo_type_show_path(@socket, :show, ammo_type) %></span>
|
|
<span><%= live_patch "Edit", to: Routes.ammo_type_index_path(@socket, :edit, ammo_type) %></span>
|
|
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: ammo_type.id, data: [confirm: "Are you sure?"] %></span>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<span><%= live_patch "New Ammo type", to: Routes.ammo_type_index_path(@socket, :new) %></span>
|