<%= gettext("Range day") %>

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

<%= gettext("No ammo staged") %> <%= display_emoji("😔") %>

<%= live_patch(dgettext("actions", "Why not get some ready to shoot?"), to: Routes.ammo_group_index_path(Endpoint, :index), class: "btn btn-primary" ) %> <% else %> <%= live_patch(dgettext("actions", "Stage ammo"), to: Routes.ammo_group_index_path(Endpoint, :index), class: "btn btn-primary" ) %> <%= for ammo_group <- @ammo_groups do %> <.ammo_group_card ammo_group={ammo_group}> <%= live_patch(dgettext("actions", "Record shots"), to: Routes.range_index_path(Endpoint, :add_shot_group, ammo_group), class: "btn btn-primary" ) %> <% end %> <% end %>
<%= if @shot_groups |> Enum.empty?() do %>

<%= gettext("No shots recorded") %> <%= display_emoji("😔") %>

<% else %>

<%= gettext("Shot log") %>

<%= for shot_group <- @shot_groups do %> <% end %>
<%= gettext("Ammo") %> <%= gettext("Rounds shot") %> <%= gettext("Notes") %> <%= gettext("Date") %>
<%= live_patch(shot_group.ammo_group.ammo_type.name, to: Routes.ammo_group_show_path(Endpoint, :show, shot_group.ammo_group), class: "link" ) %> <%= shot_group.count %> <%= shot_group.notes %> <%= shot_group.date |> display_date() %>
<%= live_patch to: Routes.range_index_path(Endpoint, :edit, shot_group), class: "text-primary-500 link" do %> <% end %> <%= link to: "#", class: "text-primary-500 link", phx_click: "delete", phx_value_id: shot_group.id, data: [confirm: dgettext("prompts", "Are you sure you want to delete this shot record?")] do %> <% end %>
<% end %>
<%= if @live_action in [:edit] do %> <.modal return_to={Routes.range_index_path(Endpoint, :index)}> <.live_component module={CanneryWeb.RangeLive.FormComponent} id={@shot_group.id} title={@page_title} action={@live_action} shot_group={@shot_group} return_to={Routes.range_index_path(Endpoint, :index)} current_user={@current_user} /> <% end %> <%= if @live_action in [:add_shot_group] do %> <.modal return_to={Routes.range_index_path(Endpoint, :index)}> <.live_component module={CanneryWeb.Components.AddShotGroupComponent} id={:new} title={@page_title} action={@live_action} ammo_group={@ammo_group} return_to={Routes.range_index_path(Endpoint, :index)} current_user={@current_user} /> <% end %>