<%= @pack.ammo_type.name %>

<%= gettext("Count:") %> <%= @pack.count %> <%= gettext("Original count:") %> <%= @original_count %> <%= gettext("Percentage left:") %> <%= gettext("%{percentage}%", percentage: @percentage_remaining) %> <%= if @pack.notes do %> <%= gettext("Notes:") %> <%= @pack.notes %> <% end %> <%= gettext("Purchased on:") %> <.date id={"#{@pack.id}-purchased-on"} date={@pack.purchased_on} /> <%= if @pack.price_paid do %> <%= gettext("Original cost:") %> <%= gettext("$%{amount}", amount: display_currency(@pack.price_paid)) %> <%= gettext("Current value:") %> <%= gettext("$%{amount}", amount: display_currency(@pack.price_paid * @percentage_remaining / 100) ) %> <% end %>
<.link navigate={Routes.ammo_type_show_path(Endpoint, :show, @pack.ammo_type)} class="mx-4 my-2 btn btn-primary" > <%= dgettext("actions", "View in Catalog") %> <.link patch={Routes.pack_show_path(Endpoint, :edit, @pack)} class="mx-4 my-2 text-primary-600 link" aria-label={ dgettext("actions", "Edit ammo group of %{pack_count} bullets", pack_count: @pack.count) } > <.link href="#" class="mx-4 my-2 text-primary-600 link" phx-click="delete" data-confirm={dgettext("prompts", "Are you sure you want to delete this ammo?")} aria-label={ dgettext("actions", "Delete ammo group of %{pack_count} bullets", pack_count: @pack.count ) } >
<.link patch={Routes.pack_show_path(Endpoint, :move, @pack)} class="btn btn-primary"> <%= dgettext("actions", "Move ammo") %> <.link patch={Routes.pack_show_path(Endpoint, :add_shot_group, @pack)} class="mx-4 my-2 btn btn-primary" > <%= dgettext("actions", "Record shots") %>

<%= if @container do %>

<%= gettext("Stored in") %>

<.container_card container={@container} current_user={@current_user} /> <% else %> <%= gettext("This ammo is not in a container") %> <% end %>
<%= unless @shot_groups |> Enum.empty?() do %>

<%= gettext("Rounds used") %>

<.live_component module={CanneryWeb.Components.TableComponent} id="pack_shot_groups_table" columns={@columns} rows={@rows} /> <% end %>
<%= case @live_action do %> <% :edit -> %> <.modal return_to={Routes.pack_show_path(Endpoint, :show, @pack)}> <.live_component module={CanneryWeb.PackLive.FormComponent} id={@pack.id} title={@page_title} action={@live_action} pack={@pack} return_to={Routes.pack_show_path(Endpoint, :show, @pack)} current_user={@current_user} /> <% :edit_shot_group -> %> <.modal return_to={Routes.pack_show_path(Endpoint, :show, @pack)}> <.live_component module={CanneryWeb.RangeLive.FormComponent} id={@shot_group.id} title={@page_title} action={@live_action} shot_group={@shot_group} return_to={Routes.pack_show_path(Endpoint, :show, @pack)} current_user={@current_user} /> <% :add_shot_group -> %> <.modal return_to={Routes.pack_show_path(Endpoint, :show, @pack)}> <.live_component module={CanneryWeb.Components.AddShotGroupComponent} id={:new} title={@page_title} action={@live_action} pack={@pack} return_to={Routes.pack_show_path(Endpoint, :show, @pack)} current_user={@current_user} /> <% :move -> %> <.modal return_to={Routes.pack_show_path(Endpoint, :show, @pack)}> <.live_component module={CanneryWeb.Components.MovePackComponent} id={@pack.id} title={@page_title} action={@live_action} pack={@pack} return_to={Routes.pack_show_path(Endpoint, :show, @pack)} current_user={@current_user} /> <% _show -> %> <% end %>