rename ammo_type type to class

This commit is contained in:
shibao 2023-03-28 23:08:40 -04:00
parent 1e645b5bb8
commit 0cae7c2940
48 changed files with 412 additions and 372 deletions

View File

@ -1,4 +1,5 @@
# v0.9.1
- Rename ammo_type's type to class to avoid confusion
- Code quality improvements
# v0.9.0

View File

@ -23,8 +23,8 @@ defmodule Cannery.ActivityLog do
[%ShotGroup{notes: "Shot some rifle rounds"}, ...]
"""
@spec list_shot_groups(AmmoType.type() | :all, User.t()) :: [ShotGroup.t()]
@spec list_shot_groups(search :: nil | String.t(), AmmoType.type() | :all, User.t()) ::
@spec list_shot_groups(AmmoType.class() | :all, User.t()) :: [ShotGroup.t()]
@spec list_shot_groups(search :: nil | String.t(), AmmoType.class() | :all, User.t()) ::
[ShotGroup.t()]
def list_shot_groups(search \\ nil, type, %{id: user_id}) do
from(sg in ShotGroup,
@ -79,16 +79,16 @@ defmodule Cannery.ActivityLog do
})
end
@spec list_shot_groups_filter_type(Queryable.t(), AmmoType.type() | :all) ::
@spec list_shot_groups_filter_type(Queryable.t(), AmmoType.class() | :all) ::
Queryable.t()
defp list_shot_groups_filter_type(query, :rifle),
do: query |> where([at: at], at.type == :rifle)
do: query |> where([at: at], at.class == :rifle)
defp list_shot_groups_filter_type(query, :pistol),
do: query |> where([at: at], at.type == :pistol)
do: query |> where([at: at], at.class == :pistol)
defp list_shot_groups_filter_type(query, :shotgun),
do: query |> where([at: at], at.type == :shotgun)
do: query |> where([at: at], at.class == :shotgun)
defp list_shot_groups_filter_type(query, _all), do: query

View File

@ -24,11 +24,11 @@ defmodule Cannery.Ammo do
[%AmmoType{}, ...]
iex> list_ammo_types("cool", %User{id: 123}, :shotgun)
[%AmmoType{name: "My cool ammo type", type: :shotgun}, ...]
[%AmmoType{name: "My cool ammo type", class: :shotgun}, ...]
"""
@spec list_ammo_types(User.t(), AmmoType.type() | :all) :: [AmmoType.t()]
@spec list_ammo_types(search :: nil | String.t(), User.t(), AmmoType.type() | :all) ::
@spec list_ammo_types(User.t(), AmmoType.class() | :all) :: [AmmoType.t()]
@spec list_ammo_types(search :: nil | String.t(), User.t(), AmmoType.class() | :all) ::
[AmmoType.t()]
def list_ammo_types(search \\ nil, user, type)
@ -72,14 +72,15 @@ defmodule Cannery.Ammo do
)
end
@spec list_ammo_types_filter_type(Queryable.t(), AmmoType.type() | :all) :: Queryable.t()
defp list_ammo_types_filter_type(query, :rifle), do: query |> where([at: at], at.type == :rifle)
@spec list_ammo_types_filter_type(Queryable.t(), AmmoType.class() | :all) :: Queryable.t()
defp list_ammo_types_filter_type(query, :rifle),
do: query |> where([at: at], at.class == :rifle)
defp list_ammo_types_filter_type(query, :pistol),
do: query |> where([at: at], at.type == :pistol)
do: query |> where([at: at], at.class == :pistol)
defp list_ammo_types_filter_type(query, :shotgun),
do: query |> where([at: at], at.type == :shotgun)
do: query |> where([at: at], at.class == :shotgun)
defp list_ammo_types_filter_type(query, _all), do: query
@ -463,16 +464,16 @@ defmodule Cannery.Ammo do
|> Repo.all()
end
@spec list_ammo_groups_for_container_filter_type(Queryable.t(), AmmoType.type() | :all) ::
@spec list_ammo_groups_for_container_filter_type(Queryable.t(), AmmoType.class() | :all) ::
Queryable.t()
defp list_ammo_groups_for_container_filter_type(query, :rifle),
do: query |> where([at: at], at.type == :rifle)
do: query |> where([at: at], at.class == :rifle)
defp list_ammo_groups_for_container_filter_type(query, :pistol),
do: query |> where([at: at], at.type == :pistol)
do: query |> where([at: at], at.class == :pistol)
defp list_ammo_groups_for_container_filter_type(query, :shotgun),
do: query |> where([at: at], at.type == :shotgun)
do: query |> where([at: at], at.class == :shotgun)
defp list_ammo_groups_for_container_filter_type(query, _all), do: query
@ -747,11 +748,11 @@ defmodule Cannery.Ammo do
[%AmmoGroup{notes: "My cool ammo group"}, ...]
"""
@spec list_ammo_groups(search :: String.t() | nil, AmmoType.type() | :all, User.t()) ::
@spec list_ammo_groups(search :: String.t() | nil, AmmoType.class() | :all, User.t()) ::
[AmmoGroup.t()]
@spec list_ammo_groups(
search :: nil | String.t(),
AmmoType.type() | :all,
AmmoType.class() | :all,
User.t(),
show_used :: boolean()
) :: [AmmoGroup.t()]
@ -780,15 +781,15 @@ defmodule Cannery.Ammo do
|> Repo.all()
end
@spec list_ammo_groups_filter_on_type(Queryable.t(), AmmoType.type() | :all) :: Queryable.t()
@spec list_ammo_groups_filter_on_type(Queryable.t(), AmmoType.class() | :all) :: Queryable.t()
defp list_ammo_groups_filter_on_type(query, :rifle),
do: query |> where([at: at], at.type == :rifle)
do: query |> where([at: at], at.class == :rifle)
defp list_ammo_groups_filter_on_type(query, :pistol),
do: query |> where([at: at], at.type == :pistol)
do: query |> where([at: at], at.class == :pistol)
defp list_ammo_groups_filter_on_type(query, :shotgun),
do: query |> where([at: at], at.type == :shotgun)
do: query |> where([at: at], at.class == :shotgun)
defp list_ammo_groups_filter_on_type(query, _all), do: query

View File

@ -42,7 +42,7 @@ defmodule Cannery.Ammo.AmmoType do
field :name, :string
field :desc, :string
field :type, Ecto.Enum, values: [:rifle, :shotgun, :pistol]
field :class, Ecto.Enum, values: [:rifle, :shotgun, :pistol]
# common fields
# https://shootersreference.com/reloadingdata/bullet_abbreviations/
@ -92,7 +92,7 @@ defmodule Cannery.Ammo.AmmoType do
id: id(),
name: String.t(),
desc: String.t() | nil,
type: type(),
class: class(),
bullet_type: String.t() | nil,
bullet_core: String.t() | nil,
cartridge: String.t() | nil,
@ -130,14 +130,14 @@ defmodule Cannery.Ammo.AmmoType do
@type new_ammo_type :: %__MODULE__{}
@type id :: UUID.t()
@type changeset :: Changeset.t(t() | new_ammo_type())
@type type :: :rifle | :shotgun | :pistol | nil
@type class :: :rifle | :shotgun | :pistol | nil
@spec changeset_fields() :: [atom()]
defp changeset_fields,
do: [
:name,
:desc,
:type,
:class,
:bullet_type,
:bullet_core,
:cartridge,

View File

@ -13,7 +13,7 @@ defmodule CanneryWeb.Components.AmmoTypeTableComponent do
%{
required(:id) => UUID.t(),
required(:current_user) => User.t(),
optional(:type) => AmmoType.type() | nil,
optional(:class) => AmmoType.class() | nil,
optional(:show_used) => boolean(),
optional(:ammo_types) => [AmmoType.t()],
optional(:actions) => Rendered.t(),
@ -26,7 +26,7 @@ defmodule CanneryWeb.Components.AmmoTypeTableComponent do
socket
|> assign(assigns)
|> assign_new(:show_used, fn -> false end)
|> assign_new(:type, fn -> :all end)
|> assign_new(:class, fn -> :all end)
|> assign_new(:actions, fn -> [] end)
|> display_ammo_types()
@ -39,7 +39,7 @@ defmodule CanneryWeb.Components.AmmoTypeTableComponent do
ammo_types: ammo_types,
current_user: current_user,
show_used: show_used,
type: type,
class: class,
actions: actions
}
} = socket
@ -48,7 +48,7 @@ defmodule CanneryWeb.Components.AmmoTypeTableComponent do
[
%{label: gettext("Cartridge"), key: :cartridge, type: :string},
%{
label: if(type == :shotgun, do: gettext("Gauge"), else: gettext("Caliber")),
label: if(class == :shotgun, do: gettext("Gauge"), else: gettext("Caliber")),
key: :caliber,
type: :string
},
@ -59,7 +59,7 @@ defmodule CanneryWeb.Components.AmmoTypeTableComponent do
%{label: gettext("Grains"), key: :grains, type: :string},
%{label: gettext("Bullet type"), key: :bullet_type, type: :string},
%{
label: if(type == :shotgun, do: gettext("Slug core"), else: gettext("Bullet core")),
label: if(class == :shotgun, do: gettext("Slug core"), else: gettext("Bullet core")),
key: :bullet_core,
type: :string
},
@ -147,8 +147,8 @@ defmodule CanneryWeb.Components.AmmoTypeTableComponent do
})
|> TableComponent.maybe_compose_columns(filtered_columns)
|> TableComponent.maybe_compose_columns(
%{label: gettext("Type"), key: :type, type: :atom},
type in [:all, nil]
%{label: gettext("Class"), key: :type, type: :atom},
class in [:all, nil]
)
|> TableComponent.maybe_compose_columns(%{label: gettext("Name"), key: :name, type: :name})

View File

@ -8,11 +8,16 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
@impl true
def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(type: :all, show_used: false, search: search) |> display_ammo_groups()}
socket =
socket
|> assign(class: :all, show_used: false, search: search)
|> display_ammo_groups()
{:ok, socket}
end
def mount(_params, _session, socket) do
{:ok, socket |> assign(type: :all, show_used: false, search: nil) |> display_ammo_groups()}
{:ok, socket |> assign(class: :all, show_used: false, search: nil) |> display_ammo_groups()}
end
@impl true
@ -119,26 +124,26 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
{:noreply, socket}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "rifle"}}, socket) do
{:noreply, socket |> assign(:type, :rifle) |> display_ammo_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "rifle"}}, socket) do
{:noreply, socket |> assign(:class, :rifle) |> display_ammo_groups()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:type, :shotgun) |> display_ammo_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:class, :shotgun) |> display_ammo_groups()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "pistol"}}, socket) do
{:noreply, socket |> assign(:type, :pistol) |> display_ammo_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "pistol"}}, socket) do
{:noreply, socket |> assign(:class, :pistol) |> display_ammo_groups()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => _all}}, socket) do
{:noreply, socket |> assign(:type, :all) |> display_ammo_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => _all}}, socket) do
{:noreply, socket |> assign(:class, :all) |> display_ammo_groups()}
end
defp display_ammo_groups(
%{
assigns: %{
type: type,
class: class,
search: search,
current_user: current_user,
show_used: show_used
@ -148,7 +153,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
# get total number of ammo groups to determine whether to display onboarding
# prompts
ammo_groups_count = Ammo.get_ammo_groups_count!(current_user, true)
ammo_groups = Ammo.list_ammo_groups(search, type, current_user, show_used)
ammo_groups = Ammo.list_ammo_groups(search, class, current_user, show_used)
ammo_types_count = Ammo.get_ammo_types_count!(current_user)
containers_count = Containers.get_containers_count!(current_user)

View File

@ -43,15 +43,17 @@
:let={f}
for={%{}}
as={:ammo_type}
phx-change="change_type"
phx-submit="change_type"
phx-change="change_class"
phx-submit="change_class"
class="flex items-center"
>
<%= label(f, :type, gettext("Type"), class: "title text-primary-600 text-lg text-center") %>
<%= label(f, :class, gettext("Class"),
class: "title text-primary-600 text-lg text-center"
) %>
<%= select(
f,
:type,
:class,
[
{gettext("All"), :all},
{gettext("Rifle"), :rifle},
@ -59,7 +61,7 @@
{gettext("Pistol"), :pistol}
],
class: "mx-2 my-1 min-w-md input input-primary",
value: @type
value: @class
) %>
</.form>

View File

@ -18,15 +18,15 @@
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</div>
<%= label(f, :type, gettext("Type"), class: "title text-lg text-primary-600") %>
<%= label(f, :class, gettext("Class"), class: "title text-lg text-primary-600") %>
<%= select(
f,
:type,
:class,
[{gettext("Rifle"), :rifle}, {gettext("Shotgun"), :shotgun}, {gettext("Pistol"), :pistol}],
class: "text-center col-span-2 input input-primary",
maxlength: 255
) %>
<%= error_tag(f, :type, "col-span-3 text-center") %>
<%= error_tag(f, :class, "col-span-3 text-center") %>
<%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :name,
@ -48,7 +48,7 @@
<%= gettext("Dimensions") %>
</h2>
<%= if Changeset.get_field(@changeset, :type) in [:rifle, :pistol] do %>
<%= if Changeset.get_field(@changeset, :class) in [:rifle, :pistol] do %>
<%= label(f, :cartridge, gettext("Cartridge"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :cartridge,
class: "text-center col-span-2 input input-primary",
@ -63,7 +63,7 @@
<%= label(
f,
:caliber,
if(Changeset.get_field(@changeset, :type) == :shotgun,
if(Changeset.get_field(@changeset, :class) == :shotgun,
do: gettext("Gauge"),
else: gettext("Caliber")
),
@ -76,7 +76,7 @@
) %>
<%= error_tag(f, :caliber, "col-span-3 text-center") %>
<%= if Changeset.get_field(@changeset, :type) == :shotgun do %>
<%= if Changeset.get_field(@changeset, :class) == :shotgun do %>
<%= label(f, :unfired_length, gettext("Unfired shell length"),
class: "title text-lg text-primary-600"
) %>
@ -139,7 +139,7 @@
<%= label(
f,
:bullet_core,
if(Changeset.get_field(@changeset, :type) == :shotgun,
if(Changeset.get_field(@changeset, :class) == :shotgun,
do: gettext("Slug core"),
else: gettext("Bullet core")
),
@ -152,7 +152,7 @@
) %>
<%= error_tag(f, :bullet_core, "col-span-3 text-center") %>
<%= if Changeset.get_field(@changeset, :type) in [:rifle, :pistol] do %>
<%= if Changeset.get_field(@changeset, :class) in [:rifle, :pistol] do %>
<%= label(f, :jacket_type, gettext("Jacket type"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :jacket_type,
class: "text-center col-span-2 input input-primary",
@ -172,7 +172,7 @@
) %>
<%= error_tag(f, :case_material, "col-span-3 text-center") %>
<%= if Changeset.get_field(@changeset, :type) == :shotgun do %>
<%= if Changeset.get_field(@changeset, :class) == :shotgun do %>
<%= label(f, :wadding, gettext("Wadding"), class: "title text-lg text-primary-600") %>
<%= text_input(f, :wadding,
class: "text-center col-span-2 input input-primary",
@ -240,7 +240,7 @@
) %>
<%= error_tag(f, :powder_type, "col-span-3 text-center") %>
<%= if Changeset.get_field(@changeset, :type) in [:rifle, :pistol] do %>
<%= if Changeset.get_field(@changeset, :class) in [:rifle, :pistol] do %>
<%= label(f, :powder_grains_per_charge, gettext("Powder grains per charge"),
class: "title text-lg text-primary-600"
) %>
@ -262,7 +262,7 @@
) %>
<%= error_tag(f, :pressure, "col-span-3 text-center") %>
<%= if Changeset.get_field(@changeset, :type) == :shotgun do %>
<%= if Changeset.get_field(@changeset, :class) == :shotgun do %>
<%= label(f, :dram_equivalent, gettext("Dram equivalent"),
class: "title text-lg text-primary-600"
) %>
@ -275,7 +275,7 @@
<%= hidden_input(f, :dram_equivalent, value: nil) %>
<% end %>
<%= if Changeset.get_field(@changeset, :type) in [:rifle, :pistol] do %>
<%= if Changeset.get_field(@changeset, :class) in [:rifle, :pistol] do %>
<%= label(f, :muzzle_velocity, gettext("Muzzle velocity"),
class: "title text-lg text-primary-600"
) %>

View File

@ -8,11 +8,11 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
@impl true
def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(type: :all, show_used: false, search: search) |> list_ammo_types()}
{:ok, socket |> assign(class: :all, show_used: false, search: search) |> list_ammo_types()}
end
def mount(_params, _session, socket) do
{:ok, socket |> assign(type: :all, show_used: false, search: nil) |> list_ammo_types()}
{:ok, socket |> assign(class: :all, show_used: false, search: nil) |> list_ammo_types()}
end
@impl true
@ -86,28 +86,28 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
{:noreply, socket |> push_patch(to: search_path)}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "rifle"}}, socket) do
{:noreply, socket |> assign(:type, :rifle) |> list_ammo_types()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "rifle"}}, socket) do
{:noreply, socket |> assign(:class, :rifle) |> list_ammo_types()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:type, :shotgun) |> list_ammo_types()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:class, :shotgun) |> list_ammo_types()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "pistol"}}, socket) do
{:noreply, socket |> assign(:type, :pistol) |> list_ammo_types()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "pistol"}}, socket) do
{:noreply, socket |> assign(:class, :pistol) |> list_ammo_types()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => _all}}, socket) do
{:noreply, socket |> assign(:type, :all) |> list_ammo_types()}
def handle_event("change_class", %{"ammo_type" => %{"class" => _all}}, socket) do
{:noreply, socket |> assign(:class, :all) |> list_ammo_types()}
end
defp list_ammo_types(
%{assigns: %{type: type, search: search, current_user: current_user}} = socket
%{assigns: %{class: class, search: search, current_user: current_user}} = socket
) do
socket
|> assign(
ammo_types: Ammo.list_ammo_types(search, current_user, type),
ammo_types: Ammo.list_ammo_types(search, current_user, class),
ammo_types_count: Ammo.get_ammo_types_count!(current_user)
)
end

View File

@ -22,15 +22,15 @@
:let={f}
for={%{}}
as={:ammo_type}
phx-change="change_type"
phx-submit="change_type"
phx-change="change_class"
phx-submit="change_class"
class="flex items-center"
>
<%= label(f, :type, gettext("Type"), class: "title text-primary-600 text-lg text-center") %>
<%= label(f, :class, gettext("Class"), class: "title text-primary-600 text-lg text-center") %>
<%= select(
f,
:type,
:class,
[
{gettext("All"), :all},
{gettext("Rifle"), :rifle},
@ -38,7 +38,7 @@
{gettext("Pistol"), :pistol}
],
class: "mx-2 my-1 min-w-md input input-primary",
value: @type
value: @class
) %>
</.form>
@ -79,7 +79,7 @@
ammo_types={@ammo_types}
current_user={@current_user}
show_used={@show_used}
type={@type}
class={@class}
>
<:actions :let={ammo_type}>
<div class="px-4 py-2 space-x-4 flex justify-center items-center">

View File

@ -116,11 +116,11 @@ defmodule CanneryWeb.AmmoTypeLive.Show do
socket |> display_ammo_type(ammo_type)
end
defp fields_to_display(%AmmoType{type: type}) do
defp fields_to_display(%AmmoType{class: class}) do
[
%{label: gettext("Cartridge:"), key: :cartridge, type: :string},
%{
label: if(type == :shotgun, do: gettext("Gauge:"), else: gettext("Caliber:")),
label: if(class == :shotgun, do: gettext("Gauge:"), else: gettext("Caliber:")),
key: :caliber,
type: :string
},

View File

@ -42,14 +42,14 @@
<hr class="hr" />
<%= if @ammo_type.type || @custom_fields? do %>
<%= if @ammo_type.class || @custom_fields? do %>
<div class="grid sm:grid-cols-2 gap-4 text-center justify-center items-center">
<h3 class="title text-lg">
<%= gettext("Type") %>
<%= gettext("Class") %>
</h3>
<span class="text-primary-600">
<%= case @ammo_type.type do %>
<%= case @ammo_type.class do %>
<% :shotgun -> %>
<%= gettext("Shotgun") %>
<% :rifle -> %>

View File

@ -11,13 +11,13 @@ defmodule CanneryWeb.ContainerLive.Show do
@impl true
def mount(_params, _session, socket),
do: {:ok, socket |> assign(type: :all, view_table: true)}
do: {:ok, socket |> assign(class: :all, view_table: true)}
@impl true
def handle_params(%{"id" => id}, _session, %{assigns: %{current_user: current_user}} = socket) do
socket =
socket
|> assign(view_table: true)
|> assign(:view_table, true)
|> render_container(id, current_user)
{:noreply, socket}
@ -86,30 +86,30 @@ defmodule CanneryWeb.ContainerLive.Show do
{:noreply, socket |> assign(:view_table, !view_table) |> render_container()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "rifle"}}, socket) do
{:noreply, socket |> assign(:type, :rifle) |> render_container()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "rifle"}}, socket) do
{:noreply, socket |> assign(:class, :rifle) |> render_container()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:type, :shotgun) |> render_container()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:class, :shotgun) |> render_container()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "pistol"}}, socket) do
{:noreply, socket |> assign(:type, :pistol) |> render_container()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "pistol"}}, socket) do
{:noreply, socket |> assign(:class, :pistol) |> render_container()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => _all}}, socket) do
{:noreply, socket |> assign(:type, :all) |> render_container()}
def handle_event("change_class", %{"ammo_type" => %{"class" => _all}}, socket) do
{:noreply, socket |> assign(:class, :all) |> render_container()}
end
@spec render_container(Socket.t(), Container.id(), User.t()) :: Socket.t()
defp render_container(
%{assigns: %{type: type, live_action: live_action}} = socket,
%{assigns: %{class: class, live_action: live_action}} = socket,
id,
current_user
) do
%{name: container_name} = container = Containers.get_container!(id, current_user)
ammo_groups = Ammo.list_ammo_groups_for_container(container, type, current_user)
ammo_groups = Ammo.list_ammo_groups_for_container(container, class, current_user)
original_counts = ammo_groups |> Ammo.get_original_counts(current_user)
cprs = ammo_groups |> Ammo.get_cprs(current_user)
last_used_dates = ammo_groups |> ActivityLog.get_last_used_dates(current_user)

View File

@ -90,15 +90,15 @@
:let={f}
for={%{}}
as={:ammo_type}
phx-change="change_type"
phx-submit="change_type"
phx-change="change_class"
phx-submit="change_class"
class="flex items-center"
>
<%= label(f, :type, gettext("Type"), class: "title text-primary-600 text-lg text-center") %>
<%= label(f, :class, gettext("Class"), class: "title text-primary-600 text-lg text-center") %>
<%= select(
f,
:type,
:class,
[
{gettext("All"), :all},
{gettext("Rifle"), :rifle},
@ -106,7 +106,7 @@
{gettext("Pistol"), :pistol}
],
class: "mx-2 my-1 min-w-md input input-primary",
value: @type
value: @class
) %>
</.form>

View File

@ -10,11 +10,11 @@ defmodule CanneryWeb.RangeLive.Index do
@impl true
def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(type: :all, search: search) |> display_shot_groups()}
{:ok, socket |> assign(class: :all, search: search) |> display_shot_groups()}
end
def mount(_params, _session, socket) do
{:ok, socket |> assign(type: :all, search: nil) |> display_shot_groups()}
{:ok, socket |> assign(class: :all, search: nil) |> display_shot_groups()}
end
@impl true
@ -102,27 +102,27 @@ defmodule CanneryWeb.RangeLive.Index do
{:noreply, socket |> push_patch(to: Routes.range_index_path(Endpoint, :search, search_term))}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "rifle"}}, socket) do
{:noreply, socket |> assign(:type, :rifle) |> display_shot_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "rifle"}}, socket) do
{:noreply, socket |> assign(:class, :rifle) |> display_shot_groups()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:type, :shotgun) |> display_shot_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:class, :shotgun) |> display_shot_groups()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => "pistol"}}, socket) do
{:noreply, socket |> assign(:type, :pistol) |> display_shot_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => "pistol"}}, socket) do
{:noreply, socket |> assign(:class, :pistol) |> display_shot_groups()}
end
def handle_event("change_type", %{"ammo_type" => %{"type" => _all}}, socket) do
{:noreply, socket |> assign(:type, :all) |> display_shot_groups()}
def handle_event("change_class", %{"ammo_type" => %{"class" => _all}}, socket) do
{:noreply, socket |> assign(:class, :all) |> display_shot_groups()}
end
@spec display_shot_groups(Socket.t()) :: Socket.t()
defp display_shot_groups(
%{assigns: %{type: type, search: search, current_user: current_user}} = socket
%{assigns: %{class: class, search: search, current_user: current_user}} = socket
) do
shot_groups = ActivityLog.list_shot_groups(search, type, current_user)
shot_groups = ActivityLog.list_shot_groups(search, class, current_user)
ammo_groups = Ammo.list_staged_ammo_groups(current_user)
chart_data = shot_groups |> get_chart_data_for_shot_group()
original_counts = ammo_groups |> Ammo.get_original_counts(current_user)

View File

@ -79,15 +79,15 @@
:let={f}
for={%{}}
as={:ammo_type}
phx-change="change_type"
phx-submit="change_type"
phx-change="change_class"
phx-submit="change_class"
class="flex items-center"
>
<%= label(f, :type, gettext("Type"), class: "title text-primary-600 text-lg text-center") %>
<%= label(f, :class, gettext("Class"), class: "title text-primary-600 text-lg text-center") %>
<%= select(
f,
:type,
:class,
[
{gettext("All"), :all},
{gettext("Rifle"), :rifle},
@ -95,7 +95,7 @@
{gettext("Pistol"), :pistol}
],
class: "mx-2 my-1 min-w-md input input-primary",
value: @type
value: @class
) %>
</.form>

View File

@ -10,8 +10,8 @@
msgid ""
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:54
#: lib/cannery_web/live/ammo_group_live/index.ex:62
#: lib/cannery_web/live/ammo_group_live/index.ex:59
#: lib/cannery_web/live/ammo_group_live/index.ex:67
#: lib/cannery_web/live/ammo_group_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Add Ammo"
@ -156,7 +156,7 @@ msgstr ""
msgid "Why not get some ready to shoot?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:125
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
@ -209,7 +209,7 @@ msgid "add an ammo type first"
msgstr ""
#: lib/cannery_web/components/move_ammo_group_component.ex:80
#: lib/cannery_web/live/ammo_group_live/index.html.heex:142
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -300,7 +300,7 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:164
#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "Edit ammo group of %{ammo_group_count} bullets"
@ -321,7 +321,7 @@ msgstr ""
msgid "Edit shot record of %{shot_group_count} shots"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:118
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
#, elixir-autogen, elixir-format
msgid "Stage"
msgstr ""
@ -332,7 +332,7 @@ msgstr ""
msgid "Tag %{container_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:117
#: lib/cannery_web/live/ammo_group_live/index.html.heex:119
#, elixir-autogen, elixir-format
msgid "Unstage"
msgstr ""
@ -342,18 +342,18 @@ msgstr ""
msgid "View %{ammo_type_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:176
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format
msgid "Clone ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
#, elixir-autogen, elixir-format
msgid "Delete ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:152
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format
msgid "View ammo group of %{ammo_group_count} bullets"

View File

@ -23,8 +23,8 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery_web/live/ammo_group_live/index.ex:54
#: lib/cannery_web/live/ammo_group_live/index.ex:62
#: lib/cannery_web/live/ammo_group_live/index.ex:59
#: lib/cannery_web/live/ammo_group_live/index.ex:67
#: lib/cannery_web/live/ammo_group_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Add Ammo"
@ -169,7 +169,7 @@ msgstr "Munition markieren"
msgid "Why not get some ready to shoot?"
msgstr "Warum nicht einige für den Schießstand auswählen?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:125
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
@ -222,7 +222,7 @@ msgid "add an ammo type first"
msgstr ""
#: lib/cannery_web/components/move_ammo_group_component.ex:80
#: lib/cannery_web/live/ammo_group_live/index.html.heex:142
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -313,7 +313,7 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:164
#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "Edit ammo group of %{ammo_group_count} bullets"
@ -334,7 +334,7 @@ msgstr ""
msgid "Edit shot record of %{shot_group_count} shots"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:118
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Stage"
msgstr "Munition markieren"
@ -345,7 +345,7 @@ msgstr "Munition markieren"
msgid "Tag %{container_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:117
#: lib/cannery_web/live/ammo_group_live/index.html.heex:119
#, elixir-autogen, elixir-format
msgid "Unstage"
msgstr ""
@ -355,18 +355,18 @@ msgstr ""
msgid "View %{ammo_type_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:176
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
#, elixir-autogen, elixir-format, fuzzy
msgid "Delete ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:152
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
msgid "View ammo group of %{ammo_group_count} bullets"

View File

@ -31,8 +31,8 @@ msgstr "Admins:"
#: lib/cannery_web/components/core_components/topbar.html.heex:58
#: lib/cannery_web/components/shot_group_table_component.ex:41
#: lib/cannery_web/live/ammo_group_live/index.ex:70
#: lib/cannery_web/live/ammo_group_live/index.ex:79
#: lib/cannery_web/live/ammo_group_live/index.ex:75
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Ammo"
@ -262,7 +262,7 @@ msgstr "Neue Einladung"
msgid "New Tag"
msgstr "Neuer Tag"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:92
#: lib/cannery_web/live/ammo_group_live/index.html.heex:94
#, elixir-autogen, elixir-format
msgid "No Ammo"
msgstr "Keine Munition"
@ -401,16 +401,9 @@ msgstr "Die selbst-gehostete Website zur Verwaltung von Schusswaffen"
msgid "Tracer"
msgstr "Leuchtspur"
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Type"
msgstr "Art"
@ -471,7 +464,7 @@ msgid "No ammo staged"
msgstr "Keine Munition selektiert"
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
#: lib/cannery_web/live/ammo_group_live/index.ex:30
#: lib/cannery_web/live/ammo_group_live/index.ex:35
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr "Schüsse dokumentieren"
@ -512,7 +505,7 @@ msgstr "Patronen abgefeuert"
msgid "Shot Records"
msgstr "Schießkladde"
#: lib/cannery_web/live/ammo_group_live/index.ex:38
#: lib/cannery_web/live/ammo_group_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr "Munition verschieben"
@ -802,7 +795,7 @@ msgstr ""
msgid "Container:"
msgstr "Behälter"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
#: lib/cannery_web/live/ammo_group_live/index.html.heex:87
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
#, elixir-autogen, elixir-format
@ -1054,7 +1047,7 @@ msgstr ""
msgid "Purchased on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:46
#: lib/cannery_web/live/ammo_group_live/index.ex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit ammo"
msgstr "Munitionstyp bearbeiten"
@ -1070,7 +1063,7 @@ msgstr "Keine Munitionsarten"
msgid "Search catalog"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:79
#: lib/cannery_web/live/ammo_group_live/index.html.heex:81
#, elixir-autogen, elixir-format, fuzzy
msgid "Search ammo"
msgstr ""
@ -1256,7 +1249,7 @@ msgstr ""
msgid "Close modal"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.html.heex:35
#: lib/cannery_web/live/container_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:92
@ -1340,7 +1333,7 @@ msgstr "Keine Munition"
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_group_live/index.html.heex:61
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
@ -1365,7 +1358,7 @@ msgstr "Zündertyp"
msgid "Projectile"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:57
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
@ -1419,7 +1412,7 @@ msgstr ""
msgid "Shot type:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_group_live/index.html.heex:60
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
@ -1461,3 +1454,14 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Wadding:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Class"
msgstr ""

View File

@ -173,7 +173,7 @@ msgstr ""
"Ungültige Nummer an Kopien. Muss zwischen 1 and %{max} liegen. War "
"%{multiplier}"
#: lib/cannery/ammo.ex:1122
#: lib/cannery/ammo.ex:1123
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -73,7 +73,7 @@ msgstr ""
msgid "Are you sure you want to delete %{name}?"
msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:189
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
@ -234,7 +234,7 @@ msgstr "Möchten Sie die Sprache wechseln?"
msgid "Language updated successfully."
msgstr "Spracheinstellung gespeichert."
#: lib/cannery_web/live/ammo_group_live/index.ex:89
#: lib/cannery_web/live/ammo_group_live/index.ex:94
#: lib/cannery_web/live/ammo_group_live/show.ex:55
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo deleted succesfully"

View File

@ -27,8 +27,8 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:58
#: lib/cannery_web/components/shot_group_table_component.ex:41
#: lib/cannery_web/live/ammo_group_live/index.ex:70
#: lib/cannery_web/live/ammo_group_live/index.ex:79
#: lib/cannery_web/live/ammo_group_live/index.ex:75
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Ammo"
@ -258,7 +258,7 @@ msgstr ""
msgid "New Tag"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:92
#: lib/cannery_web/live/ammo_group_live/index.html.heex:94
#, elixir-autogen, elixir-format
msgid "No Ammo"
msgstr ""
@ -395,16 +395,9 @@ msgstr ""
msgid "Tracer"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Type"
msgstr ""
@ -465,7 +458,7 @@ msgid "No ammo staged"
msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
#: lib/cannery_web/live/ammo_group_live/index.ex:30
#: lib/cannery_web/live/ammo_group_live/index.ex:35
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr ""
@ -506,7 +499,7 @@ msgstr ""
msgid "Shot Records"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:38
#: lib/cannery_web/live/ammo_group_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@ -796,7 +789,7 @@ msgstr ""
msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
#: lib/cannery_web/live/ammo_group_live/index.html.heex:87
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
#, elixir-autogen, elixir-format
@ -1048,7 +1041,7 @@ msgstr ""
msgid "Purchased on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:46
#: lib/cannery_web/live/ammo_group_live/index.ex:51
#, elixir-autogen, elixir-format
msgid "Edit ammo"
msgstr ""
@ -1064,7 +1057,7 @@ msgstr ""
msgid "Search catalog"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:79
#: lib/cannery_web/live/ammo_group_live/index.html.heex:81
#, elixir-autogen, elixir-format
msgid "Search ammo"
msgstr ""
@ -1239,7 +1232,7 @@ msgstr ""
msgid "Close modal"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.html.heex:35
#: lib/cannery_web/live/container_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:92
@ -1323,7 +1316,7 @@ msgstr ""
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_group_live/index.html.heex:61
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
@ -1348,7 +1341,7 @@ msgstr ""
msgid "Projectile"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:57
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
@ -1402,7 +1395,7 @@ msgstr ""
msgid "Shot type:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_group_live/index.html.heex:60
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
@ -1444,3 +1437,14 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Wadding:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Class"
msgstr ""

View File

@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Language: en\n"
#: lib/cannery_web/live/ammo_group_live/index.ex:54
#: lib/cannery_web/live/ammo_group_live/index.ex:62
#: lib/cannery_web/live/ammo_group_live/index.ex:59
#: lib/cannery_web/live/ammo_group_live/index.ex:67
#: lib/cannery_web/live/ammo_group_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Add Ammo"
@ -156,7 +156,7 @@ msgstr ""
msgid "Why not get some ready to shoot?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:125
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
@ -209,7 +209,7 @@ msgid "add an ammo type first"
msgstr ""
#: lib/cannery_web/components/move_ammo_group_component.ex:80
#: lib/cannery_web/live/ammo_group_live/index.html.heex:142
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -300,7 +300,7 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:164
#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "Edit ammo group of %{ammo_group_count} bullets"
@ -321,7 +321,7 @@ msgstr ""
msgid "Edit shot record of %{shot_group_count} shots"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:118
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Stage"
msgstr ""
@ -332,7 +332,7 @@ msgstr ""
msgid "Tag %{container_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:117
#: lib/cannery_web/live/ammo_group_live/index.html.heex:119
#, elixir-autogen, elixir-format
msgid "Unstage"
msgstr ""
@ -342,18 +342,18 @@ msgstr ""
msgid "View %{ammo_type_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:176
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
#, elixir-autogen, elixir-format, fuzzy
msgid "Delete ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:152
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
msgid "View ammo group of %{ammo_group_count} bullets"

View File

@ -27,8 +27,8 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:58
#: lib/cannery_web/components/shot_group_table_component.ex:41
#: lib/cannery_web/live/ammo_group_live/index.ex:70
#: lib/cannery_web/live/ammo_group_live/index.ex:79
#: lib/cannery_web/live/ammo_group_live/index.ex:75
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Ammo"
@ -258,7 +258,7 @@ msgstr ""
msgid "New Tag"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:92
#: lib/cannery_web/live/ammo_group_live/index.html.heex:94
#, elixir-autogen, elixir-format
msgid "No Ammo"
msgstr ""
@ -395,16 +395,9 @@ msgstr ""
msgid "Tracer"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Type"
msgstr ""
@ -465,7 +458,7 @@ msgid "No ammo staged"
msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
#: lib/cannery_web/live/ammo_group_live/index.ex:30
#: lib/cannery_web/live/ammo_group_live/index.ex:35
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr ""
@ -506,7 +499,7 @@ msgstr ""
msgid "Shot Records"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:38
#: lib/cannery_web/live/ammo_group_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@ -796,7 +789,7 @@ msgstr ""
msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
#: lib/cannery_web/live/ammo_group_live/index.html.heex:87
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
#, elixir-autogen, elixir-format
@ -1048,7 +1041,7 @@ msgstr ""
msgid "Purchased on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:46
#: lib/cannery_web/live/ammo_group_live/index.ex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit ammo"
msgstr ""
@ -1064,7 +1057,7 @@ msgstr ""
msgid "Search catalog"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:79
#: lib/cannery_web/live/ammo_group_live/index.html.heex:81
#, elixir-autogen, elixir-format, fuzzy
msgid "Search ammo"
msgstr ""
@ -1239,7 +1232,7 @@ msgstr ""
msgid "Close modal"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.html.heex:35
#: lib/cannery_web/live/container_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:92
@ -1323,7 +1316,7 @@ msgstr ""
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_group_live/index.html.heex:61
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
@ -1348,7 +1341,7 @@ msgstr ""
msgid "Projectile"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:57
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
@ -1402,7 +1395,7 @@ msgstr ""
msgid "Shot type:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_group_live/index.html.heex:60
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
@ -1444,3 +1437,14 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Wadding:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Class"
msgstr ""

View File

@ -156,7 +156,7 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
#: lib/cannery/ammo.ex:1122
#: lib/cannery/ammo.ex:1123
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -58,7 +58,7 @@ msgstr ""
msgid "Are you sure you want to delete %{name}?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:189
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
@ -213,7 +213,7 @@ msgstr ""
msgid "Language updated successfully."
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:89
#: lib/cannery_web/live/ammo_group_live/index.ex:94
#: lib/cannery_web/live/ammo_group_live/show.ex:55
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo deleted succesfully"

View File

@ -155,7 +155,7 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
#: lib/cannery/ammo.ex:1122
#: lib/cannery/ammo.ex:1123
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -23,8 +23,8 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery_web/live/ammo_group_live/index.ex:54
#: lib/cannery_web/live/ammo_group_live/index.ex:62
#: lib/cannery_web/live/ammo_group_live/index.ex:59
#: lib/cannery_web/live/ammo_group_live/index.ex:67
#: lib/cannery_web/live/ammo_group_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Add Ammo"
@ -169,7 +169,7 @@ msgstr "Preparar munición"
msgid "Why not get some ready to shoot?"
msgstr "¿Por qué no preparar parte para disparar?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:125
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
@ -222,7 +222,7 @@ msgid "add an ammo type first"
msgstr "añade primero un tipo de munición"
#: lib/cannery_web/components/move_ammo_group_component.ex:80
#: lib/cannery_web/live/ammo_group_live/index.html.heex:142
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -313,7 +313,7 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:164
#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "Edit ammo group of %{ammo_group_count} bullets"
@ -334,7 +334,7 @@ msgstr ""
msgid "Edit shot record of %{shot_group_count} shots"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:118
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Stage"
msgstr "Preparar munición"
@ -345,7 +345,7 @@ msgstr "Preparar munición"
msgid "Tag %{container_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:117
#: lib/cannery_web/live/ammo_group_live/index.html.heex:119
#, elixir-autogen, elixir-format
msgid "Unstage"
msgstr ""
@ -355,18 +355,18 @@ msgstr ""
msgid "View %{ammo_type_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:176
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
#, elixir-autogen, elixir-format, fuzzy
msgid "Delete ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:152
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
msgid "View ammo group of %{ammo_group_count} bullets"

View File

@ -31,8 +31,8 @@ msgstr "Aministradores:"
#: lib/cannery_web/components/core_components/topbar.html.heex:58
#: lib/cannery_web/components/shot_group_table_component.ex:41
#: lib/cannery_web/live/ammo_group_live/index.ex:70
#: lib/cannery_web/live/ammo_group_live/index.ex:79
#: lib/cannery_web/live/ammo_group_live/index.ex:75
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Ammo"
@ -262,7 +262,7 @@ msgstr "Nueva Invitación"
msgid "New Tag"
msgstr "Nueva Etiqueta"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:92
#: lib/cannery_web/live/ammo_group_live/index.html.heex:94
#, elixir-autogen, elixir-format
msgid "No Ammo"
msgstr "Sin Munición"
@ -402,16 +402,9 @@ msgstr "La página de seguimiento de armas autogestionada"
msgid "Tracer"
msgstr "Trazadora"
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Type"
msgstr "Tipo"
@ -472,7 +465,7 @@ msgid "No ammo staged"
msgstr "No hay munición preparada"
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
#: lib/cannery_web/live/ammo_group_live/index.ex:30
#: lib/cannery_web/live/ammo_group_live/index.ex:35
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr "Tiros récord"
@ -513,7 +506,7 @@ msgstr "Balas disparadas"
msgid "Shot Records"
msgstr "Récords de Tiro"
#: lib/cannery_web/live/ammo_group_live/index.ex:38
#: lib/cannery_web/live/ammo_group_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr "Mover munición"
@ -804,7 +797,7 @@ msgstr ""
msgid "Container:"
msgstr "Contenedor:"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
#: lib/cannery_web/live/ammo_group_live/index.html.heex:87
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
#, elixir-autogen, elixir-format
@ -1056,7 +1049,7 @@ msgstr "Comprada en"
msgid "Purchased on:"
msgstr "Comprada en:"
#: lib/cannery_web/live/ammo_group_live/index.ex:46
#: lib/cannery_web/live/ammo_group_live/index.ex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit ammo"
msgstr "Editar munición"
@ -1072,7 +1065,7 @@ msgstr "Sin tipo de Munición"
msgid "Search catalog"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:79
#: lib/cannery_web/live/ammo_group_live/index.html.heex:81
#, elixir-autogen, elixir-format, fuzzy
msgid "Search ammo"
msgstr ""
@ -1258,7 +1251,7 @@ msgstr ""
msgid "Close modal"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.html.heex:35
#: lib/cannery_web/live/container_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:92
@ -1342,7 +1335,7 @@ msgstr "Sin Munición"
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_group_live/index.html.heex:61
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
@ -1367,7 +1360,7 @@ msgstr "Tipo de espoleta"
msgid "Projectile"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:57
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
@ -1421,7 +1414,7 @@ msgstr ""
msgid "Shot type:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_group_live/index.html.heex:60
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
@ -1463,3 +1456,14 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Wadding:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Class"
msgstr ""

View File

@ -171,7 +171,7 @@ msgstr "No se ha podido procesar el número de copias"
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "Número inválido de copias, debe ser entre 1 y %{max}. Fue %{multiplier"
#: lib/cannery/ammo.ex:1122
#: lib/cannery/ammo.ex:1123
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr "Multiplicador inválido"

View File

@ -73,7 +73,7 @@ msgstr "Está seguro que desea eliminar %{email}? Esta acción es permanente!"
msgid "Are you sure you want to delete %{name}?"
msgstr "Está seguro que desea eliminar %{name}?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:189
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
@ -233,7 +233,7 @@ msgstr "¿Está segure de que quiere cambiar el idioma?"
msgid "Language updated successfully."
msgstr "Idioma cambiado exitosamente."
#: lib/cannery_web/live/ammo_group_live/index.ex:89
#: lib/cannery_web/live/ammo_group_live/index.ex:94
#: lib/cannery_web/live/ammo_group_live/show.ex:55
#, elixir-autogen, elixir-format
msgid "Ammo deleted succesfully"

View File

@ -23,8 +23,8 @@ msgstr ""
# # Run "mix gettext.extract" to bring this file up to
# # date. Leave "msgstr"s empty as changing them here has no
# # effect: edit them in PO (.po) files instead.
#: lib/cannery_web/live/ammo_group_live/index.ex:54
#: lib/cannery_web/live/ammo_group_live/index.ex:62
#: lib/cannery_web/live/ammo_group_live/index.ex:59
#: lib/cannery_web/live/ammo_group_live/index.ex:67
#: lib/cannery_web/live/ammo_group_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Add Ammo"
@ -169,7 +169,7 @@ msgstr "Munition préparée"
msgid "Why not get some ready to shoot?"
msgstr "Pourquoi pas en préparer pour tirer?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:125
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
@ -222,7 +222,7 @@ msgid "add an ammo type first"
msgstr "Ajoutez d'abord un type de munitions"
#: lib/cannery_web/components/move_ammo_group_component.ex:80
#: lib/cannery_web/live/ammo_group_live/index.html.heex:142
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -313,7 +313,7 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:164
#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "Edit ammo group of %{ammo_group_count} bullets"
@ -334,7 +334,7 @@ msgstr ""
msgid "Edit shot record of %{shot_group_count} shots"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:118
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Stage"
msgstr "Munition préparée"
@ -345,7 +345,7 @@ msgstr "Munition préparée"
msgid "Tag %{container_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:117
#: lib/cannery_web/live/ammo_group_live/index.html.heex:119
#, elixir-autogen, elixir-format
msgid "Unstage"
msgstr ""
@ -355,18 +355,18 @@ msgstr ""
msgid "View %{ammo_type_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:176
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
#, elixir-autogen, elixir-format, fuzzy
msgid "Delete ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:152
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
msgid "View ammo group of %{ammo_group_count} bullets"

View File

@ -31,8 +31,8 @@ msgstr "Administrateur·ices:"
#: lib/cannery_web/components/core_components/topbar.html.heex:58
#: lib/cannery_web/components/shot_group_table_component.ex:41
#: lib/cannery_web/live/ammo_group_live/index.ex:70
#: lib/cannery_web/live/ammo_group_live/index.ex:79
#: lib/cannery_web/live/ammo_group_live/index.ex:75
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Ammo"
@ -262,7 +262,7 @@ msgstr "Nouvelle invitation"
msgid "New Tag"
msgstr "Nouveau tag"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:92
#: lib/cannery_web/live/ammo_group_live/index.html.heex:94
#, elixir-autogen, elixir-format
msgid "No Ammo"
msgstr "Aucune munition"
@ -403,16 +403,9 @@ msgstr "Le site web de suivi darme à feux auto-hébergé"
msgid "Tracer"
msgstr "Traceuse"
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Type"
msgstr "Type"
@ -473,7 +466,7 @@ msgid "No ammo staged"
msgstr "Aucune munition sélectionnée"
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
#: lib/cannery_web/live/ammo_group_live/index.ex:30
#: lib/cannery_web/live/ammo_group_live/index.ex:35
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr "Tirs enregistrés"
@ -514,7 +507,7 @@ msgstr "Cartouches tirées"
msgid "Shot Records"
msgstr "Enregistrements de tir"
#: lib/cannery_web/live/ammo_group_live/index.ex:38
#: lib/cannery_web/live/ammo_group_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr "Déplacer munition"
@ -805,7 +798,7 @@ msgstr ""
msgid "Container:"
msgstr "Conteneur"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
#: lib/cannery_web/live/ammo_group_live/index.html.heex:87
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
#, elixir-autogen, elixir-format
@ -1057,7 +1050,7 @@ msgstr ""
msgid "Purchased on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:46
#: lib/cannery_web/live/ammo_group_live/index.ex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit ammo"
msgstr "Éditer le type de munition"
@ -1073,7 +1066,7 @@ msgstr "Aucun type de munition"
msgid "Search catalog"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:79
#: lib/cannery_web/live/ammo_group_live/index.html.heex:81
#, elixir-autogen, elixir-format, fuzzy
msgid "Search ammo"
msgstr ""
@ -1259,7 +1252,7 @@ msgstr ""
msgid "Close modal"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.html.heex:35
#: lib/cannery_web/live/container_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:92
@ -1343,7 +1336,7 @@ msgstr "Aucune munition"
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_group_live/index.html.heex:61
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
@ -1368,7 +1361,7 @@ msgstr "Type damorce"
msgid "Projectile"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:57
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
@ -1422,7 +1415,7 @@ msgstr ""
msgid "Shot type:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_group_live/index.html.heex:60
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
@ -1464,3 +1457,14 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Wadding:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Class"
msgstr ""

View File

@ -172,7 +172,7 @@ msgstr "Impossible d'analyser le nombre de copies"
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "Nombre de copies invalide, doit être 1 et %{max}. Été %{multiplier}"
#: lib/cannery/ammo.ex:1122
#: lib/cannery/ammo.ex:1123
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr "Multiplicateur invalide"

View File

@ -74,7 +74,7 @@ msgstr ""
msgid "Are you sure you want to delete %{name}?"
msgstr "Êtes-vous certain·e de supprimer %{name}?"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:189
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
@ -235,7 +235,7 @@ msgstr "Êtes-vous certain·e de vouloir changer votre langue?"
msgid "Language updated successfully."
msgstr "Langue mise à jour avec succès."
#: lib/cannery_web/live/ammo_group_live/index.ex:89
#: lib/cannery_web/live/ammo_group_live/index.ex:94
#: lib/cannery_web/live/ammo_group_live/show.ex:55
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo deleted succesfully"

View File

@ -21,8 +21,8 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#: lib/cannery_web/live/ammo_group_live/index.ex:54
#: lib/cannery_web/live/ammo_group_live/index.ex:62
#: lib/cannery_web/live/ammo_group_live/index.ex:59
#: lib/cannery_web/live/ammo_group_live/index.ex:67
#: lib/cannery_web/live/ammo_group_live/index.html.heex:38
#, elixir-autogen, elixir-format
msgid "Add Ammo"
@ -167,7 +167,7 @@ msgstr ""
msgid "Why not get some ready to shoot?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:125
#: lib/cannery_web/live/ammo_group_live/index.html.heex:127
#: lib/cannery_web/live/ammo_group_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:45
#, elixir-autogen, elixir-format
@ -220,7 +220,7 @@ msgid "add an ammo type first"
msgstr ""
#: lib/cannery_web/components/move_ammo_group_component.ex:80
#: lib/cannery_web/live/ammo_group_live/index.html.heex:142
#: lib/cannery_web/live/ammo_group_live/index.html.heex:144
#: lib/cannery_web/live/ammo_group_live/show.html.heex:96
#, elixir-autogen, elixir-format
msgid "Move ammo"
@ -311,7 +311,7 @@ msgstr ""
msgid "Edit %{tag_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:164
#: lib/cannery_web/live/ammo_group_live/index.html.heex:166
#: lib/cannery_web/live/ammo_group_live/show.html.heex:62
#, elixir-autogen, elixir-format
msgid "Edit ammo group of %{ammo_group_count} bullets"
@ -332,7 +332,7 @@ msgstr ""
msgid "Edit shot record of %{shot_group_count} shots"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:118
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Stage"
msgstr ""
@ -343,7 +343,7 @@ msgstr ""
msgid "Tag %{container_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:117
#: lib/cannery_web/live/ammo_group_live/index.html.heex:119
#, elixir-autogen, elixir-format
msgid "Unstage"
msgstr ""
@ -353,18 +353,18 @@ msgstr ""
msgid "View %{ammo_type_name}"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:176
#: lib/cannery_web/live/ammo_group_live/index.html.heex:178
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/index.html.heex:193
#: lib/cannery_web/live/ammo_group_live/show.html.heex:76
#, elixir-autogen, elixir-format, fuzzy
msgid "Delete ammo group of %{ammo_group_count} bullets"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:152
#: lib/cannery_web/live/ammo_group_live/index.html.heex:154
#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
#, elixir-autogen, elixir-format, fuzzy
msgid "View ammo group of %{ammo_group_count} bullets"

View File

@ -29,8 +29,8 @@ msgstr ""
#: lib/cannery_web/components/core_components/topbar.html.heex:58
#: lib/cannery_web/components/shot_group_table_component.ex:41
#: lib/cannery_web/live/ammo_group_live/index.ex:70
#: lib/cannery_web/live/ammo_group_live/index.ex:79
#: lib/cannery_web/live/ammo_group_live/index.ex:75
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Ammo"
@ -260,7 +260,7 @@ msgstr ""
msgid "New Tag"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:92
#: lib/cannery_web/live/ammo_group_live/index.html.heex:94
#, elixir-autogen, elixir-format
msgid "No Ammo"
msgstr ""
@ -397,16 +397,9 @@ msgstr ""
msgid "Tracer"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/form_component.html.heex:39
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Type"
msgstr ""
@ -467,7 +460,7 @@ msgid "No ammo staged"
msgstr ""
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
#: lib/cannery_web/live/ammo_group_live/index.ex:30
#: lib/cannery_web/live/ammo_group_live/index.ex:35
#, elixir-autogen, elixir-format
msgid "Record shots"
msgstr ""
@ -508,7 +501,7 @@ msgstr ""
msgid "Shot Records"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:38
#: lib/cannery_web/live/ammo_group_live/index.ex:43
#, elixir-autogen, elixir-format
msgid "Move ammo"
msgstr ""
@ -798,7 +791,7 @@ msgstr ""
msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
#: lib/cannery_web/live/ammo_group_live/index.html.heex:87
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
#, elixir-autogen, elixir-format
@ -1050,7 +1043,7 @@ msgstr ""
msgid "Purchased on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:46
#: lib/cannery_web/live/ammo_group_live/index.ex:51
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit ammo"
msgstr ""
@ -1066,7 +1059,7 @@ msgstr ""
msgid "Search catalog"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:79
#: lib/cannery_web/live/ammo_group_live/index.html.heex:81
#, elixir-autogen, elixir-format, fuzzy
msgid "Search ammo"
msgstr ""
@ -1250,7 +1243,7 @@ msgstr ""
msgid "Close modal"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.html.heex:35
#: lib/cannery_web/live/container_live/show.html.heex:103
#: lib/cannery_web/live/range_live/index.html.heex:92
@ -1334,7 +1327,7 @@ msgstr ""
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_group_live/index.html.heex:61
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
@ -1359,7 +1352,7 @@ msgstr ""
msgid "Projectile"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:57
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
@ -1413,7 +1406,7 @@ msgstr ""
msgid "Shot type:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:58
#: lib/cannery_web/live/ammo_group_live/index.html.heex:60
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
@ -1455,3 +1448,14 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Wadding:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_group_live/index.html.heex:50
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/range_live/index.html.heex:86
#, elixir-autogen, elixir-format
msgid "Class"
msgstr ""

View File

@ -171,7 +171,7 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
#: lib/cannery/ammo.ex:1122
#: lib/cannery/ammo.ex:1123
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""

View File

@ -69,7 +69,7 @@ msgstr ""
msgid "Are you sure you want to delete %{name}?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:189
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
@ -224,7 +224,7 @@ msgstr ""
msgid "Language updated successfully."
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:89
#: lib/cannery_web/live/ammo_group_live/index.ex:94
#: lib/cannery_web/live/ammo_group_live/show.ex:55
#, elixir-autogen, elixir-format
msgid "Ammo deleted succesfully"

View File

@ -58,7 +58,7 @@ msgstr ""
msgid "Are you sure you want to delete %{name}?"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:189
#: lib/cannery_web/live/ammo_group_live/index.html.heex:191
#: lib/cannery_web/live/ammo_group_live/show.html.heex:74
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete this ammo?"
@ -213,7 +213,7 @@ msgstr ""
msgid "Language updated successfully."
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:89
#: lib/cannery_web/live/ammo_group_live/index.ex:94
#: lib/cannery_web/live/ammo_group_live/show.ex:55
#, elixir-autogen, elixir-format
msgid "Ammo deleted succesfully"

View File

@ -0,0 +1,7 @@
defmodule Cannery.Repo.Migrations.RenameTypeToClass do
use Ecto.Migration
def change do
rename table(:ammo_types), :type, to: :class
end
end

View File

@ -343,21 +343,21 @@ defmodule Cannery.ActivityLogTest do
other_user = user_fixture()
other_container = container_fixture(other_user)
for type <- ["rifle", "shotgun", "pistol"] do
other_ammo_type = ammo_type_fixture(%{type: type}, other_user)
for class <- ["rifle", "shotgun", "pistol"] do
other_ammo_type = ammo_type_fixture(%{class: class}, other_user)
{1, [other_ammo_group]} = ammo_group_fixture(other_ammo_type, other_container, other_user)
shot_group_fixture(other_user, other_ammo_group)
end
rifle_ammo_type = ammo_type_fixture(%{type: "rifle"}, current_user)
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
rifle_shot_group = shot_group_fixture(current_user, rifle_ammo_group)
shotgun_ammo_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
shotgun_shot_group = shot_group_fixture(current_user, shotgun_ammo_group)
pistol_ammo_type = ammo_type_fixture(%{type: "pistol"}, current_user)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
pistol_shot_group = shot_group_fixture(current_user, pistol_ammo_group)

View File

@ -41,7 +41,7 @@ defmodule Cannery.AmmoTest do
rifle_ammo_type =
%{
name: "bullets",
type: "rifle",
class: :rifle,
desc: "has some pews in it",
grains: 5
}
@ -50,14 +50,14 @@ defmodule Cannery.AmmoTest do
shotgun_ammo_type =
%{
name: "hollows",
type: "shotgun",
class: :shotgun,
grains: 3
}
|> ammo_type_fixture(current_user)
pistol_ammo_type =
%{
type: "pistol",
class: :pistol,
name: "jackets",
desc: "brass shell",
tracer: true
@ -750,11 +750,11 @@ defmodule Cannery.AmmoTest do
current_user = user_fixture()
container = container_fixture(current_user)
rifle_ammo_type = ammo_type_fixture(%{type: "rifle"}, current_user)
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
shotgun_ammo_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
pistol_ammo_type = ammo_type_fixture(%{type: "pistol"}, current_user)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
assert [^rifle_ammo_group] = Ammo.list_ammo_groups(nil, :rifle, current_user, false)
@ -858,11 +858,11 @@ defmodule Cannery.AmmoTest do
current_user = user_fixture()
container = container_fixture(current_user)
rifle_ammo_type = ammo_type_fixture(%{type: "rifle"}, current_user)
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
shotgun_ammo_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
pistol_ammo_type = ammo_type_fixture(%{type: "pistol"}, current_user)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
another_container = container_fixture(current_user)

View File

@ -64,11 +64,11 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
rifle_type = ammo_type_fixture(%{type: "rifle"}, current_user)
rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_type, container, current_user)
shotgun_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_type, container, current_user)
pistol_type = ammo_type_fixture(%{type: "pistol"}, current_user)
pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_type, container, current_user)
{:ok, index_live, html} = live(conn, Routes.ammo_group_index_path(conn, :index))
@ -81,8 +81,8 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :rifle})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :rifle})
assert html =~ rifle_ammo_group.ammo_type.name
refute html =~ shotgun_ammo_group.ammo_type.name
@ -90,8 +90,8 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :shotgun})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :shotgun})
refute html =~ rifle_ammo_group.ammo_type.name
assert html =~ shotgun_ammo_group.ammo_type.name
@ -99,8 +99,8 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :pistol})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :pistol})
refute html =~ rifle_ammo_group.ammo_type.name
refute html =~ shotgun_ammo_group.ammo_type.name
@ -108,8 +108,8 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :all})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :all})
assert html =~ rifle_ammo_group.ammo_type.name
assert html =~ shotgun_ammo_group.ammo_type.name

View File

@ -69,10 +69,10 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
assert html =~ ammo_type.bullet_type
end
test "can sort by type", %{conn: conn, current_user: current_user} do
rifle_type = ammo_type_fixture(%{type: "rifle"}, current_user)
shotgun_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
pistol_type = ammo_type_fixture(%{type: "pistol"}, current_user)
test "can sort by class", %{conn: conn, current_user: current_user} do
rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
{:ok, index_live, html} = live(conn, Routes.ammo_type_index_path(conn, :index))
@ -84,8 +84,8 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :rifle})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :rifle})
assert html =~ rifle_type.name
refute html =~ shotgun_type.name
@ -93,8 +93,8 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :shotgun})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :shotgun})
refute html =~ rifle_type.name
assert html =~ shotgun_type.name
@ -102,8 +102,8 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :pistol})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :pistol})
refute html =~ rifle_type.name
refute html =~ shotgun_type.name
@ -111,8 +111,8 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :all})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :all})
assert html =~ rifle_type.name
assert html =~ shotgun_type.name

View File

@ -245,11 +245,11 @@ defmodule CanneryWeb.ContainerLiveTest do
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
rifle_type = ammo_type_fixture(%{type: "rifle"}, current_user)
rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_type, container, current_user)
shotgun_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_type, container, current_user)
pistol_type = ammo_type_fixture(%{type: "pistol"}, current_user)
pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_type, container, current_user)
{:ok, index_live, html} = live(conn, Routes.container_show_path(conn, :show, container))
@ -262,8 +262,8 @@ defmodule CanneryWeb.ContainerLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :rifle})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :rifle})
assert html =~ rifle_ammo_group.ammo_type.name
refute html =~ shotgun_ammo_group.ammo_type.name
@ -271,8 +271,8 @@ defmodule CanneryWeb.ContainerLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :shotgun})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :shotgun})
refute html =~ rifle_ammo_group.ammo_type.name
assert html =~ shotgun_ammo_group.ammo_type.name
@ -280,8 +280,8 @@ defmodule CanneryWeb.ContainerLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :pistol})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :pistol})
refute html =~ rifle_ammo_group.ammo_type.name
refute html =~ shotgun_ammo_group.ammo_type.name
@ -289,8 +289,8 @@ defmodule CanneryWeb.ContainerLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :all})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :all})
assert html =~ rifle_ammo_group.ammo_type.name
assert html =~ shotgun_ammo_group.ammo_type.name

View File

@ -42,18 +42,18 @@ defmodule CanneryWeb.RangeLiveTest do
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
rifle_ammo_type = ammo_type_fixture(%{type: "rifle"}, current_user)
rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
{1, [rifle_ammo_group]} = ammo_group_fixture(rifle_ammo_type, container, current_user)
rifle_shot_group = shot_group_fixture(%{notes: "group_one"}, current_user, rifle_ammo_group)
shotgun_ammo_type = ammo_type_fixture(%{type: "shotgun"}, current_user)
shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_ammo_group]} = ammo_group_fixture(shotgun_ammo_type, container, current_user)
shotgun_shot_group =
shot_group_fixture(%{notes: "group_two"}, current_user, shotgun_ammo_group)
pistol_ammo_type = ammo_type_fixture(%{type: "pistol"}, current_user)
pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
{1, [pistol_ammo_group]} = ammo_group_fixture(pistol_ammo_type, container, current_user)
pistol_shot_group =
@ -69,8 +69,8 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :rifle})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :rifle})
assert html =~ rifle_shot_group.notes
refute html =~ shotgun_shot_group.notes
@ -78,8 +78,8 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :shotgun})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :shotgun})
refute html =~ rifle_shot_group.notes
assert html =~ shotgun_shot_group.notes
@ -87,8 +87,8 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :pistol})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :pistol})
refute html =~ rifle_shot_group.notes
refute html =~ shotgun_shot_group.notes
@ -96,8 +96,8 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_type"]/)
|> render_change(ammo_type: %{type: :all})
|> form(~s/form[phx-change="change_class"]/)
|> render_change(ammo_type: %{class: :all})
assert html =~ rifle_shot_group.notes
assert html =~ shotgun_shot_group.notes

View File

@ -103,7 +103,7 @@ defmodule Cannery.Fixtures do
@spec ammo_type_fixture(attrs :: map(), User.t()) :: AmmoType.t()
def ammo_type_fixture(attrs \\ %{}, %User{} = user) do
attrs
|> Enum.into(%{name: random_string(), type: "rifle"})
|> Enum.into(%{name: random_string(), class: :rifle})
|> Ammo.create_ammo_type(user)
|> unwrap_ok_tuple()
end