{@container.name}

{gettext("Description:")} {@container.desc} {gettext("Type:")} {@container.type} {gettext("Location:")} {@container.location} {gettext("Packs:")} {@packs_count} {gettext("Rounds:")} {@round_count}
<.link patch={~p"/container/edit/#{@container}"} class="text-primary-600 link" aria-label={dgettext("actions", "Edit %{container_name}", container_name: @container.name)} > <.link href="#" class="text-primary-600 link" phx-click="delete_container" data-confirm={ dgettext("prompts", "Are you sure you want to delete %{name}?", name: @container.name) } aria-label={ dgettext("actions", "Delete %{container_name}", container_name: @container.name) } >

<%= if @container.tags |> Enum.empty?() do %>

{gettext("No tags for this container")} {display_emoji("😔")}

<.link patch={~p"/container/edit_tags/#{@container}"} class="btn btn-primary"> {dgettext("actions", "Why not add one?")}
<% else %>
<.simple_tag_card :for={tag <- @container.tags} tag={tag} />
<.link patch={~p"/container/edit_tags/#{@container}"} class="text-primary-600 link">
<% end %>
<.form :let={f} for={%{}} as={:type} phx-change="change_class" phx-submit="change_class" class="flex items-center" > {label(f, :class, gettext("Class"), class: "title text-primary-600 text-lg text-center")} {select( f, :class, [ {gettext("All"), :all}, {gettext("Rifle"), :rifle}, {gettext("Shotgun"), :shotgun}, {gettext("Pistol"), :pistol} ], class: "mx-2 my-1 min-w-20 input input-primary", value: @class )} <.toggle_button action="toggle_table" value={@view_table}> {gettext("View as table")}
<%= if @packs |> Enum.empty?() do %>

{gettext("No ammo in this container")}

<% else %> <%= if @view_table do %> <.live_component module={CanneryWeb.Components.PackTableComponent} id="pack-show-table" packs={@packs} current_user={@current_user} show_used={false} > <:type :let={%{name: type_name} = type}> <.link navigate={~p"/type/#{type}"} class="link"> {type_name} <:actions :let={%{count: pack_count} = pack}>
<.link navigate={~p"/ammo/show/#{pack}"} class="text-primary-600 link" aria-label={ dgettext("actions", "View pack of %{pack_count} bullets", pack_count: pack_count ) } >
<% else %>
<.pack_card :for={%{id: pack_id} = pack <- @packs} pack={pack} original_count={Map.fetch!(@original_counts, pack_id)} cpr={Map.get(@cprs, pack_id)} last_used_date={Map.get(@last_used_dates, pack_id)} current_user={@current_user} />
<% end %> <% end %>
<%= case @live_action do %> <% :edit -> %> <.modal return_to={~p"/container/#{@container}"}> <.live_component module={CanneryWeb.ContainerLive.FormComponent} id={@container.id} title={@page_title} action={@live_action} container={@container} return_to={~p"/container/#{@container}"} current_user={@current_user} /> <% :edit_tags -> %> <.modal return_to={~p"/container/#{@container}"}> <.live_component module={CanneryWeb.ContainerLive.EditTagsComponent} id={@container.id} title={@page_title} action={@live_action} container={@container} return_to={~p"/container/#{@container}"} current_path={~p"/container/edit_tags/#{@container}"} current_user={@current_user} /> <% _ -> %> <% end %>