forked from shibao/cannery
display used-up date on used-up ammo
This commit is contained in:
parent
cc31958bbe
commit
cfbec3189c
@ -1,5 +1,6 @@
|
|||||||
# v0.5.5
|
# v0.5.5
|
||||||
- Update translations
|
- Update translations
|
||||||
|
- Display used-up date on used-up ammo
|
||||||
- Make ammo index page a bit more compact
|
- Make ammo index page a bit more compact
|
||||||
- Make ammo index page filter used-up ammo
|
- Make ammo index page filter used-up ammo
|
||||||
- Make ammo catalog page include ammo count
|
- Make ammo catalog page include ammo count
|
||||||
|
@ -227,7 +227,7 @@ defmodule Cannery.Ammo do
|
|||||||
def list_ammo_groups_for_type(
|
def list_ammo_groups_for_type(
|
||||||
%AmmoType{id: ammo_type_id, user_id: user_id},
|
%AmmoType{id: ammo_type_id, user_id: user_id},
|
||||||
%User{id: user_id},
|
%User{id: user_id},
|
||||||
_include_empty = true
|
true = _include_empty
|
||||||
) do
|
) do
|
||||||
Repo.all(
|
Repo.all(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
@ -242,7 +242,7 @@ defmodule Cannery.Ammo do
|
|||||||
def list_ammo_groups_for_type(
|
def list_ammo_groups_for_type(
|
||||||
%AmmoType{id: ammo_type_id, user_id: user_id},
|
%AmmoType{id: ammo_type_id, user_id: user_id},
|
||||||
%User{id: user_id},
|
%User{id: user_id},
|
||||||
_include_empty = false
|
false = _include_empty
|
||||||
) do
|
) do
|
||||||
Repo.all(
|
Repo.all(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
@ -272,7 +272,7 @@ defmodule Cannery.Ammo do
|
|||||||
def list_ammo_groups_for_container(
|
def list_ammo_groups_for_container(
|
||||||
%Container{id: container_id, user_id: user_id},
|
%Container{id: container_id, user_id: user_id},
|
||||||
%User{id: user_id},
|
%User{id: user_id},
|
||||||
_include_empty = true
|
true = _include_empty
|
||||||
) do
|
) do
|
||||||
Repo.all(
|
Repo.all(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
@ -287,7 +287,7 @@ defmodule Cannery.Ammo do
|
|||||||
def list_ammo_groups_for_container(
|
def list_ammo_groups_for_container(
|
||||||
%Container{id: container_id, user_id: user_id},
|
%Container{id: container_id, user_id: user_id},
|
||||||
%User{id: user_id},
|
%User{id: user_id},
|
||||||
_include_empty = false
|
false = _include_empty
|
||||||
) do
|
) do
|
||||||
Repo.all(
|
Repo.all(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
@ -317,7 +317,7 @@ defmodule Cannery.Ammo do
|
|||||||
def get_ammo_groups_count_for_type(
|
def get_ammo_groups_count_for_type(
|
||||||
%AmmoType{id: ammo_type_id, user_id: user_id},
|
%AmmoType{id: ammo_type_id, user_id: user_id},
|
||||||
%User{id: user_id},
|
%User{id: user_id},
|
||||||
_include_empty = true
|
true = _include_empty
|
||||||
) do
|
) do
|
||||||
Repo.one!(
|
Repo.one!(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
@ -331,7 +331,7 @@ defmodule Cannery.Ammo do
|
|||||||
def get_ammo_groups_count_for_type(
|
def get_ammo_groups_count_for_type(
|
||||||
%AmmoType{id: ammo_type_id, user_id: user_id},
|
%AmmoType{id: ammo_type_id, user_id: user_id},
|
||||||
%User{id: user_id},
|
%User{id: user_id},
|
||||||
_include_empty = false
|
false = _include_empty
|
||||||
) do
|
) do
|
||||||
Repo.one!(
|
Repo.one!(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
@ -356,7 +356,7 @@ defmodule Cannery.Ammo do
|
|||||||
@spec list_ammo_groups(User.t(), include_empty :: boolean()) :: [AmmoGroup.t()]
|
@spec list_ammo_groups(User.t(), include_empty :: boolean()) :: [AmmoGroup.t()]
|
||||||
def list_ammo_groups(user, include_empty \\ false)
|
def list_ammo_groups(user, include_empty \\ false)
|
||||||
|
|
||||||
def list_ammo_groups(%User{id: user_id}, _include_empty = true) do
|
def list_ammo_groups(%User{id: user_id}, true = _include_empty) do
|
||||||
Repo.all(
|
Repo.all(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
left_join: sg in assoc(ag, :shot_groups),
|
left_join: sg in assoc(ag, :shot_groups),
|
||||||
@ -366,7 +366,7 @@ defmodule Cannery.Ammo do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_ammo_groups(%User{id: user_id}, _include_empty = false) do
|
def list_ammo_groups(%User{id: user_id}, false = _include_empty) do
|
||||||
Repo.all(
|
Repo.all(
|
||||||
from ag in AmmoGroup,
|
from ag in AmmoGroup,
|
||||||
left_join: sg in assoc(ag, :shot_groups),
|
left_join: sg in assoc(ag, :shot_groups),
|
||||||
@ -435,6 +435,17 @@ defmodule Cannery.Ammo do
|
|||||||
|> Enum.sum()
|
|> Enum.sum()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Returns the last entered shot group for an ammo group
|
||||||
|
"""
|
||||||
|
@spec get_last_used_shot_group(AmmoGroup.t()) :: ShotGroup.t() | nil
|
||||||
|
def get_last_used_shot_group(%AmmoGroup{} = ammo_group) do
|
||||||
|
ammo_group
|
||||||
|
|> Repo.preload(:shot_groups)
|
||||||
|
|> Map.fetch!(:shot_groups)
|
||||||
|
|> Enum.max_by(fn %{date: date} -> date end, Date, fn -> nil end)
|
||||||
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Calculates the percentage remaining of an ammo group out of 100
|
Calculates the percentage remaining of an ammo group out of 100
|
||||||
"""
|
"""
|
||||||
|
@ -4,7 +4,7 @@ defmodule CanneryWeb.Components.AmmoGroupCard do
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
use CanneryWeb, :component
|
use CanneryWeb, :component
|
||||||
alias Cannery.Repo
|
alias Cannery.{Ammo, Repo}
|
||||||
alias CanneryWeb.Endpoint
|
alias CanneryWeb.Endpoint
|
||||||
|
|
||||||
def ammo_group_card(%{ammo_group: ammo_group} = assigns) do
|
def ammo_group_card(%{ammo_group: ammo_group} = assigns) do
|
||||||
@ -47,6 +47,13 @@ defmodule CanneryWeb.Components.AmmoGroupCard do
|
|||||||
<%= @ammo_group.inserted_at |> display_datetime() %>
|
<%= @ammo_group.inserted_at |> display_datetime() %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<%= if @ammo_group.count == 0 do %>
|
||||||
|
<span class="rounded-lg title text-lg">
|
||||||
|
<%= gettext("Used up on:") %>
|
||||||
|
<%= @ammo_group |> Ammo.get_last_used_shot_group() |> Map.get(:date) |> display_date() %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= if @ammo_group.price_paid do %>
|
<%= if @ammo_group.price_paid do %>
|
||||||
<span class="rounded-lg title text-lg">
|
<span class="rounded-lg title text-lg">
|
||||||
<%= gettext("Price paid:") %>
|
<%= gettext("Price paid:") %>
|
||||||
|
@ -6,7 +6,7 @@ defmodule CanneryWeb.Components.TableComponent do
|
|||||||
- `:columns`: An array of maps containing the following keys
|
- `:columns`: An array of maps containing the following keys
|
||||||
- `:label`: A gettext'd or otherwise user-facing string label for the
|
- `:label`: A gettext'd or otherwise user-facing string label for the
|
||||||
column. Can be nil
|
column. Can be nil
|
||||||
- `:key`: A string key used for sorting
|
- `:key`: An atom key used for sorting
|
||||||
- `:class`: Extra classes to be applied to the column element, if desired.
|
- `:class`: Extra classes to be applied to the column element, if desired.
|
||||||
Optional
|
Optional
|
||||||
- `:sortable`: If false, will prevent the user from sorting with it.
|
- `:sortable`: If false, will prevent the user from sorting with it.
|
||||||
@ -28,13 +28,13 @@ defmodule CanneryWeb.Components.TableComponent do
|
|||||||
required(:columns) =>
|
required(:columns) =>
|
||||||
list(%{
|
list(%{
|
||||||
required(:label) => String.t() | nil,
|
required(:label) => String.t() | nil,
|
||||||
required(:key) => String.t() | nil,
|
required(:key) => atom() | nil,
|
||||||
optional(:class) => String.t(),
|
optional(:class) => String.t(),
|
||||||
optional(:sortable) => false
|
optional(:sortable) => false
|
||||||
}),
|
}),
|
||||||
required(:rows) =>
|
required(:rows) =>
|
||||||
list(%{
|
list(%{
|
||||||
(key :: String.t()) => any() | {custom_sort_value :: String.t(), value :: any()}
|
(key :: atom()) => any() | {custom_sort_value :: String.t(), value :: any()}
|
||||||
}),
|
}),
|
||||||
optional(any()) => any()
|
optional(any()) => any()
|
||||||
},
|
},
|
||||||
@ -56,20 +56,19 @@ defmodule CanneryWeb.Components.TableComponent do
|
|||||||
def handle_event(
|
def handle_event(
|
||||||
"sort_by",
|
"sort_by",
|
||||||
%{"sort-key" => key},
|
%{"sort-key" => key},
|
||||||
%{assigns: %{rows: rows, last_sort_key: key, sort_mode: sort_mode}} = socket
|
%{assigns: %{rows: rows, last_sort_key: last_sort_key, sort_mode: sort_mode}} = socket
|
||||||
) do
|
) do
|
||||||
sort_mode = if sort_mode == :asc, do: :desc, else: :asc
|
key = key |> String.to_existing_atom()
|
||||||
rows = rows |> sort_by_custom_sort_value_or_value(key, sort_mode)
|
|
||||||
{:noreply, socket |> assign(sort_mode: sort_mode, rows: rows)}
|
|
||||||
end
|
|
||||||
|
|
||||||
def handle_event(
|
sort_mode =
|
||||||
"sort_by",
|
case {key, sort_mode} do
|
||||||
%{"sort-key" => key},
|
{^last_sort_key, :asc} -> :desc
|
||||||
%{assigns: %{rows: rows}} = socket
|
{^last_sort_key, :desc} -> :asc
|
||||||
) do
|
{_new_sort_key, _last_sort_mode} -> :asc
|
||||||
rows = rows |> sort_by_custom_sort_value_or_value(key, :asc)
|
end
|
||||||
{:noreply, socket |> assign(last_sort_key: key, sort_mode: :asc, rows: rows)}
|
|
||||||
|
rows = rows |> sort_by_custom_sort_value_or_value(key, sort_mode)
|
||||||
|
{:noreply, socket |> assign(last_sort_key: key, sort_mode: sort_mode, rows: rows)}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp sort_by_custom_sort_value_or_value(rows, key, sort_mode) do
|
defp sort_by_custom_sort_value_or_value(rows, key, sort_mode) do
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black">
|
<div id={@id} class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black">
|
||||||
<table class="min-w-full table-auto text-center bg-white">
|
<table class="min-w-full table-auto text-center bg-white">
|
||||||
<thead class="border-b border-primary-600">
|
<thead class="border-b border-primary-600">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -73,7 +73,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_event("toggle_show_used", _, %{assigns: %{show_used: show_used}} = socket) do
|
def handle_event("toggle_show_used", _params, %{assigns: %{show_used: show_used}} = socket) do
|
||||||
{:noreply, socket |> assign(:show_used, !show_used) |> display_ammo_groups()}
|
{:noreply, socket |> assign(:show_used, !show_used) |> display_ammo_groups()}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -87,16 +87,24 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
containers_count = Containers.get_containers_count!(current_user)
|
containers_count = Containers.get_containers_count!(current_user)
|
||||||
|
|
||||||
columns = [
|
columns = [
|
||||||
%{label: gettext("Ammo type"), key: "ammo_type"},
|
%{label: gettext("Ammo type"), key: :ammo_type},
|
||||||
%{label: gettext("Count"), key: "count"},
|
%{label: gettext("Count"), key: :count},
|
||||||
%{label: gettext("Price paid"), key: "price_paid"},
|
%{label: gettext("Price paid"), key: :price_paid},
|
||||||
%{label: gettext("% left"), key: "remaining"},
|
%{label: gettext("% left"), key: :remaining},
|
||||||
%{label: gettext("Range"), key: "range"},
|
%{label: gettext("Range"), key: :range},
|
||||||
%{label: gettext("Container"), key: "container"},
|
%{label: gettext("Container"), key: :container},
|
||||||
%{label: gettext("Added on"), key: "added_on"},
|
%{label: gettext("Added on"), key: :added_on}
|
||||||
%{label: nil, key: "actions", sortable: false}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
columns =
|
||||||
|
if show_used do
|
||||||
|
columns ++ [%{label: gettext("Used up on"), key: :used_up_on}]
|
||||||
|
else
|
||||||
|
columns
|
||||||
|
end
|
||||||
|
|
||||||
|
columns = columns ++ [%{label: nil, key: :actions, sortable: false}]
|
||||||
|
|
||||||
rows =
|
rows =
|
||||||
ammo_groups
|
ammo_groups
|
||||||
|> Enum.map(fn ammo_group -> ammo_group |> get_row_data_for_ammo_group(columns) end)
|
|> Enum.map(fn ammo_group -> ammo_group |> get_row_data_for_ammo_group(columns) end)
|
||||||
@ -119,8 +127,8 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
|> Enum.into(%{}, fn %{key: key} -> {key, get_value_for_key(key, ammo_group)} end)
|
|> Enum.into(%{}, fn %{key: key} -> {key, get_value_for_key(key, ammo_group)} end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec get_value_for_key(String.t(), AmmoGroup.t()) :: any()
|
@spec get_value_for_key(atom(), AmmoGroup.t()) :: any()
|
||||||
defp get_value_for_key("ammo_type", %{ammo_type: ammo_type}) do
|
defp get_value_for_key(:ammo_type, %{ammo_type: ammo_type}) do
|
||||||
{ammo_type.name,
|
{ammo_type.name,
|
||||||
live_patch(ammo_type.name,
|
live_patch(ammo_type.name,
|
||||||
to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type),
|
to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type),
|
||||||
@ -128,12 +136,12 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_value_for_key("price_paid", %{price_paid: nil}), do: {"a", nil}
|
defp get_value_for_key(:price_paid, %{price_paid: nil}), do: {"a", nil}
|
||||||
|
|
||||||
defp get_value_for_key("price_paid", %{price_paid: price_paid}),
|
defp get_value_for_key(:price_paid, %{price_paid: price_paid}),
|
||||||
do: gettext("$%{amount}", amount: price_paid |> :erlang.float_to_binary(decimals: 2))
|
do: gettext("$%{amount}", amount: price_paid |> :erlang.float_to_binary(decimals: 2))
|
||||||
|
|
||||||
defp get_value_for_key("added_on", %{inserted_at: inserted_at}) do
|
defp get_value_for_key(:added_on, %{inserted_at: inserted_at}) do
|
||||||
assigns = %{inserted_at: inserted_at}
|
assigns = %{inserted_at: inserted_at}
|
||||||
|
|
||||||
{inserted_at,
|
{inserted_at,
|
||||||
@ -142,7 +150,22 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
"""}
|
"""}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_value_for_key("range", %{staged: staged} = ammo_group) do
|
defp get_value_for_key(:used_up_on, ammo_group) do
|
||||||
|
last_shot_group_date =
|
||||||
|
case ammo_group |> Ammo.get_last_used_shot_group() do
|
||||||
|
%{date: last_shot_group_date} -> last_shot_group_date
|
||||||
|
_no_shot_groups -> nil
|
||||||
|
end
|
||||||
|
|
||||||
|
assigns = %{last_shot_group_date: last_shot_group_date}
|
||||||
|
|
||||||
|
{last_shot_group_date,
|
||||||
|
~H"""
|
||||||
|
<%= @last_shot_group_date |> display_date() %>
|
||||||
|
"""}
|
||||||
|
end
|
||||||
|
|
||||||
|
defp get_value_for_key(:range, %{staged: staged} = ammo_group) do
|
||||||
assigns = %{ammo_group: ammo_group}
|
assigns = %{ammo_group: ammo_group}
|
||||||
|
|
||||||
{staged,
|
{staged,
|
||||||
@ -165,10 +188,10 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
"""}
|
"""}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_value_for_key("remaining", ammo_group),
|
defp get_value_for_key(:remaining, ammo_group),
|
||||||
do: "#{ammo_group |> Ammo.get_percentage_remaining()}%"
|
do: "#{ammo_group |> Ammo.get_percentage_remaining()}%"
|
||||||
|
|
||||||
defp get_value_for_key("actions", ammo_group) do
|
defp get_value_for_key(:actions, ammo_group) do
|
||||||
assigns = %{ammo_group: ammo_group}
|
assigns = %{ammo_group: ammo_group}
|
||||||
|
|
||||||
~H"""
|
~H"""
|
||||||
@ -199,9 +222,9 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_value_for_key("container", %{container: nil}), do: {nil, nil}
|
defp get_value_for_key(:container, %{container: nil}), do: {nil, nil}
|
||||||
|
|
||||||
defp get_value_for_key("container", %{container: %{name: container_name}} = ammo_group) do
|
defp get_value_for_key(:container, %{container: %{name: container_name}} = ammo_group) do
|
||||||
assigns = %{ammo_group: ammo_group}
|
assigns = %{ammo_group: ammo_group}
|
||||||
|
|
||||||
{container_name,
|
{container_name,
|
||||||
@ -222,6 +245,5 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
"""}
|
"""}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_value_for_key(key, ammo_group),
|
defp get_value_for_key(key, ammo_group), do: ammo_group |> Map.get(key)
|
||||||
do: ammo_group |> Map.get(key |> String.to_existing_atom())
|
|
||||||
end
|
end
|
||||||
|
@ -84,10 +84,10 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
|
|||||||
ammo_group = ammo_group |> Repo.preload([:container, :ammo_type, :shot_groups], force: true)
|
ammo_group = ammo_group |> Repo.preload([:container, :ammo_type, :shot_groups], force: true)
|
||||||
|
|
||||||
columns = [
|
columns = [
|
||||||
%{label: gettext("Rounds shot"), key: "count"},
|
%{label: gettext("Rounds shot"), key: :count},
|
||||||
%{label: gettext("Notes"), key: "notes"},
|
%{label: gettext("Notes"), key: :notes},
|
||||||
%{label: gettext("Date"), key: "date"},
|
%{label: gettext("Date"), key: :date},
|
||||||
%{label: nil, key: "actions", sortable: false}
|
%{label: nil, key: :actions, sortable: false}
|
||||||
]
|
]
|
||||||
|
|
||||||
rows =
|
rows =
|
||||||
@ -110,10 +110,10 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
|
|||||||
|> Enum.into(%{}, fn %{key: key} ->
|
|> Enum.into(%{}, fn %{key: key} ->
|
||||||
value =
|
value =
|
||||||
case key do
|
case key do
|
||||||
"date" ->
|
:date ->
|
||||||
{date, date |> display_date()}
|
{date, date |> display_date()}
|
||||||
|
|
||||||
"actions" ->
|
:actions ->
|
||||||
~H"""
|
~H"""
|
||||||
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
|
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
|
||||||
<%= live_patch to: Routes.ammo_group_show_path(Endpoint, :edit_shot_group, @ammo_group, shot_group),
|
<%= live_patch to: Routes.ammo_group_show_path(Endpoint, :edit_shot_group, @ammo_group, shot_group),
|
||||||
@ -136,7 +136,7 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
key ->
|
key ->
|
||||||
shot_group |> Map.get(key |> String.to_existing_atom())
|
shot_group |> Map.get(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
{key, value}
|
{key, value}
|
||||||
|
@ -48,29 +48,29 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
|
|||||||
|
|
||||||
columns =
|
columns =
|
||||||
[
|
[
|
||||||
%{label: gettext("Name"), key: "name", type: :name},
|
%{label: gettext("Name"), key: :name, type: :name},
|
||||||
%{label: gettext("Bullet type"), key: "bullet_type", type: :string},
|
%{label: gettext("Bullet type"), key: :bullet_type, type: :string},
|
||||||
%{label: gettext("Bullet core"), key: "bullet_core", type: :string},
|
%{label: gettext("Bullet core"), key: :bullet_core, type: :string},
|
||||||
%{label: gettext("Cartridge"), key: "cartridge", type: :string},
|
%{label: gettext("Cartridge"), key: :cartridge, type: :string},
|
||||||
%{label: gettext("Caliber"), key: "caliber", type: :string},
|
%{label: gettext("Caliber"), key: :caliber, type: :string},
|
||||||
%{label: gettext("Case material"), key: "case_material", type: :string},
|
%{label: gettext("Case material"), key: :case_material, type: :string},
|
||||||
%{label: gettext("Jacket type"), key: "jacket_type", type: :string},
|
%{label: gettext("Jacket type"), key: :jacket_type, type: :string},
|
||||||
%{label: gettext("Muzzle velocity"), key: "muzzle_velocity", type: :string},
|
%{label: gettext("Muzzle velocity"), key: :muzzle_velocity, type: :string},
|
||||||
%{label: gettext("Powder type"), key: "powder_type", type: :string},
|
%{label: gettext("Powder type"), key: :powder_type, type: :string},
|
||||||
%{
|
%{
|
||||||
label: gettext("Powder grains per charge"),
|
label: gettext("Powder grains per charge"),
|
||||||
key: "powder_grains_per_charge",
|
key: :powder_grains_per_charge,
|
||||||
type: :string
|
type: :string
|
||||||
},
|
},
|
||||||
%{label: gettext("Grains"), key: "grains", type: :string},
|
%{label: gettext("Grains"), key: :grains, type: :string},
|
||||||
%{label: gettext("Pressure"), key: "pressure", type: :string},
|
%{label: gettext("Pressure"), key: :pressure, type: :string},
|
||||||
%{label: gettext("Primer type"), key: "primer_type", type: :string},
|
%{label: gettext("Primer type"), key: :primer_type, type: :string},
|
||||||
%{label: gettext("Firing type"), key: "firing_type", type: :string},
|
%{label: gettext("Firing type"), key: :firing_type, type: :string},
|
||||||
%{label: gettext("Tracer"), key: "tracer", type: :boolean},
|
%{label: gettext("Tracer"), key: :tracer, type: :boolean},
|
||||||
%{label: gettext("Incendiary"), key: "incendiary", type: :boolean},
|
%{label: gettext("Incendiary"), key: :incendiary, type: :boolean},
|
||||||
%{label: gettext("Blank"), key: "blank", type: :boolean},
|
%{label: gettext("Blank"), key: :blank, type: :boolean},
|
||||||
%{label: gettext("Corrosive"), key: "corrosive", type: :boolean},
|
%{label: gettext("Corrosive"), key: :corrosive, type: :boolean},
|
||||||
%{label: gettext("Manufacturer"), key: "manufacturer", type: :string},
|
%{label: gettext("Manufacturer"), key: :manufacturer, type: :string},
|
||||||
%{label: gettext("UPC"), key: "upc", type: :string}
|
%{label: gettext("UPC"), key: "upc", type: :string}
|
||||||
]
|
]
|
||||||
|> Enum.filter(fn %{key: key, type: type} ->
|
|> Enum.filter(fn %{key: key, type: type} ->
|
||||||
@ -79,13 +79,13 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
|
|||||||
|
|
||||||
ammo_types
|
ammo_types
|
||||||
|> Enum.any?(fn ammo_type ->
|
|> Enum.any?(fn ammo_type ->
|
||||||
not (ammo_type |> Map.get(key |> String.to_existing_atom()) == default_value)
|
not (ammo_type |> Map.get(key) == default_value)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|> Kernel.++([
|
|> Kernel.++([
|
||||||
%{label: gettext("Total # of rounds"), key: "round_count", type: :round_count},
|
%{label: gettext("Total # of rounds"), key: :round_count, type: :round_count},
|
||||||
%{label: gettext("Total # of ammo"), key: "ammo_count", type: :ammo_count},
|
%{label: gettext("Total # of ammo"), key: :ammo_count, type: :ammo_count},
|
||||||
%{label: gettext("Average Price paid"), key: "avg_price_paid", type: :avg_price_paid},
|
%{label: gettext("Average Price paid"), key: :avg_price_paid, type: :avg_price_paid},
|
||||||
%{label: nil, key: "actions", type: :actions, sortable: false}
|
%{label: nil, key: "actions", type: :actions, sortable: false}
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp get_ammo_type_value(:boolean, key, ammo_type, _current_user),
|
defp get_ammo_type_value(:boolean, key, ammo_type, _current_user),
|
||||||
do: ammo_type |> Map.get(key |> String.to_existing_atom()) |> humanize()
|
do: ammo_type |> Map.get(key) |> humanize()
|
||||||
|
|
||||||
defp get_ammo_type_value(:round_count, _key, ammo_type, current_user),
|
defp get_ammo_type_value(:round_count, _key, ammo_type, current_user),
|
||||||
do: ammo_type |> Ammo.get_round_count_for_ammo_type(current_user)
|
do: ammo_type |> Ammo.get_round_count_for_ammo_type(current_user)
|
||||||
@ -164,6 +164,5 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
|
|||||||
|
|
||||||
defp get_ammo_type_value(nil, _key, _ammo_type, _current_user), do: nil
|
defp get_ammo_type_value(nil, _key, _ammo_type, _current_user), do: nil
|
||||||
|
|
||||||
defp get_ammo_type_value(_other, key, ammo_type, _current_user),
|
defp get_ammo_type_value(_other, key, ammo_type, _current_user), do: ammo_type |> Map.get(key)
|
||||||
do: ammo_type |> Map.get(key |> String.to_existing_atom())
|
|
||||||
end
|
end
|
||||||
|
@ -32,7 +32,7 @@ defmodule CanneryWeb.AmmoTypeLive.Show do
|
|||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_event("toggle_show_used", _, %{assigns: %{show_used: show_used}} = socket) do
|
def handle_event("toggle_show_used", _params, %{assigns: %{show_used: show_used}} = socket) do
|
||||||
{:noreply, socket |> assign(:show_used, !show_used) |> display_ammo_type()}
|
{:noreply, socket |> assign(:show_used, !show_used) |> display_ammo_type()}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ defmodule CanneryWeb.ContainerLive.Show do
|
|||||||
|
|
||||||
use CanneryWeb, :live_view
|
use CanneryWeb, :live_view
|
||||||
import CanneryWeb.Components.{AmmoGroupCard, TagCard}
|
import CanneryWeb.Components.{AmmoGroupCard, TagCard}
|
||||||
alias Cannery.{Ammo, Accounts.User, Containers, Containers.Container, Repo, Tags}
|
alias Cannery.{Accounts.User, Ammo, Containers, Containers.Container, Repo, Tags}
|
||||||
alias CanneryWeb.Endpoint
|
alias CanneryWeb.Endpoint
|
||||||
alias Ecto.Changeset
|
alias Ecto.Changeset
|
||||||
alias Phoenix.LiveView.Socket
|
alias Phoenix.LiveView.Socket
|
||||||
@ -83,7 +83,7 @@ defmodule CanneryWeb.ContainerLive.Show do
|
|||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_event("toggle_show_used", _, %{assigns: %{show_used: show_used}} = socket) do
|
def handle_event("toggle_show_used", _params, %{assigns: %{show_used: show_used}} = socket) do
|
||||||
{:noreply, socket |> assign(:show_used, !show_used) |> render_container()}
|
{:noreply, socket |> assign(:show_used, !show_used) |> render_container()}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,11 +77,11 @@ defmodule CanneryWeb.RangeLive.Index do
|
|||||||
ammo_groups = Ammo.list_staged_ammo_groups(current_user)
|
ammo_groups = Ammo.list_staged_ammo_groups(current_user)
|
||||||
|
|
||||||
columns = [
|
columns = [
|
||||||
%{label: gettext("Ammo"), key: "name"},
|
%{label: gettext("Ammo"), key: :name},
|
||||||
%{label: gettext("Rounds shot"), key: "count"},
|
%{label: gettext("Rounds shot"), key: :count},
|
||||||
%{label: gettext("Notes"), key: "notes"},
|
%{label: gettext("Notes"), key: :notes},
|
||||||
%{label: gettext("Date"), key: "date"},
|
%{label: gettext("Date"), key: :date},
|
||||||
%{label: nil, key: "actions", sortable: false}
|
%{label: nil, key: :actions, sortable: false}
|
||||||
]
|
]
|
||||||
|
|
||||||
rows =
|
rows =
|
||||||
@ -101,17 +101,17 @@ defmodule CanneryWeb.RangeLive.Index do
|
|||||||
|> Enum.into(%{}, fn %{key: key} ->
|
|> Enum.into(%{}, fn %{key: key} ->
|
||||||
value =
|
value =
|
||||||
case key do
|
case key do
|
||||||
"name" ->
|
:name ->
|
||||||
{shot_group.ammo_group.ammo_type.name,
|
{shot_group.ammo_group.ammo_type.name,
|
||||||
live_patch(shot_group.ammo_group.ammo_type.name,
|
live_patch(shot_group.ammo_group.ammo_type.name,
|
||||||
to: Routes.ammo_group_show_path(Endpoint, :show, shot_group.ammo_group),
|
to: Routes.ammo_group_show_path(Endpoint, :show, shot_group.ammo_group),
|
||||||
class: "link"
|
class: "link"
|
||||||
)}
|
)}
|
||||||
|
|
||||||
"date" ->
|
:date ->
|
||||||
date |> display_date()
|
date |> display_date()
|
||||||
|
|
||||||
"actions" ->
|
:actions ->
|
||||||
~H"""
|
~H"""
|
||||||
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
|
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
|
||||||
<%= live_patch to: Routes.range_index_path(Endpoint, :edit, shot_group),
|
<%= live_patch to: Routes.range_index_path(Endpoint, :edit, shot_group),
|
||||||
@ -134,7 +134,7 @@ defmodule CanneryWeb.RangeLive.Index do
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
key ->
|
key ->
|
||||||
shot_group |> Map.get(key |> String.to_existing_atom())
|
shot_group |> Map.get(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
{key, value}
|
{key, value}
|
||||||
|
@ -156,7 +156,7 @@ msgid "Why not get some ready to shoot?"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:160
|
#: lib/cannery_web/live/ammo_group_live/index.ex:183
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
||||||
#: lib/cannery_web/live/range_live/index.html.heex:36
|
#: lib/cannery_web/live/range_live/index.html.heex:36
|
||||||
msgid "Record shots"
|
msgid "Record shots"
|
||||||
|
@ -169,7 +169,7 @@ msgid "Why not get some ready to shoot?"
|
|||||||
msgstr "Warum nicht einige für den Schießstand auswählen?"
|
msgstr "Warum nicht einige für den Schießstand auswählen?"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:160
|
#: lib/cannery_web/live/ammo_group_live/index.ex:183
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
||||||
#: lib/cannery_web/live/range_live/index.html.heex:36
|
#: lib/cannery_web/live/range_live/index.html.heex:36
|
||||||
msgid "Record shots"
|
msgid "Record shots"
|
||||||
|
@ -376,7 +376,7 @@ msgid "Price paid"
|
|||||||
msgstr "Kaufpreis"
|
msgstr "Kaufpreis"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:52
|
#: lib/cannery_web/components/ammo_group_card.ex:59
|
||||||
msgid "Price paid:"
|
msgid "Price paid:"
|
||||||
msgstr "Kaufpreis:"
|
msgstr "Kaufpreis:"
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ msgstr "Munitionsgruppe verschieben"
|
|||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:217
|
#: lib/cannery_web/live/ammo_group_live/index.ex:240
|
||||||
msgid "Move ammo"
|
msgid "Move ammo"
|
||||||
msgstr "Munition verschieben"
|
msgstr "Munition verschieben"
|
||||||
|
|
||||||
@ -616,8 +616,8 @@ msgid "Shot log"
|
|||||||
msgstr "Schießkladde"
|
msgstr "Schießkladde"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:53
|
#: lib/cannery_web/components/ammo_group_card.ex:60
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:134
|
#: lib/cannery_web/live/ammo_group_live/index.ex:142
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
||||||
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
||||||
@ -682,12 +682,12 @@ msgid "New password"
|
|||||||
msgstr "Neues Passwort"
|
msgstr "Neues Passwort"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Stage"
|
msgid "Stage"
|
||||||
msgstr "Markiert"
|
msgstr "Markiert"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Unstage"
|
msgid "Unstage"
|
||||||
msgstr "Demarkiert"
|
msgstr "Demarkiert"
|
||||||
|
|
||||||
@ -942,7 +942,7 @@ msgid "Total # of ammo"
|
|||||||
msgstr "Summe aller Patronen"
|
msgstr "Summe aller Patronen"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format, fuzzy
|
#, elixir-autogen, elixir-format, fuzzy
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:61
|
#: lib/cannery_web/components/ammo_group_card.ex:68
|
||||||
msgid "Container:"
|
msgid "Container:"
|
||||||
msgstr "Behälter"
|
msgstr "Behälter"
|
||||||
|
|
||||||
@ -952,3 +952,13 @@ msgstr "Behälter"
|
|||||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||||
msgid "Show used"
|
msgid "Show used"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:101
|
||||||
|
msgid "Used up on"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/components/ammo_group_card.ex:52
|
||||||
|
msgid "Used up on:"
|
||||||
|
msgstr ""
|
||||||
|
@ -188,7 +188,7 @@ msgstr ""
|
|||||||
"%{multiplier}"
|
"%{multiplier}"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery/ammo.ex:524
|
#: lib/cannery/ammo.ex:535
|
||||||
msgid "Invalid multiplier"
|
msgid "Invalid multiplier"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ msgid "Are you sure you want to delete the invite for %{name}?"
|
|||||||
msgstr "Sind Sie sicher, dass sie die Einladung für %{name} löschen möchten?"
|
msgstr "Sind Sie sicher, dass sie die Einladung für %{name} löschen möchten?"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:193
|
#: lib/cannery_web/live/ammo_group_live/index.ex:216
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
||||||
msgid "Are you sure you want to delete this ammo?"
|
msgid "Are you sure you want to delete this ammo?"
|
||||||
msgstr "Sind Sie sicher, dass sie diese Munition löschen möchten?"
|
msgstr "Sind Sie sicher, dass sie diese Munition löschen möchten?"
|
||||||
|
@ -361,7 +361,7 @@ msgid "Price paid"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:52
|
#: lib/cannery_web/components/ammo_group_card.ex:59
|
||||||
msgid "Price paid:"
|
msgid "Price paid:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ msgstr ""
|
|||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:217
|
#: lib/cannery_web/live/ammo_group_live/index.ex:240
|
||||||
msgid "Move ammo"
|
msgid "Move ammo"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -599,8 +599,8 @@ msgid "Shot log"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:53
|
#: lib/cannery_web/components/ammo_group_card.ex:60
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:134
|
#: lib/cannery_web/live/ammo_group_live/index.ex:142
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
||||||
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
||||||
@ -665,12 +665,12 @@ msgid "New password"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Stage"
|
msgid "Stage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Unstage"
|
msgid "Unstage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -925,7 +925,7 @@ msgid "Total # of ammo"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:61
|
#: lib/cannery_web/components/ammo_group_card.ex:68
|
||||||
msgid "Container:"
|
msgid "Container:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -935,3 +935,13 @@ msgstr ""
|
|||||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||||
msgid "Show used"
|
msgid "Show used"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:101
|
||||||
|
msgid "Used up on"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/components/ammo_group_card.ex:52
|
||||||
|
msgid "Used up on:"
|
||||||
|
msgstr ""
|
||||||
|
@ -157,7 +157,7 @@ msgid "Why not get some ready to shoot?"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:160
|
#: lib/cannery_web/live/ammo_group_live/index.ex:183
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
||||||
#: lib/cannery_web/live/range_live/index.html.heex:36
|
#: lib/cannery_web/live/range_live/index.html.heex:36
|
||||||
msgid "Record shots"
|
msgid "Record shots"
|
||||||
|
@ -362,7 +362,7 @@ msgid "Price paid"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:52
|
#: lib/cannery_web/components/ammo_group_card.ex:59
|
||||||
msgid "Price paid:"
|
msgid "Price paid:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ msgstr ""
|
|||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:217
|
#: lib/cannery_web/live/ammo_group_live/index.ex:240
|
||||||
msgid "Move ammo"
|
msgid "Move ammo"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -600,8 +600,8 @@ msgid "Shot log"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:53
|
#: lib/cannery_web/components/ammo_group_card.ex:60
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:134
|
#: lib/cannery_web/live/ammo_group_live/index.ex:142
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
||||||
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
||||||
@ -666,12 +666,12 @@ msgid "New password"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Stage"
|
msgid "Stage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Unstage"
|
msgid "Unstage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -926,7 +926,7 @@ msgid "Total # of ammo"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format, fuzzy
|
#, elixir-autogen, elixir-format, fuzzy
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:61
|
#: lib/cannery_web/components/ammo_group_card.ex:68
|
||||||
msgid "Container:"
|
msgid "Container:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -936,3 +936,13 @@ msgstr ""
|
|||||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||||
msgid "Show used"
|
msgid "Show used"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:101
|
||||||
|
msgid "Used up on"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/components/ammo_group_card.ex:52
|
||||||
|
msgid "Used up on:"
|
||||||
|
msgstr ""
|
||||||
|
@ -171,7 +171,7 @@ msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery/ammo.ex:524
|
#: lib/cannery/ammo.ex:535
|
||||||
msgid "Invalid multiplier"
|
msgid "Invalid multiplier"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ msgid "Are you sure you want to delete the invite for %{name}?"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:193
|
#: lib/cannery_web/live/ammo_group_live/index.ex:216
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
||||||
msgid "Are you sure you want to delete this ammo?"
|
msgid "Are you sure you want to delete this ammo?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -170,7 +170,7 @@ msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery/ammo.ex:524
|
#: lib/cannery/ammo.ex:535
|
||||||
msgid "Invalid multiplier"
|
msgid "Invalid multiplier"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ msgid "Why not get some ready to shoot?"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:160
|
#: lib/cannery_web/live/ammo_group_live/index.ex:183
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
||||||
#: lib/cannery_web/live/range_live/index.html.heex:36
|
#: lib/cannery_web/live/range_live/index.html.heex:36
|
||||||
msgid "Record shots"
|
msgid "Record shots"
|
||||||
|
@ -376,7 +376,7 @@ msgid "Price paid"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:52
|
#: lib/cannery_web/components/ammo_group_card.ex:59
|
||||||
msgid "Price paid:"
|
msgid "Price paid:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -599,7 +599,7 @@ msgstr ""
|
|||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:217
|
#: lib/cannery_web/live/ammo_group_live/index.ex:240
|
||||||
msgid "Move ammo"
|
msgid "Move ammo"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -614,8 +614,8 @@ msgid "Shot log"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:53
|
#: lib/cannery_web/components/ammo_group_card.ex:60
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:134
|
#: lib/cannery_web/live/ammo_group_live/index.ex:142
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
||||||
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
||||||
@ -680,12 +680,12 @@ msgid "New password"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Stage"
|
msgid "Stage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Unstage"
|
msgid "Unstage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -940,7 +940,7 @@ msgid "Total # of ammo"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format, fuzzy
|
#, elixir-autogen, elixir-format, fuzzy
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:61
|
#: lib/cannery_web/components/ammo_group_card.ex:68
|
||||||
msgid "Container:"
|
msgid "Container:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -950,3 +950,13 @@ msgstr ""
|
|||||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||||
msgid "Show used"
|
msgid "Show used"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:101
|
||||||
|
msgid "Used up on"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/components/ammo_group_card.ex:52
|
||||||
|
msgid "Used up on:"
|
||||||
|
msgstr ""
|
||||||
|
@ -186,7 +186,7 @@ msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery/ammo.ex:524
|
#: lib/cannery/ammo.ex:535
|
||||||
msgid "Invalid multiplier"
|
msgid "Invalid multiplier"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ msgid "Are you sure you want to delete the invite for %{name}?"
|
|||||||
msgstr "Está seguro que quiere eliminar la invitación para %{name}?"
|
msgstr "Está seguro que quiere eliminar la invitación para %{name}?"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:193
|
#: lib/cannery_web/live/ammo_group_live/index.ex:216
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
||||||
msgid "Are you sure you want to delete this ammo?"
|
msgid "Are you sure you want to delete this ammo?"
|
||||||
msgstr "Está seguro que desea eliminar esta munición?"
|
msgstr "Está seguro que desea eliminar esta munición?"
|
||||||
|
@ -169,7 +169,7 @@ msgid "Why not get some ready to shoot?"
|
|||||||
msgstr "Pourquoi pas en préparer pour tirer ?"
|
msgstr "Pourquoi pas en préparer pour tirer ?"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:160
|
#: lib/cannery_web/live/ammo_group_live/index.ex:183
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
|
||||||
#: lib/cannery_web/live/range_live/index.html.heex:36
|
#: lib/cannery_web/live/range_live/index.html.heex:36
|
||||||
msgid "Record shots"
|
msgid "Record shots"
|
||||||
|
@ -376,7 +376,7 @@ msgid "Price paid"
|
|||||||
msgstr "Prix payé"
|
msgstr "Prix payé"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:52
|
#: lib/cannery_web/components/ammo_group_card.ex:59
|
||||||
msgid "Price paid:"
|
msgid "Price paid:"
|
||||||
msgstr "Prix payé :"
|
msgstr "Prix payé :"
|
||||||
|
|
||||||
@ -603,7 +603,7 @@ msgstr "Déplacer le groupe de munition"
|
|||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
#: lib/cannery_web/components/move_ammo_group_component.ex:80
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:217
|
#: lib/cannery_web/live/ammo_group_live/index.ex:240
|
||||||
msgid "Move ammo"
|
msgid "Move ammo"
|
||||||
msgstr "Déplacer munition"
|
msgstr "Déplacer munition"
|
||||||
|
|
||||||
@ -618,8 +618,8 @@ msgid "Shot log"
|
|||||||
msgstr "Évènements de tir"
|
msgstr "Évènements de tir"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:53
|
#: lib/cannery_web/components/ammo_group_card.ex:60
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:134
|
#: lib/cannery_web/live/ammo_group_live/index.ex:142
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
|
||||||
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
#: lib/cannery_web/live/ammo_type_live/index.ex:118
|
||||||
@ -684,12 +684,12 @@ msgid "New password"
|
|||||||
msgstr "Nouveau mot de passe"
|
msgstr "Nouveau mot de passe"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Stage"
|
msgid "Stage"
|
||||||
msgstr "Sélectionné"
|
msgstr "Sélectionné"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:157
|
#: lib/cannery_web/live/ammo_group_live/index.ex:180
|
||||||
msgid "Unstage"
|
msgid "Unstage"
|
||||||
msgstr "Désélectionner"
|
msgstr "Désélectionner"
|
||||||
|
|
||||||
@ -944,7 +944,7 @@ msgid "Total # of ammo"
|
|||||||
msgstr "Quantité de cartouches"
|
msgstr "Quantité de cartouches"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format, fuzzy
|
#, elixir-autogen, elixir-format, fuzzy
|
||||||
#: lib/cannery_web/components/ammo_group_card.ex:61
|
#: lib/cannery_web/components/ammo_group_card.ex:68
|
||||||
msgid "Container:"
|
msgid "Container:"
|
||||||
msgstr "Conteneur"
|
msgstr "Conteneur"
|
||||||
|
|
||||||
@ -954,3 +954,13 @@ msgstr "Conteneur"
|
|||||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||||
msgid "Show used"
|
msgid "Show used"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:101
|
||||||
|
msgid "Used up on"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
#: lib/cannery_web/components/ammo_group_card.ex:52
|
||||||
|
msgid "Used up on:"
|
||||||
|
msgstr ""
|
||||||
|
@ -187,7 +187,7 @@ 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}"
|
msgstr "Nombre de copies invalide, doit être 1 et %{max}. Été %{multiplier}"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery/ammo.ex:524
|
#: lib/cannery/ammo.ex:535
|
||||||
msgid "Invalid multiplier"
|
msgid "Invalid multiplier"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ msgid "Are you sure you want to delete the invite for %{name}?"
|
|||||||
msgstr "Êtes-vous certain·e de supprimer l’invitation pour %{name} ?"
|
msgstr "Êtes-vous certain·e de supprimer l’invitation pour %{name} ?"
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:193
|
#: lib/cannery_web/live/ammo_group_live/index.ex:216
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
||||||
msgid "Are you sure you want to delete this ammo?"
|
msgid "Are you sure you want to delete this ammo?"
|
||||||
msgstr "Êtes-vous certain·e de supprimer cette munition ?"
|
msgstr "Êtes-vous certain·e de supprimer cette munition ?"
|
||||||
|
@ -85,7 +85,7 @@ msgid "Are you sure you want to delete the invite for %{name}?"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
#: lib/cannery_web/live/ammo_group_live/index.ex:193
|
#: lib/cannery_web/live/ammo_group_live/index.ex:216
|
||||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
|
||||||
msgid "Are you sure you want to delete this ammo?"
|
msgid "Are you sure you want to delete this ammo?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
Loading…
Reference in New Issue
Block a user