Compare commits

...

12 Commits

Author SHA1 Message Date
f246b9db93 prompt to create first ammo type before trying to create first ammo
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-04 21:41:07 -04:00
5836a82ff7 add note about ammo when deleting ammo type 2022-07-04 21:40:07 -04:00
7464947497 use initial ammo group form component select state 2022-07-04 21:22:59 -04:00
3adb8c9aae pass invite token in properly 2022-07-04 21:16:09 -04:00
dce04e4d7f harden invite changesets 2022-07-04 21:09:55 -04:00
ee6266be3f harden tag changesets 2022-07-04 21:06:35 -04:00
36f56528ee use container changeset helper 2022-07-04 20:52:21 -04:00
76bbab1de9 add logo contribution 2022-07-04 20:47:12 -04:00
6c09261368 use changeset helper 2022-07-04 20:39:21 -04:00
3593334c85 fix container changeset 2022-07-04 20:30:05 -04:00
57b5cb432d fix container tag changeset 2022-07-04 20:25:55 -04:00
5b5fd7173b fix ammo type changesets 2022-07-04 20:22:39 -04:00
44 changed files with 494 additions and 382 deletions

View File

@ -3,6 +3,9 @@
- Ammo groups are now just referred to as Ammo or "Packs"
- URL paths now reflect new names
- Add pack and round count to container information
- Add cute logo >:3 Thank you [kalli](https://twitter.com/t0kkuro)!
- Add note about deleting an ammo type deleting all ammo of that type as well
- Prompt to create first ammo type before trying to create first ammo
# v0.5.3
- Update French translation: Thank you [duponin](https://udongein.xyz/users/duponin)!

View File

@ -143,3 +143,4 @@ Thank you so much for your contributions!
- shibao (https://misskey.bubbletea.dev/@shibao)
- kaia (https://shitposter.club/users/kaia)
- duponin (https://udongein.xyz/users/duponin)
- kalli (https://twitter.com/t0kkuro)

View File

@ -25,6 +25,25 @@ defmodule Cannery.Ammo do
def list_ammo_types(%User{id: user_id}),
do: Repo.all(from at in AmmoType, where: at.user_id == ^user_id, order_by: at.name)
@doc """
Returns a count of ammo_types.
## Examples
iex> get_ammo_types_count!(%User{id: 123})
3
"""
@spec get_ammo_types_count!(User.t()) :: integer()
def get_ammo_types_count!(%User{id: user_id}) do
Repo.one(
from at in AmmoType,
where: at.user_id == ^user_id,
select: count(at.id),
distinct: true
)
end
@doc """
Gets a single ammo_type.
@ -141,11 +160,8 @@ defmodule Cannery.Ammo do
"""
@spec create_ammo_type(attrs :: map(), User.t()) ::
{:ok, AmmoType.t()} | {:error, Changeset.t(AmmoType.new_ammo_type())}
def create_ammo_type(attrs \\ %{}, %User{id: user_id}) do
%AmmoType{}
|> AmmoType.create_changeset(attrs |> Map.put("user_id", user_id))
|> Repo.insert()
end
def create_ammo_type(attrs \\ %{}, %User{} = user),
do: %AmmoType{} |> AmmoType.create_changeset(user, attrs) |> Repo.insert()
@doc """
Updates a ammo_type.
@ -194,22 +210,6 @@ defmodule Cannery.Ammo do
def delete_ammo_type!(%AmmoType{user_id: user_id} = ammo_type, %User{id: user_id}),
do: ammo_type |> Repo.delete!()
@doc """
Returns an `%Changeset{}` for tracking ammo_type changes.
## Examples
iex> change_ammo_type(ammo_type)
%Changeset{data: %AmmoType{}}
"""
@spec change_ammo_type(AmmoType.t() | AmmoType.new_ammo_type()) ::
Changeset.t(AmmoType.t() | AmmoType.new_ammo_type())
@spec change_ammo_type(AmmoType.t() | AmmoType.new_ammo_type(), attrs :: map()) ::
Changeset.t(AmmoType.t() | AmmoType.new_ammo_type())
def change_ammo_type(%AmmoType{} = ammo_type, attrs \\ %{}),
do: AmmoType.update_changeset(ammo_type, attrs)
@doc """
Returns the list of ammo_groups for a user and type.

View File

@ -105,10 +105,12 @@ defmodule Cannery.Ammo.AmmoType do
]
@doc false
@spec create_changeset(new_ammo_type(), attrs :: map()) :: Changeset.t(new_ammo_type())
def create_changeset(ammo_type, attrs) do
@spec create_changeset(new_ammo_type(), User.t(), attrs :: map()) ::
Changeset.t(new_ammo_type())
def create_changeset(ammo_type, %User{id: user_id}, attrs) do
ammo_type
|> cast(attrs, [:user_id | changeset_fields()])
|> change(user_id: user_id)
|> cast(attrs, changeset_fields())
|> validate_required([:name, :user_id])
end

View File

@ -30,6 +30,25 @@ defmodule Cannery.Containers do
)
end
@doc """
Returns a count of containers.
## Examples
iex> get_containers_count!(%User{id: 123})
3
"""
@spec get_containers_count!(User.t()) :: integer()
def get_containers_count!(%User{id: user_id}) do
Repo.one(
from c in Container,
where: c.user_id == ^user_id,
select: count(c.id),
distinct: true
)
end
@doc """
Gets a single container.
@ -71,9 +90,8 @@ defmodule Cannery.Containers do
"""
@spec create_container(attrs :: map(), User.t()) ::
{:ok, Container.t()} | {:error, Changeset.t(Container.new_container())}
def create_container(attrs, %User{id: user_id}) do
attrs = attrs |> Map.put("user_id", user_id)
%Container{} |> Container.create_changeset(attrs) |> Repo.insert()
def create_container(attrs, %User{} = user) do
%Container{} |> Container.create_changeset(user, attrs) |> Repo.insert()
end
@doc """
@ -122,7 +140,7 @@ defmodule Cannery.Containers do
error = dgettext("errors", "Container must be empty before deleting")
container
|> change_container()
|> Container.update_changeset(%{})
|> Changeset.add_error(:ammo_groups, error)
|> Changeset.apply_action(:delete)
end
@ -143,25 +161,6 @@ defmodule Cannery.Containers do
container
end
@doc """
Returns an `%Changeset{}` for tracking container changes.
## Examples
iex> change_container(container)
%Changeset{data: %Container{}}
iex> change_container(%Changeset{})
%Changeset{data: %Container{}}
"""
@spec change_container(Container.t() | Container.new_container()) ::
Changeset.t(Container.t() | Container.new_container())
@spec change_container(Container.t() | Container.new_container(), attrs :: map()) ::
Changeset.t(Container.t() | Container.new_container())
def change_container(container, attrs \\ %{}),
do: container |> Container.update_changeset(attrs)
@doc """
Adds a tag to a container
@ -173,14 +172,11 @@ defmodule Cannery.Containers do
"""
@spec add_tag!(Container.t(), Tag.t(), User.t()) :: ContainerTag.t()
def add_tag!(
%Container{id: container_id, user_id: user_id},
%Tag{id: tag_id, user_id: user_id},
%Container{user_id: user_id} = container,
%Tag{user_id: user_id} = tag,
%User{id: user_id}
) do
%ContainerTag{}
|> ContainerTag.changeset(%{"container_id" => container_id, "tag_id" => tag_id})
|> Repo.insert!()
end
),
do: %ContainerTag{} |> ContainerTag.create_changeset(tag, container) |> Repo.insert!()
@doc """
Removes a tag from a container

View File

@ -42,10 +42,12 @@ defmodule Cannery.Containers.Container do
@type id :: UUID.t()
@doc false
@spec create_changeset(new_container(), attrs :: map()) :: Changeset.t(new_container())
def create_changeset(container, attrs) do
@spec create_changeset(new_container(), User.t(), attrs :: map()) ::
Changeset.t(new_container())
def create_changeset(container, %User{id: user_id}, attrs) do
container
|> cast(attrs, [:name, :desc, :type, :location, :user_id])
|> change(user_id: user_id)
|> cast(attrs, [:name, :desc, :type, :location])
|> validate_required([:name, :type, :user_id])
end

View File

@ -31,10 +31,16 @@ defmodule Cannery.Containers.ContainerTag do
@type id :: UUID.t()
@doc false
@spec changeset(new_container_tag(), attrs :: map()) :: Changeset.t(new_container_tag())
def changeset(container_tag, attrs) do
@spec create_changeset(new_container_tag(), Tag.t(), Container.t()) ::
Changeset.t(new_container_tag())
def create_changeset(
container_tag,
%Tag{id: tag_id, user_id: user_id},
%Container{id: container_id, user_id: user_id}
) do
container_tag
|> cast(attrs, [:tag_id, :container_id])
|> change(tag_id: tag_id)
|> change(container_id: container_id)
|> validate_required([:tag_id, :container_id])
end
end

View File

@ -100,15 +100,13 @@ defmodule Cannery.Invites do
"""
@spec create_invite(User.t(), attrs :: map()) ::
{:ok, Invite.t()} | {:error, Changeset.t(Invite.new_invite())}
def create_invite(%User{id: user_id, role: :admin}, attrs) do
def create_invite(%User{role: :admin} = user, attrs) do
token =
:crypto.strong_rand_bytes(@invite_token_length)
|> Base.url_encode64()
|> binary_part(0, @invite_token_length)
attrs = attrs |> Map.merge(%{"user_id" => user_id, "token" => token})
%Invite{} |> Invite.create_changeset(attrs) |> Repo.insert()
%Invite{} |> Invite.create_changeset(user, token, attrs) |> Repo.insert()
end
@doc """
@ -155,19 +153,4 @@ defmodule Cannery.Invites do
"""
@spec delete_invite!(Invite.t(), User.t()) :: Invite.t()
def delete_invite!(invite, %User{role: :admin}), do: invite |> Repo.delete!()
@doc """
Returns an `%Changeset{}` for tracking invite changes.
## Examples
iex> change_invite(invite)
%Changeset{data: %Invite{}}
"""
@spec change_invite(Invite.t() | Invite.new_invite()) ::
Changeset.t(Invite.t() | Invite.new_invite())
@spec change_invite(Invite.t() | Invite.new_invite(), attrs :: map()) ::
Changeset.t(Invite.t() | Invite.new_invite())
def change_invite(invite, attrs \\ %{}), do: invite |> Invite.update_changeset(attrs)
end

View File

@ -38,10 +38,12 @@ defmodule Cannery.Invites.Invite do
@type id :: UUID.t()
@doc false
@spec create_changeset(new_invite(), attrs :: map()) :: Changeset.t(new_invite())
def create_changeset(invite, attrs) do
@spec create_changeset(new_invite(), User.t(), token :: binary(), attrs :: map()) ::
Changeset.t(new_invite())
def create_changeset(invite, %User{id: user_id}, token, attrs) do
invite
|> cast(attrs, [:name, :token, :uses_left, :disabled_at, :user_id])
|> change(token: token, user_id: user_id)
|> cast(attrs, [:name, :uses_left, :disabled_at])
|> validate_required([:name, :token, :user_id])
|> validate_number(:uses_left, greater_than_or_equal_to: 0)
end

View File

@ -74,8 +74,8 @@ defmodule Cannery.Tags do
"""
@spec create_tag(attrs :: map(), User.t()) ::
{:ok, Tag.t()} | {:error, Changeset.t(Tag.new_tag())}
def create_tag(attrs, %User{id: user_id}),
do: %Tag{} |> Tag.create_changeset(attrs |> Map.put("user_id", user_id)) |> Repo.insert()
def create_tag(attrs, %User{} = user),
do: %Tag{} |> Tag.create_changeset(user, attrs) |> Repo.insert()
@doc """
Updates a tag.
@ -121,20 +121,6 @@ defmodule Cannery.Tags do
@spec delete_tag!(Tag.t(), User.t()) :: Tag.t()
def delete_tag!(%Tag{user_id: user_id} = tag, %User{id: user_id}), do: tag |> Repo.delete!()
@doc """
Returns an `%Changeset{}` for tracking tag changes.
## Examples
iex> change_tag(tag)
%Changeset{data: %Tag{}}
"""
@spec change_tag(Tag.t() | Tag.new_tag()) :: Changeset.t(Tag.t() | Tag.new_tag())
@spec change_tag(Tag.t() | Tag.new_tag(), attrs :: map()) ::
Changeset.t(Tag.t() | Tag.new_tag())
def change_tag(tag, attrs \\ %{}), do: Tag.update_changeset(tag, attrs)
@doc """
Get a random tag bg_color in `#ffffff` hex format

View File

@ -35,10 +35,11 @@ defmodule Cannery.Tags.Tag do
@type id() :: UUID.t()
@doc false
@spec create_changeset(new_tag(), attrs :: map()) :: Changeset.t(new_tag())
def create_changeset(tag, attrs) do
@spec create_changeset(new_tag(), User.t(), attrs :: map()) :: Changeset.t(new_tag())
def create_changeset(tag, %User{id: user_id}, attrs) do
tag
|> cast(attrs, [:name, :bg_color, :text_color, :user_id])
|> change(user_id: user_id)
|> cast(attrs, [:name, :bg_color, :text_color])
|> validate_required([:name, :bg_color, :text_color, :user_id])
end

View File

@ -21,23 +21,57 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
end
@spec update(Socket.t()) :: {:ok, Socket.t()}
def update(%{assigns: %{ammo_group: ammo_group, current_user: current_user}} = socket) do
socket =
def update(%{assigns: %{current_user: current_user}} = socket) do
%{assigns: %{ammo_types: ammo_types, containers: containers}} =
socket =
socket
|> assign(:ammo_group_create_limit, @ammo_group_create_limit)
|> assign(:changeset, ammo_group |> AmmoGroup.update_changeset(%{}))
|> assign(:ammo_types, Ammo.list_ammo_types(current_user))
|> assign_new(:containers, fn -> Containers.list_containers(current_user) end)
{:ok, socket}
params =
if ammo_types |> List.first() |> is_nil(),
do: %{},
else: %{} |> Map.put("ammo_type_id", ammo_types |> List.first() |> Map.get(:id))
params =
if containers |> List.first() |> is_nil(),
do: params,
else: params |> Map.put("container_id", containers |> List.first() |> Map.get(:id))
{:ok, socket |> assign_changeset(params)}
end
@impl true
def handle_event("validate", %{"ammo_group" => ammo_group_params}, socket) do
{:noreply, socket |> assign_changeset(ammo_group_params)}
end
def handle_event(
"validate",
"save",
%{"ammo_group" => ammo_group_params},
%{assigns: %{action: action, ammo_group: ammo_group, current_user: user}} = socket
%{assigns: %{action: action}} = socket
) do
save_ammo_group(socket, action, ammo_group_params)
end
# HTML Helpers
@spec container_options([Container.t()]) :: [{String.t(), Container.id()}]
defp container_options(containers) do
containers |> Enum.map(fn %{id: id, name: name} -> {name, id} end)
end
@spec ammo_type_options([AmmoType.t()]) :: [{String.t(), AmmoType.id()}]
defp ammo_type_options(ammo_types) do
ammo_types |> Enum.map(fn %{id: id, name: name} -> {name, id} end)
end
# Save Helpers
defp assign_changeset(
%{assigns: %{action: action, ammo_group: ammo_group, current_user: user}} = socket,
ammo_group_params
) do
changeset_action =
case action do
:new -> :insert
@ -69,30 +103,9 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
{:error, changeset} -> changeset
end
{:noreply, socket |> assign(:changeset, changeset)}
socket |> assign(:changeset, changeset)
end
def handle_event(
"save",
%{"ammo_group" => ammo_group_params},
%{assigns: %{action: action}} = socket
) do
save_ammo_group(socket, action, ammo_group_params)
end
# HTML Helpers
@spec container_options([Container.t()]) :: [{String.t(), Container.id()}]
defp container_options(containers) do
containers |> Enum.map(fn %{id: id, name: name} -> {name, id} end)
end
@spec ammo_type_options([AmmoType.t()]) :: [{String.t(), AmmoType.id()}]
defp ammo_type_options(ammo_types) do
ammo_types |> Enum.map(fn %{id: id, name: name} -> {name, id} end)
end
# Save Helpers
defp save_ammo_group(
%{assigns: %{ammo_group: ammo_group, current_user: current_user, return_to: return_to}} =
socket,

View File

@ -74,7 +74,8 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
defp display_ammo_groups(%{assigns: %{current_user: current_user}} = socket) do
ammo_groups = Ammo.list_ammo_groups(current_user) |> Repo.preload([:ammo_type, :container])
containers = Containers.list_containers(current_user)
ammo_types_count = Ammo.get_ammo_types_count!(current_user)
containers_count = Containers.get_containers_count!(current_user)
columns = [
%{label: gettext("Ammo type"), key: "ammo_type"},
@ -92,7 +93,13 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|> Enum.map(fn ammo_group -> ammo_group |> get_row_data_for_ammo_group(columns) end)
socket
|> assign(ammo_groups: ammo_groups, containers: containers, columns: columns, rows: rows)
|> assign(
ammo_groups: ammo_groups,
ammo_types_count: ammo_types_count,
containers_count: containers_count,
columns: columns,
rows: rows
)
end
@spec get_row_data_for_ammo_group(AmmoGroup.t(), [map()]) :: [map()]

View File

@ -8,8 +8,10 @@
<%= gettext("No Ammo") %>
<%= display_emoji("😔") %>
</h2>
<% end %>
<%= if @containers |> Enum.empty?() do %>
<%= cond do %>
<% @containers_count == 0 -> %>
<div class="flex justify-center items-center">
<h2 class="m-2 title text-md text-primary-600">
<%= dgettext("prompts", "You'll need to") %>
@ -20,31 +22,30 @@
class: "btn btn-primary"
) %>
</div>
<% else %>
<% @ammo_types_count == 0 -> %>
<div class="flex justify-center items-center">
<h2 class="m-2 title text-md text-primary-600">
<%= dgettext("prompts", "You'll need to") %>
</h2>
<%= live_patch(dgettext("actions", "add an ammo type first"),
to: Routes.ammo_type_index_path(Endpoint, :new),
class: "btn btn-primary"
) %>
</div>
<% @ammo_groups |> Enum.empty?() -> %>
<%= live_patch(dgettext("actions", "Add your first box!"),
to: Routes.ammo_group_index_path(Endpoint, :new),
class: "btn btn-primary"
) %>
<% end %>
<% else %>
<%= if @containers |> Enum.empty?() do %>
<div class="flex justify-center items-center">
<h2 class="m-2 title text-md text-primary-600">
<%= dgettext("prompts", "You'll need to") %>
</h2>
<%= live_patch(dgettext("actions", "add a container first"),
to: Routes.container_index_path(Endpoint, :new),
class: "btn btn-primary"
) %>
</div>
<% else %>
<% true -> %>
<%= live_patch(dgettext("actions", "Add Ammo"),
to: Routes.ammo_group_index_path(Endpoint, :new),
class: "btn btn-primary"
) %>
<% end %>
<% end %>
<%= unless @ammo_groups |> Enum.empty?() do %>
<.live_component
module={CanneryWeb.Components.TableComponent}
id="ammo_groups_index_table"
@ -66,7 +67,6 @@
ammo_group={@ammo_group}
return_to={Routes.ammo_group_index_path(Endpoint, :index)}
current_user={@current_user}
containers={@containers}
/>
</.modal>
<% @live_action == :add_shot_group -> %>

View File

@ -13,17 +13,13 @@ defmodule CanneryWeb.AmmoTypeLive.FormComponent do
%{:ammo_type => AmmoType.t(), :current_user => User.t(), optional(any) => any},
Socket.t()
) :: {:ok, Socket.t()}
def update(%{ammo_type: ammo_type, current_user: _current_user} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign(:changeset, Ammo.change_ammo_type(ammo_type))}
def update(%{current_user: _current_user} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign_changeset(%{})}
end
@impl true
def handle_event(
"validate",
%{"ammo_type" => ammo_type_params},
%{assigns: %{ammo_type: ammo_type}} = socket
) do
{:noreply, socket |> assign(:changeset, ammo_type |> Ammo.change_ammo_type(ammo_type_params))}
def handle_event("validate", %{"ammo_type" => ammo_type_params}, socket) do
{:noreply, socket |> assign_changeset(ammo_type_params)}
end
def handle_event(
@ -34,6 +30,31 @@ defmodule CanneryWeb.AmmoTypeLive.FormComponent do
save_ammo_type(socket, action, ammo_type_params)
end
defp assign_changeset(
%{assigns: %{action: action, ammo_type: ammo_type, current_user: user}} = socket,
ammo_type_params
) do
changeset_action =
case action do
:new -> :insert
:edit -> :update
end
changeset =
case action do
:new -> ammo_type |> AmmoType.create_changeset(user, ammo_type_params)
:edit -> ammo_type |> AmmoType.update_changeset(ammo_type_params)
end
changeset =
case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset
{:error, changeset} -> changeset
end
socket |> assign(changeset: changeset)
end
defp save_ammo_type(
%{assigns: %{ammo_type: ammo_type, current_user: current_user, return_to: return_to}} =
socket,

View File

@ -137,7 +137,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
phx_click: "delete",
phx_value_id: ammo_type.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"),
confirm: dgettext("prompts", "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!", name: ammo_type.name),
qa: "delete-#{ammo_type.id}"
] do %>
<i class="fa-lg fas fa-trash"></i>

View File

@ -24,7 +24,7 @@
phx_click: "delete",
data: [
confirm:
dgettext("prompts", "Are you sure you want to delete %{name}?", name: @ammo_type.name),
dgettext("prompts", "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!", name: @ammo_type.name),
qa: "delete"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>

View File

@ -13,18 +13,13 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
%{:container => Container.t(), :current_user => User.t(), optional(any) => any},
Socket.t()
) :: {:ok, Socket.t()}
def update(%{container: container} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign(:changeset, Containers.change_container(container))}
def update(%{container: _container} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign_changeset(%{})}
end
@impl true
def handle_event(
"validate",
%{"container" => container_params},
%{assigns: %{container: container}} = socket
) do
changeset = container |> Containers.change_container(container_params)
{:noreply, socket |> assign(:changeset, changeset)}
def handle_event("validate", %{"container" => container_params}, socket) do
{:noreply, socket |> assign_changeset(container_params)}
end
def handle_event(
@ -35,6 +30,31 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
save_container(socket, action, container_params)
end
defp assign_changeset(
%{assigns: %{action: action, container: container, current_user: user}} = socket,
container_params
) do
changeset_action =
case action do
:new -> :insert
:edit -> :update
end
changeset =
case action do
:new -> container |> Container.create_changeset(user, container_params)
:edit -> container |> Container.update_changeset(container_params)
end
changeset =
case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset
{:error, changeset} -> changeset
end
socket |> assign(:changeset, changeset)
end
defp save_container(
%{assigns: %{container: container, current_user: current_user, return_to: return_to}} =
socket,

View File

@ -13,23 +13,44 @@ defmodule CanneryWeb.InviteLive.FormComponent do
%{:invite => Invite.t(), :current_user => User.t(), optional(any) => any},
Socket.t()
) :: {:ok, Socket.t()}
def update(%{invite: invite} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign(:changeset, Invites.change_invite(invite))}
def update(%{invite: _invite} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign_changeset(%{})}
end
@impl true
def handle_event(
"validate",
%{"invite" => invite_params},
%{assigns: %{invite: invite}} = socket
) do
{:noreply, socket |> assign(:changeset, invite |> Invites.change_invite(invite_params))}
def handle_event("validate", %{"invite" => invite_params}, socket) do
{:noreply, socket |> assign_changeset(invite_params)}
end
def handle_event("save", %{"invite" => invite_params}, %{assigns: %{action: action}} = socket) do
save_invite(socket, action, invite_params)
end
defp assign_changeset(
%{assigns: %{action: action, current_user: user, invite: invite}} = socket,
invite_params
) do
changeset_action =
case action do
:new -> :insert
:edit -> :update
end
changeset =
case action do
:new -> invite |> Invite.create_changeset(user, "example_token", invite_params)
:edit -> invite |> Invite.update_changeset(invite_params)
end
changeset =
case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset
{:error, changeset} -> changeset
end
socket |> assign(:changeset, changeset)
end
defp save_invite(
%{assigns: %{current_user: current_user, invite: invite, return_to: return_to}} = socket,
:edit,

View File

@ -12,19 +12,44 @@ defmodule CanneryWeb.TagLive.FormComponent do
@impl true
@spec update(%{:tag => Tag.t(), :current_user => User.t(), optional(any) => any}, Socket.t()) ::
{:ok, Socket.t()}
def update(%{tag: tag} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign(:changeset, Tags.change_tag(tag))}
def update(%{tag: _tag} = assigns, socket) do
{:ok, socket |> assign(assigns) |> assign_changeset(%{})}
end
@impl true
def handle_event("validate", %{"tag" => tag_params}, %{assigns: %{tag: tag}} = socket) do
{:noreply, socket |> assign(:changeset, tag |> Tags.change_tag(tag_params))}
def handle_event("validate", %{"tag" => tag_params}, socket) do
{:noreply, socket |> assign_changeset(tag_params)}
end
def handle_event("save", %{"tag" => tag_params}, %{assigns: %{action: action}} = socket) do
save_tag(socket, action, tag_params)
end
defp assign_changeset(
%{assigns: %{action: action, current_user: user, tag: tag}} = socket,
tag_params
) do
changeset_action =
case action do
:new -> :insert
:edit -> :update
end
changeset =
case action do
:new -> tag |> Tag.create_changeset(user, tag_params)
:edit -> tag |> Tag.update_changeset(tag_params)
end
changeset =
case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset
{:error, changeset} -> changeset
end
socket |> assign(:changeset, changeset)
end
@impl true
def render(assigns) do
~H"""

View File

@ -17,7 +17,7 @@ msgid "Add Ammo"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:24
#: lib/cannery_web/live/ammo_group_live/index.html.heex:37
msgid "Add your first box!"
msgstr ""
@ -126,7 +126,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/form_component.html.heex:50
#: lib/cannery_web/live/invite_live/form_component.html.heex:28
#: lib/cannery_web/live/range_live/form_component.html.heex:40
#: lib/cannery_web/live/tag_live/form_component.ex:66
#: lib/cannery_web/live/tag_live/form_component.ex:91
msgid "Save"
msgstr ""
@ -156,7 +156,7 @@ msgid "Why not get some ready to shoot?"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:144
#: lib/cannery_web/live/ammo_group_live/index.ex:151
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots"
@ -183,8 +183,7 @@ msgid "Copy to clipboard"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:18
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
#: lib/cannery_web/live/ammo_group_live/index.html.heex:20
msgid "add a container first"
msgstr ""
@ -207,3 +206,8 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.html.heex:55
msgid "View in Catalog"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:31
msgid "add an ammo type first"
msgstr ""

View File

@ -30,7 +30,7 @@ msgid "Add Ammo"
msgstr "Munition hinzufügen"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:24
#: lib/cannery_web/live/ammo_group_live/index.html.heex:37
msgid "Add your first box!"
msgstr "Fügen Sie ihre erste Box hinzu!"
@ -139,7 +139,7 @@ msgstr "Passwort zurücksetzen"
#: lib/cannery_web/live/container_live/form_component.html.heex:50
#: lib/cannery_web/live/invite_live/form_component.html.heex:28
#: lib/cannery_web/live/range_live/form_component.html.heex:40
#: lib/cannery_web/live/tag_live/form_component.ex:66
#: lib/cannery_web/live/tag_live/form_component.ex:91
msgid "Save"
msgstr "Speichern"
@ -169,7 +169,7 @@ msgid "Why not get some ready to shoot?"
msgstr "Warum nicht einige für den Schießstand auswählen?"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:144
#: lib/cannery_web/live/ammo_group_live/index.ex:151
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots"
@ -196,8 +196,7 @@ msgid "Copy to clipboard"
msgstr "In die Zwischenablage kopieren"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:18
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
#: lib/cannery_web/live/ammo_group_live/index.html.heex:20
msgid "add a container first"
msgstr "Zuerst einen Behälter hinzufügen"
@ -220,3 +219,8 @@ msgstr "Sprache wechseln"
#: lib/cannery_web/live/ammo_group_live/show.html.heex:55
msgid "View in Catalog"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:31
msgid "add an ammo type first"
msgstr ""

View File

@ -54,7 +54,7 @@ msgstr "Munition"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_group_live/index.ex:80
#: lib/cannery_web/live/ammo_group_live/index.ex:81
msgid "Ammo type"
msgstr "Munitionsarten"
@ -65,7 +65,7 @@ msgid "Average Price paid"
msgstr "Durchschnittlicher Kaufpreis"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:54
#: lib/cannery_web/live/tag_live/form_component.ex:79
msgid "Background color"
msgstr "Hintergrundfarbe"
@ -119,7 +119,7 @@ msgstr "Gehäusematerial"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:85
#: lib/cannery_web/live/ammo_group_live/index.ex:86
msgid "Container"
msgstr "Behälter"
@ -139,7 +139,7 @@ msgstr "Korrosiv"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
#: lib/cannery_web/live/ammo_group_live/index.ex:81
#: lib/cannery_web/live/ammo_group_live/index.ex:82
msgid "Count"
msgstr "Anzahl"
@ -287,7 +287,7 @@ msgstr "Meine coole Munitionskiste"
#: lib/cannery_web/live/ammo_type_live/index.ex:51
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
#: lib/cannery_web/live/tag_live/form_component.ex:50
#: lib/cannery_web/live/tag_live/form_component.ex:75
msgid "Name"
msgstr "Name"
@ -371,7 +371,7 @@ msgstr "Druck"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
#: lib/cannery_web/live/ammo_group_live/index.ex:82
#: lib/cannery_web/live/ammo_group_live/index.ex:83
msgid "Price paid"
msgstr "Kaufpreis"
@ -448,7 +448,7 @@ msgid "Tags can be added to your containers to help you organize"
msgstr "Tags können zur besseren Ordnung einem Behälter hinzugefügt werden"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:60
#: lib/cannery_web/live/tag_live/form_component.ex:85
msgid "Text color"
msgstr "Textfarbe"
@ -508,7 +508,7 @@ msgstr "Keine Tags für diesen Behälter"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:68
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.ex:85
msgid "Range"
msgstr "Schießplatz"
@ -616,7 +616,7 @@ msgstr "Schießkladde"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:118
#: lib/cannery_web/live/ammo_group_live/index.ex:125
#: 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_type_live/index.ex:114
@ -681,12 +681,12 @@ msgid "New password"
msgstr "Neues Passwort"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Stage"
msgstr "Markiert"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Unstage"
msgstr "Demarkiert"
@ -737,7 +737,7 @@ msgid "No cost information"
msgstr "Keine Preisinformationen"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:83
#: lib/cannery_web/live/ammo_group_live/index.ex:84
msgid "% left"
msgstr "% verbleibend"
@ -823,7 +823,7 @@ msgid "Ammo types"
msgstr "Munitionsart"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:86
#: lib/cannery_web/live/ammo_group_live/index.ex:87
msgid "Added on"
msgstr "Hinzugefügt am"

View File

@ -24,7 +24,7 @@ msgstr ""
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#, elixir-autogen, elixir-format
#: lib/cannery/containers.ex:122
#: lib/cannery/containers.ex:140
msgid "Container must be empty before deleting"
msgstr "Behälter muss vor dem Löschen leer sein"
@ -176,12 +176,12 @@ msgid "Tag could not be removed"
msgstr "Tag konnte nicht gelöscht werden"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:143
#: lib/cannery_web/live/ammo_group_live/form_component.ex:156
msgid "Could not parse number of copies"
msgstr "Konnte die Anzahl der Kopien nicht verstehen"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:128
#: lib/cannery_web/live/ammo_group_live/form_component.ex:141
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
"Ungültige Nummer an Kopien. Muss zwischen 1 and %{max} liegen. War "

View File

@ -24,10 +24,10 @@ msgstr ""
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:64
#: lib/cannery_web/live/container_live/form_component.ex:65
#: lib/cannery_web/live/invite_live/form_component.ex:59
#: lib/cannery_web/live/tag_live/form_component.ex:101
#: lib/cannery_web/live/ammo_type_live/form_component.ex:85
#: lib/cannery_web/live/container_live/form_component.ex:85
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:126
msgid "%{name} created successfully"
msgstr "%{name} erfolgreich erstellt"
@ -62,10 +62,10 @@ msgid "%{name} updated succesfully"
msgstr "%{name} erfolgreich aktualisiert"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:46
#: lib/cannery_web/live/container_live/form_component.ex:47
#: lib/cannery_web/live/invite_live/form_component.ex:41
#: lib/cannery_web/live/tag_live/form_component.ex:83
#: lib/cannery_web/live/ammo_type_live/form_component.ex:67
#: lib/cannery_web/live/container_live/form_component.ex:67
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:108
msgid "%{name} updated successfully"
msgstr "%{name} erfolgreich aktualisiert"
@ -88,7 +88,6 @@ msgstr ""
"zurückgenommen werden!"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
#: lib/cannery_web/live/container_live/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49
#: lib/cannery_web/live/tag_live/index.html.heex:38
@ -101,9 +100,8 @@ 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?"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:177
#: lib/cannery_web/live/ammo_group_live/index.ex:184
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
#: lib/cannery_web/live/ammo_type_live/index.ex:140
msgid "Are you sure you want to delete this ammo?"
msgstr "Sind Sie sicher, dass sie diese Munition löschen möchten?"
@ -173,7 +171,7 @@ msgstr "Registrieren Sie sich, um %{name} zu bearbeiten"
#: lib/cannery_web/live/container_live/form_component.html.heex:52
#: lib/cannery_web/live/invite_live/form_component.html.heex:30
#: lib/cannery_web/live/range_live/form_component.html.heex:42
#: lib/cannery_web/live/tag_live/form_component.ex:68
#: lib/cannery_web/live/tag_live/form_component.ex:93
msgid "Saving..."
msgstr "Speichere..."
@ -252,8 +250,8 @@ msgid "%{name} removed successfully"
msgstr "%{name} erfolgreich entfernt"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:15
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
#: lib/cannery_web/live/ammo_group_live/index.html.heex:17
#: lib/cannery_web/live/ammo_group_live/index.html.heex:28
msgid "You'll need to"
msgstr "Sie müssen"
@ -283,13 +281,19 @@ msgid "Ammo unstaged succesfully"
msgstr "Munition erfolgreich demarkiert"
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:105
#: lib/cannery_web/live/ammo_group_live/form_component.ex:118
msgid "Ammo updated successfully"
msgstr "Munitionsgruppe erfolgreich aktualisiert"
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:164
#: lib/cannery_web/live/ammo_group_live/form_component.ex:177
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
msgstr[0] "Munitionsgruppe erfolgreich aktualisiert"
msgstr[1] "Munitionsgruppe erfolgreich aktualisiert"
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_type_live/index.ex:140
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?"

View File

@ -39,7 +39,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_group_live/index.ex:80
#: lib/cannery_web/live/ammo_group_live/index.ex:81
msgid "Ammo type"
msgstr ""
@ -50,7 +50,7 @@ msgid "Average Price paid"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:54
#: lib/cannery_web/live/tag_live/form_component.ex:79
msgid "Background color"
msgstr ""
@ -104,7 +104,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:85
#: lib/cannery_web/live/ammo_group_live/index.ex:86
msgid "Container"
msgstr ""
@ -124,7 +124,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
#: lib/cannery_web/live/ammo_group_live/index.ex:81
#: lib/cannery_web/live/ammo_group_live/index.ex:82
msgid "Count"
msgstr ""
@ -272,7 +272,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:51
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
#: lib/cannery_web/live/tag_live/form_component.ex:50
#: lib/cannery_web/live/tag_live/form_component.ex:75
msgid "Name"
msgstr ""
@ -356,7 +356,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
#: lib/cannery_web/live/ammo_group_live/index.ex:82
#: lib/cannery_web/live/ammo_group_live/index.ex:83
msgid "Price paid"
msgstr ""
@ -431,7 +431,7 @@ msgid "Tags can be added to your containers to help you organize"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:60
#: lib/cannery_web/live/tag_live/form_component.ex:85
msgid "Text color"
msgstr ""
@ -491,7 +491,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:68
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.ex:85
msgid "Range"
msgstr ""
@ -599,7 +599,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:118
#: lib/cannery_web/live/ammo_group_live/index.ex:125
#: 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_type_live/index.ex:114
@ -664,12 +664,12 @@ msgid "New password"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Stage"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Unstage"
msgstr ""
@ -720,7 +720,7 @@ msgid "No cost information"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:83
#: lib/cannery_web/live/ammo_group_live/index.ex:84
msgid "% left"
msgstr ""
@ -806,7 +806,7 @@ msgid "Ammo types"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:86
#: lib/cannery_web/live/ammo_group_live/index.ex:87
msgid "Added on"
msgstr ""

View File

@ -18,7 +18,7 @@ msgid "Add Ammo"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:24
#: lib/cannery_web/live/ammo_group_live/index.html.heex:37
msgid "Add your first box!"
msgstr ""
@ -127,7 +127,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/form_component.html.heex:50
#: lib/cannery_web/live/invite_live/form_component.html.heex:28
#: lib/cannery_web/live/range_live/form_component.html.heex:40
#: lib/cannery_web/live/tag_live/form_component.ex:66
#: lib/cannery_web/live/tag_live/form_component.ex:91
msgid "Save"
msgstr ""
@ -157,7 +157,7 @@ msgid "Why not get some ready to shoot?"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:144
#: lib/cannery_web/live/ammo_group_live/index.ex:151
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots"
@ -184,8 +184,7 @@ msgid "Copy to clipboard"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:18
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
#: lib/cannery_web/live/ammo_group_live/index.html.heex:20
msgid "add a container first"
msgstr ""
@ -208,3 +207,8 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.html.heex:55
msgid "View in Catalog"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:31
msgid "add an ammo type first"
msgstr ""

View File

@ -40,7 +40,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_group_live/index.ex:80
#: lib/cannery_web/live/ammo_group_live/index.ex:81
msgid "Ammo type"
msgstr ""
@ -51,7 +51,7 @@ msgid "Average Price paid"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:54
#: lib/cannery_web/live/tag_live/form_component.ex:79
msgid "Background color"
msgstr ""
@ -105,7 +105,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:85
#: lib/cannery_web/live/ammo_group_live/index.ex:86
msgid "Container"
msgstr ""
@ -125,7 +125,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
#: lib/cannery_web/live/ammo_group_live/index.ex:81
#: lib/cannery_web/live/ammo_group_live/index.ex:82
msgid "Count"
msgstr ""
@ -273,7 +273,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:51
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
#: lib/cannery_web/live/tag_live/form_component.ex:50
#: lib/cannery_web/live/tag_live/form_component.ex:75
msgid "Name"
msgstr ""
@ -357,7 +357,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
#: lib/cannery_web/live/ammo_group_live/index.ex:82
#: lib/cannery_web/live/ammo_group_live/index.ex:83
msgid "Price paid"
msgstr ""
@ -432,7 +432,7 @@ msgid "Tags can be added to your containers to help you organize"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:60
#: lib/cannery_web/live/tag_live/form_component.ex:85
msgid "Text color"
msgstr ""
@ -492,7 +492,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:68
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.ex:85
msgid "Range"
msgstr ""
@ -600,7 +600,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:118
#: lib/cannery_web/live/ammo_group_live/index.ex:125
#: 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_type_live/index.ex:114
@ -665,12 +665,12 @@ msgid "New password"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Stage"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Unstage"
msgstr ""
@ -721,7 +721,7 @@ msgid "No cost information"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:83
#: lib/cannery_web/live/ammo_group_live/index.ex:84
msgid "% left"
msgstr ""
@ -807,7 +807,7 @@ msgid "Ammo types"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:86
#: lib/cannery_web/live/ammo_group_live/index.ex:87
msgid "Added on"
msgstr ""

View File

@ -11,7 +11,7 @@ msgstr ""
"Language: en\n"
#, elixir-autogen, elixir-format
#: lib/cannery/containers.ex:122
#: lib/cannery/containers.ex:140
msgid "Container must be empty before deleting"
msgstr ""
@ -161,12 +161,12 @@ msgid "Tag could not be removed"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:143
#: lib/cannery_web/live/ammo_group_live/form_component.ex:156
msgid "Could not parse number of copies"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:128
#: lib/cannery_web/live/ammo_group_live/form_component.ex:141
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""

View File

@ -12,10 +12,10 @@ msgstr ""
"Plural-Forms: nplurals=2\n"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:64
#: lib/cannery_web/live/container_live/form_component.ex:65
#: lib/cannery_web/live/invite_live/form_component.ex:59
#: lib/cannery_web/live/tag_live/form_component.ex:101
#: lib/cannery_web/live/ammo_type_live/form_component.ex:85
#: lib/cannery_web/live/container_live/form_component.ex:85
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:126
msgid "%{name} created successfully"
msgstr ""
@ -50,10 +50,10 @@ msgid "%{name} updated succesfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:46
#: lib/cannery_web/live/container_live/form_component.ex:47
#: lib/cannery_web/live/invite_live/form_component.ex:41
#: lib/cannery_web/live/tag_live/form_component.ex:83
#: lib/cannery_web/live/ammo_type_live/form_component.ex:67
#: lib/cannery_web/live/container_live/form_component.ex:67
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:108
msgid "%{name} updated successfully"
msgstr ""
@ -74,7 +74,6 @@ msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
#: lib/cannery_web/live/container_live/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49
#: lib/cannery_web/live/tag_live/index.html.heex:38
@ -87,9 +86,8 @@ msgid "Are you sure you want to delete the invite for %{name}?"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:177
#: lib/cannery_web/live/ammo_group_live/index.ex:184
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
#: lib/cannery_web/live/ammo_type_live/index.ex:140
msgid "Are you sure you want to delete this ammo?"
msgstr ""
@ -155,7 +153,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/form_component.html.heex:52
#: lib/cannery_web/live/invite_live/form_component.html.heex:30
#: lib/cannery_web/live/range_live/form_component.html.heex:42
#: lib/cannery_web/live/tag_live/form_component.ex:68
#: lib/cannery_web/live/tag_live/form_component.ex:93
msgid "Saving..."
msgstr ""
@ -232,8 +230,8 @@ msgid "%{name} removed successfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:15
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
#: lib/cannery_web/live/ammo_group_live/index.html.heex:17
#: lib/cannery_web/live/ammo_group_live/index.html.heex:28
msgid "You'll need to"
msgstr ""
@ -263,13 +261,19 @@ msgid "Ammo unstaged succesfully"
msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:105
#: lib/cannery_web/live/ammo_group_live/form_component.ex:118
msgid "Ammo updated successfully"
msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:164
#: lib/cannery_web/live/ammo_group_live/form_component.ex:177
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_type_live/index.ex:140
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
msgstr ""

View File

@ -11,7 +11,7 @@ msgid ""
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery/containers.ex:122
#: lib/cannery/containers.ex:140
msgid "Container must be empty before deleting"
msgstr ""
@ -160,12 +160,12 @@ msgid "Tag could not be removed"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:143
#: lib/cannery_web/live/ammo_group_live/form_component.ex:156
msgid "Could not parse number of copies"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:128
#: lib/cannery_web/live/ammo_group_live/form_component.ex:141
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""

View File

@ -28,7 +28,7 @@ msgid "Add Ammo"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:24
#: lib/cannery_web/live/ammo_group_live/index.html.heex:37
msgid "Add your first box!"
msgstr ""
@ -137,7 +137,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/form_component.html.heex:50
#: lib/cannery_web/live/invite_live/form_component.html.heex:28
#: lib/cannery_web/live/range_live/form_component.html.heex:40
#: lib/cannery_web/live/tag_live/form_component.ex:66
#: lib/cannery_web/live/tag_live/form_component.ex:91
msgid "Save"
msgstr ""
@ -167,7 +167,7 @@ msgid "Why not get some ready to shoot?"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:144
#: lib/cannery_web/live/ammo_group_live/index.ex:151
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots"
@ -194,8 +194,7 @@ msgid "Copy to clipboard"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:18
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
#: lib/cannery_web/live/ammo_group_live/index.html.heex:20
msgid "add a container first"
msgstr ""
@ -218,3 +217,8 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.html.heex:55
msgid "View in Catalog"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:31
msgid "add an ammo type first"
msgstr ""

View File

@ -50,7 +50,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_group_live/index.ex:80
#: lib/cannery_web/live/ammo_group_live/index.ex:81
msgid "Ammo type"
msgstr ""
@ -61,7 +61,7 @@ msgid "Average Price paid"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:54
#: lib/cannery_web/live/tag_live/form_component.ex:79
msgid "Background color"
msgstr ""
@ -115,7 +115,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:85
#: lib/cannery_web/live/ammo_group_live/index.ex:86
msgid "Container"
msgstr ""
@ -135,7 +135,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
#: lib/cannery_web/live/ammo_group_live/index.ex:81
#: lib/cannery_web/live/ammo_group_live/index.ex:82
msgid "Count"
msgstr ""
@ -283,7 +283,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:51
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
#: lib/cannery_web/live/tag_live/form_component.ex:50
#: lib/cannery_web/live/tag_live/form_component.ex:75
msgid "Name"
msgstr ""
@ -367,7 +367,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
#: lib/cannery_web/live/ammo_group_live/index.ex:82
#: lib/cannery_web/live/ammo_group_live/index.ex:83
msgid "Price paid"
msgstr ""
@ -442,7 +442,7 @@ msgid "Tags can be added to your containers to help you organize"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:60
#: lib/cannery_web/live/tag_live/form_component.ex:85
msgid "Text color"
msgstr ""
@ -502,7 +502,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:68
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.ex:85
msgid "Range"
msgstr ""
@ -610,7 +610,7 @@ msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:118
#: lib/cannery_web/live/ammo_group_live/index.ex:125
#: 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_type_live/index.ex:114
@ -675,12 +675,12 @@ msgid "New password"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Stage"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Unstage"
msgstr ""
@ -731,7 +731,7 @@ msgid "No cost information"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:83
#: lib/cannery_web/live/ammo_group_live/index.ex:84
msgid "% left"
msgstr ""
@ -817,7 +817,7 @@ msgid "Ammo types"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:86
#: lib/cannery_web/live/ammo_group_live/index.ex:87
msgid "Added on"
msgstr ""

View File

@ -22,7 +22,7 @@ msgstr ""
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#, elixir-autogen, elixir-format
#: lib/cannery/containers.ex:122
#: lib/cannery/containers.ex:140
msgid "Container must be empty before deleting"
msgstr ""
@ -171,12 +171,12 @@ msgid "Tag could not be removed"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:143
#: lib/cannery_web/live/ammo_group_live/form_component.ex:156
msgid "Could not parse number of copies"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:128
#: lib/cannery_web/live/ammo_group_live/form_component.ex:141
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""

View File

@ -22,10 +22,10 @@ msgstr ""
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:64
#: lib/cannery_web/live/container_live/form_component.ex:65
#: lib/cannery_web/live/invite_live/form_component.ex:59
#: lib/cannery_web/live/tag_live/form_component.ex:101
#: lib/cannery_web/live/ammo_type_live/form_component.ex:85
#: lib/cannery_web/live/container_live/form_component.ex:85
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:126
msgid "%{name} created successfully"
msgstr ""
@ -60,10 +60,10 @@ msgid "%{name} updated succesfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:46
#: lib/cannery_web/live/container_live/form_component.ex:47
#: lib/cannery_web/live/invite_live/form_component.ex:41
#: lib/cannery_web/live/tag_live/form_component.ex:83
#: lib/cannery_web/live/ammo_type_live/form_component.ex:67
#: lib/cannery_web/live/container_live/form_component.ex:67
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:108
msgid "%{name} updated successfully"
msgstr ""
@ -84,7 +84,6 @@ msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
#: lib/cannery_web/live/container_live/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49
#: lib/cannery_web/live/tag_live/index.html.heex:38
@ -97,9 +96,8 @@ msgid "Are you sure you want to delete the invite for %{name}?"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:177
#: lib/cannery_web/live/ammo_group_live/index.ex:184
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
#: lib/cannery_web/live/ammo_type_live/index.ex:140
msgid "Are you sure you want to delete this ammo?"
msgstr ""
@ -165,7 +163,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/form_component.html.heex:52
#: lib/cannery_web/live/invite_live/form_component.html.heex:30
#: lib/cannery_web/live/range_live/form_component.html.heex:42
#: lib/cannery_web/live/tag_live/form_component.ex:68
#: lib/cannery_web/live/tag_live/form_component.ex:93
msgid "Saving..."
msgstr ""
@ -242,8 +240,8 @@ msgid "%{name} removed successfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:15
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
#: lib/cannery_web/live/ammo_group_live/index.html.heex:17
#: lib/cannery_web/live/ammo_group_live/index.html.heex:28
msgid "You'll need to"
msgstr ""
@ -273,13 +271,19 @@ msgid "Ammo unstaged succesfully"
msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:105
#: lib/cannery_web/live/ammo_group_live/form_component.ex:118
msgid "Ammo updated successfully"
msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:164
#: lib/cannery_web/live/ammo_group_live/form_component.ex:177
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_type_live/index.ex:140
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
msgstr ""

View File

@ -30,7 +30,7 @@ msgid "Add Ammo"
msgstr "ajouter munition"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:24
#: lib/cannery_web/live/ammo_group_live/index.html.heex:37
msgid "Add your first box!"
msgstr "Ajoutez votre première caisse !"
@ -139,7 +139,7 @@ msgstr "Réinitialisé le mot de passe"
#: lib/cannery_web/live/container_live/form_component.html.heex:50
#: lib/cannery_web/live/invite_live/form_component.html.heex:28
#: lib/cannery_web/live/range_live/form_component.html.heex:40
#: lib/cannery_web/live/tag_live/form_component.ex:66
#: lib/cannery_web/live/tag_live/form_component.ex:91
msgid "Save"
msgstr "Sauvegarder"
@ -169,7 +169,7 @@ msgid "Why not get some ready to shoot?"
msgstr "Pourquoi pas en préparer pour tirer?"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:144
#: lib/cannery_web/live/ammo_group_live/index.ex:151
#: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots"
@ -196,8 +196,7 @@ msgid "Copy to clipboard"
msgstr "Copier dans le presse-papier"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:18
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
#: lib/cannery_web/live/ammo_group_live/index.html.heex:20
msgid "add a container first"
msgstr "ajouter un conteneur en premier"
@ -220,3 +219,8 @@ msgstr "Changer la langue"
#: lib/cannery_web/live/ammo_group_live/show.html.heex:55
msgid "View in Catalog"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:31
msgid "add an ammo type first"
msgstr ""

View File

@ -54,7 +54,7 @@ msgstr "Munition"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_group_live/index.ex:80
#: lib/cannery_web/live/ammo_group_live/index.ex:81
msgid "Ammo type"
msgstr "Type de munition"
@ -65,7 +65,7 @@ msgid "Average Price paid"
msgstr "Prix acheté moyen"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:54
#: lib/cannery_web/live/tag_live/form_component.ex:79
msgid "Background color"
msgstr "Couleur de fond"
@ -119,7 +119,7 @@ msgstr "Matériau de la caisse"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:85
#: lib/cannery_web/live/ammo_group_live/index.ex:86
msgid "Container"
msgstr "Conteneur"
@ -139,7 +139,7 @@ msgstr "Corrosive"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
#: lib/cannery_web/live/ammo_group_live/index.ex:81
#: lib/cannery_web/live/ammo_group_live/index.ex:82
msgid "Count"
msgstr "Quantité"
@ -287,7 +287,7 @@ msgstr "Ma superbe boite de munition"
#: lib/cannery_web/live/ammo_type_live/index.ex:51
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
#: lib/cannery_web/live/tag_live/form_component.ex:50
#: lib/cannery_web/live/tag_live/form_component.ex:75
msgid "Name"
msgstr "Nom"
@ -371,7 +371,7 @@ msgstr "Pression"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
#: lib/cannery_web/live/ammo_group_live/index.ex:82
#: lib/cannery_web/live/ammo_group_live/index.ex:83
msgid "Price paid"
msgstr "Prix payé"
@ -450,7 +450,7 @@ msgstr ""
"organiser"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/form_component.ex:60
#: lib/cannery_web/live/tag_live/form_component.ex:85
msgid "Text color"
msgstr "Couleur du texte"
@ -510,7 +510,7 @@ msgstr "Aucun tag pour ce conteneur"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:68
#: lib/cannery_web/live/ammo_group_live/index.ex:84
#: lib/cannery_web/live/ammo_group_live/index.ex:85
msgid "Range"
msgstr "Portée"
@ -618,7 +618,7 @@ msgstr "Évènements de tir"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:118
#: lib/cannery_web/live/ammo_group_live/index.ex:125
#: 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_type_live/index.ex:114
@ -683,12 +683,12 @@ msgid "New password"
msgstr "Nouveau mot de passe"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Stage"
msgstr "Sélectionné"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:141
#: lib/cannery_web/live/ammo_group_live/index.ex:148
msgid "Unstage"
msgstr "Désélectionner"
@ -739,7 +739,7 @@ msgid "No cost information"
msgstr "Aucune information de prix"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:83
#: lib/cannery_web/live/ammo_group_live/index.ex:84
msgid "% left"
msgstr "%restante"
@ -825,7 +825,7 @@ msgid "Ammo types"
msgstr "Types de munition"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:86
#: lib/cannery_web/live/ammo_group_live/index.ex:87
msgid "Added on"
msgstr "Ajouté le"

View File

@ -24,7 +24,7 @@ msgstr ""
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#, elixir-autogen, elixir-format
#: lib/cannery/containers.ex:122
#: lib/cannery/containers.ex:140
msgid "Container must be empty before deleting"
msgstr "Le conteneur doit être vide pour être supprimé"
@ -177,12 +177,12 @@ msgid "Tag could not be removed"
msgstr "Le tag na pas pu être retiré"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:143
#: lib/cannery_web/live/ammo_group_live/form_component.ex:156
msgid "Could not parse number of copies"
msgstr "Impossible d'analyser le nombre de copies"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:128
#: lib/cannery_web/live/ammo_group_live/form_component.ex:141
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}"

View File

@ -24,10 +24,10 @@ msgstr ""
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:64
#: lib/cannery_web/live/container_live/form_component.ex:65
#: lib/cannery_web/live/invite_live/form_component.ex:59
#: lib/cannery_web/live/tag_live/form_component.ex:101
#: lib/cannery_web/live/ammo_type_live/form_component.ex:85
#: lib/cannery_web/live/container_live/form_component.ex:85
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:126
msgid "%{name} created successfully"
msgstr "%{name} créé· avec succès"
@ -62,10 +62,10 @@ msgid "%{name} updated succesfully"
msgstr "%{name} mis à jour avec succès"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:46
#: lib/cannery_web/live/container_live/form_component.ex:47
#: lib/cannery_web/live/invite_live/form_component.ex:41
#: lib/cannery_web/live/tag_live/form_component.ex:83
#: lib/cannery_web/live/ammo_type_live/form_component.ex:67
#: lib/cannery_web/live/container_live/form_component.ex:67
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:108
msgid "%{name} updated successfully"
msgstr "%{name} mis à jour avec succès"
@ -89,7 +89,6 @@ msgstr ""
"Êtes-vous certain·e de supprimer %{email}? Cette action est définitive!"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
#: lib/cannery_web/live/container_live/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49
#: lib/cannery_web/live/tag_live/index.html.heex:38
@ -102,9 +101,8 @@ msgid "Are you sure you want to delete the invite for %{name}?"
msgstr "Êtes-vous certain·e de supprimer linvitation pour %{name}?"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:177
#: lib/cannery_web/live/ammo_group_live/index.ex:184
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
#: lib/cannery_web/live/ammo_type_live/index.ex:140
msgid "Are you sure you want to delete this ammo?"
msgstr "Êtes-vous certain·e de supprimer cette munition?"
@ -174,7 +172,7 @@ msgstr "Senregistrer pour mettre en place %{name}"
#: lib/cannery_web/live/container_live/form_component.html.heex:52
#: lib/cannery_web/live/invite_live/form_component.html.heex:30
#: lib/cannery_web/live/range_live/form_component.html.heex:42
#: lib/cannery_web/live/tag_live/form_component.ex:68
#: lib/cannery_web/live/tag_live/form_component.ex:93
msgid "Saving..."
msgstr "Sauvegarde en cours…"
@ -253,8 +251,8 @@ msgid "%{name} removed successfully"
msgstr "%{name} retiré avec succès"
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:15
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
#: lib/cannery_web/live/ammo_group_live/index.html.heex:17
#: lib/cannery_web/live/ammo_group_live/index.html.heex:28
msgid "You'll need to"
msgstr "Vous aurez besoin de"
@ -284,13 +282,19 @@ msgid "Ammo unstaged succesfully"
msgstr "Groupe de munition désélectionner avec succès"
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:105
#: lib/cannery_web/live/ammo_group_live/form_component.ex:118
msgid "Ammo updated successfully"
msgstr "Groupe de munition mis à jour avec succès"
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:164
#: lib/cannery_web/live/ammo_group_live/form_component.ex:177
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
msgstr[0] "Groupe de munition mis à jour avec succès"
msgstr[1] "Groupe de munition mis à jour avec succès"
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_type_live/index.ex:140
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
msgstr "Êtes-vous certain·e de supprimer %{name}?"

View File

@ -11,10 +11,10 @@ msgid ""
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:64
#: lib/cannery_web/live/container_live/form_component.ex:65
#: lib/cannery_web/live/invite_live/form_component.ex:59
#: lib/cannery_web/live/tag_live/form_component.ex:101
#: lib/cannery_web/live/ammo_type_live/form_component.ex:85
#: lib/cannery_web/live/container_live/form_component.ex:85
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:126
msgid "%{name} created successfully"
msgstr ""
@ -49,10 +49,10 @@ msgid "%{name} updated succesfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.ex:46
#: lib/cannery_web/live/container_live/form_component.ex:47
#: lib/cannery_web/live/invite_live/form_component.ex:41
#: lib/cannery_web/live/tag_live/form_component.ex:83
#: lib/cannery_web/live/ammo_type_live/form_component.ex:67
#: lib/cannery_web/live/container_live/form_component.ex:67
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:108
msgid "%{name} updated successfully"
msgstr ""
@ -73,7 +73,6 @@ msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
#: lib/cannery_web/live/container_live/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49
#: lib/cannery_web/live/tag_live/index.html.heex:38
@ -86,9 +85,8 @@ msgid "Are you sure you want to delete the invite for %{name}?"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:177
#: lib/cannery_web/live/ammo_group_live/index.ex:184
#: lib/cannery_web/live/ammo_group_live/show.html.heex:71
#: lib/cannery_web/live/ammo_type_live/index.ex:140
msgid "Are you sure you want to delete this ammo?"
msgstr ""
@ -154,7 +152,7 @@ msgstr ""
#: lib/cannery_web/live/container_live/form_component.html.heex:52
#: lib/cannery_web/live/invite_live/form_component.html.heex:30
#: lib/cannery_web/live/range_live/form_component.html.heex:42
#: lib/cannery_web/live/tag_live/form_component.ex:68
#: lib/cannery_web/live/tag_live/form_component.ex:93
msgid "Saving..."
msgstr ""
@ -231,8 +229,8 @@ msgid "%{name} removed successfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:15
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
#: lib/cannery_web/live/ammo_group_live/index.html.heex:17
#: lib/cannery_web/live/ammo_group_live/index.html.heex:28
msgid "You'll need to"
msgstr ""
@ -262,13 +260,19 @@ msgid "Ammo unstaged succesfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:105
#: lib/cannery_web/live/ammo_group_live/form_component.ex:118
msgid "Ammo updated successfully"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:164
#: lib/cannery_web/live/ammo_group_live/form_component.ex:177
msgid "Ammo added successfully"
msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:140
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
msgstr ""

View File

@ -92,11 +92,6 @@ defmodule Cannery.AmmoTest do
assert {:ok, %AmmoType{}} = Ammo.delete_ammo_type(ammo_type, current_user)
assert_raise Ecto.NoResultsError, fn -> Ammo.get_ammo_type!(ammo_type.id, current_user) end
end
test "change_ammo_type/1 returns a ammo_type changeset",
%{ammo_type: ammo_type} do
assert %Changeset{} = Ammo.change_ammo_type(ammo_type)
end
end
describe "ammo_groups" do

View File

@ -87,9 +87,5 @@ defmodule Cannery.ContainersTest do
Containers.get_container!(container.id, current_user)
end
end
test "change_container/1 returns a container changeset", %{container: container} do
assert %Changeset{} = Containers.change_container(container)
end
end
end

View File

@ -68,9 +68,5 @@ defmodule Cannery.InvitesTest do
assert {:ok, %Invite{}} = Invites.delete_invite(invite, current_user)
assert_raise Ecto.NoResultsError, fn -> Invites.get_invite!(invite.id, current_user) end
end
test "change_invite/1 returns a invite changeset", %{invite: invite} do
assert %Changeset{} = Invites.change_invite(invite)
end
end
end

View File

@ -68,9 +68,5 @@ defmodule Cannery.TagsTest do
assert {:ok, %Tag{}} = Tags.delete_tag(tag, current_user)
assert_raise Ecto.NoResultsError, fn -> Tags.get_tag!(tag.id, current_user) end
end
test "change_tag/1 returns a tag changeset", %{tag: tag} do
assert %Changeset{} = Tags.change_tag(tag)
end
end
end