diff --git a/CHANGELOG.md b/CHANGELOG.md index 53484c74..8b1841ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,8 +76,8 @@ - Add shading to table component - Fix chart to sum by day - Fix whitespace when copying invite url -- Make ammo type show page also display ammo groups as table -- Make container show page also display ammo groups as table +- Make ammo type show page also display packs as table +- Make container show page also display packs as table - Display CPR for ammo packs - Add original count for ammo packs - Add ammo pack CPR and original count to json export diff --git a/lib/cannery/activity_log.ex b/lib/cannery/activity_log.ex index e6d8a282..c46d19a8 100644 --- a/lib/cannery/activity_log.ex +++ b/lib/cannery/activity_log.ex @@ -4,7 +4,7 @@ defmodule Cannery.ActivityLog do """ import Ecto.Query, warn: false - alias Cannery.Ammo.{Pack, AmmoType} + alias Cannery.Ammo.{AmmoType, Pack} alias Cannery.{Accounts.User, ActivityLog.ShotGroup, Repo} alias Ecto.{Multi, Queryable} @@ -269,7 +269,7 @@ defmodule Cannery.ActivityLog do end @doc """ - Returns the number of shot rounds for an ammo group + Returns the number of shot rounds for a pack """ @spec get_used_count(Pack.t(), User.t()) :: non_neg_integer() def get_used_count(%Pack{id: pack_id} = pack, user) do @@ -279,7 +279,7 @@ defmodule Cannery.ActivityLog do end @doc """ - Returns the number of shot rounds for multiple ammo groups + Returns the number of shot rounds for multiple packs """ @spec get_used_counts([Pack.t()], User.t()) :: %{optional(Pack.id()) => non_neg_integer()} @@ -299,7 +299,7 @@ defmodule Cannery.ActivityLog do end @doc """ - Returns the last entered shot group date for an ammo group + Returns the last entered shot group date for a pack """ @spec get_last_used_date(Pack.t(), User.t()) :: Date.t() | nil def get_last_used_date(%Pack{id: pack_id} = pack, user) do @@ -309,7 +309,7 @@ defmodule Cannery.ActivityLog do end @doc """ - Returns the last entered shot group date for an ammo group + Returns the last entered shot group date for a pack """ @spec get_last_used_dates([Pack.t()], User.t()) :: %{optional(Pack.id()) => Date.t()} def get_last_used_dates(packs, %User{id: user_id}) do diff --git a/lib/cannery/ammo.ex b/lib/cannery/ammo.ex index 21f227ba..a57cdba8 100644 --- a/lib/cannery/ammo.ex +++ b/lib/cannery/ammo.ex @@ -8,7 +8,7 @@ defmodule Cannery.Ammo do alias Cannery.{Accounts.User, Containers, Repo} alias Cannery.Containers.{Container, ContainerTag, Tag} alias Cannery.{ActivityLog, ActivityLog.ShotGroup} - alias Cannery.Ammo.{Pack, AmmoType} + alias Cannery.Ammo.{AmmoType, Pack} alias Ecto.{Changeset, Queryable} @pack_create_limit 10_000 @@ -128,7 +128,7 @@ defmodule Cannery.Ammo do end @doc """ - Gets the average cost of an ammo type from ammo groups with price information. + Gets the average cost of an ammo type from packs with price information. ## Examples @@ -147,7 +147,7 @@ defmodule Cannery.Ammo do end @doc """ - Gets the average cost of ammo types from ammo groups with price information + Gets the average cost of ammo types from packs with price information for multiple ammo types. ## Examples @@ -745,7 +745,7 @@ defmodule Cannery.Ammo do [%Pack{}, ...] iex> list_packs("cool", %User{id: 123}, true) - [%Pack{notes: "My cool ammo group"}, ...] + [%Pack{notes: "My cool pack"}, ...] """ @spec list_packs(search :: String.t() | nil, AmmoType.class() | :all, User.t()) :: @@ -864,7 +864,7 @@ defmodule Cannery.Ammo do @doc """ Gets a single pack. - Raises `KeyError` if the Ammo group does not exist. + Raises `KeyError` if the pack does not exist. ## Examples @@ -903,7 +903,7 @@ defmodule Cannery.Ammo do end @doc """ - Calculates the percentage remaining of an ammo group out of 100 + Calculates the percentage remaining of a pack out of 100 ## Examples @@ -922,7 +922,7 @@ defmodule Cannery.Ammo do end @doc """ - Calculates the percentages remaining of multiple ammo groups out of 100 + Calculates the percentages remaining of multiple packs out of 100 ## Examples @@ -951,7 +951,7 @@ defmodule Cannery.Ammo do end @doc """ - Gets the original count for an ammo group + Gets the original count for a pack ## Examples @@ -970,7 +970,7 @@ defmodule Cannery.Ammo do end @doc """ - Gets the original counts for multiple ammo groups + Gets the original counts for multiple packs ## Examples @@ -993,7 +993,7 @@ defmodule Cannery.Ammo do end @doc """ - Calculates the CPR for a single ammo group + Calculates the CPR for a single pack ## Examples @@ -1012,7 +1012,7 @@ defmodule Cannery.Ammo do end @doc """ - Calculates the CPR for multiple ammo groups + Calculates the CPR for multiple packs ## Examples diff --git a/lib/cannery/ammo/pack.ex b/lib/cannery/ammo/pack.ex index a2953290..c7a04d76 100644 --- a/lib/cannery/ammo/pack.ex +++ b/lib/cannery/ammo/pack.ex @@ -113,7 +113,7 @@ defmodule Cannery.Ammo.Pack do end @doc """ - This range changeset is used when "using up" ammo groups, and allows for + This range changeset is used when "using up" packs, and allows for updating the count to 0 """ @spec range_changeset(t() | new_pack(), attrs :: map()) :: changeset() diff --git a/lib/cannery_web/components/move_pack_component.ex b/lib/cannery_web/components/move_pack_component.ex index 81d71d9b..2ce7cbda 100644 --- a/lib/cannery_web/components/move_pack_component.ex +++ b/lib/cannery_web/components/move_pack_component.ex @@ -1,6 +1,6 @@ defmodule CanneryWeb.Components.MovePackComponent do @moduledoc """ - Livecomponent that can move an ammo group to another container + Livecomponent that can move a pack to another container """ use CanneryWeb, :live_component diff --git a/lib/cannery_web/components/pack_table_component.ex b/lib/cannery_web/components/pack_table_component.ex index 6a3c7e8b..8178b375 100644 --- a/lib/cannery_web/components/pack_table_component.ex +++ b/lib/cannery_web/components/pack_table_component.ex @@ -1,6 +1,6 @@ defmodule CanneryWeb.Components.PackTableComponent do @moduledoc """ - A component that displays a list of ammo groups + A component that displays a list of packs """ use CanneryWeb, :live_component alias Cannery.{Accounts.User, Ammo.Pack, ComparableDate} diff --git a/lib/cannery_web/live/ammo_type_live/show.html.heex b/lib/cannery_web/live/ammo_type_live/show.html.heex index 65e162a9..44db85ce 100644 --- a/lib/cannery_web/live/ammo_type_live/show.html.heex +++ b/lib/cannery_web/live/ammo_type_live/show.html.heex @@ -203,9 +203,7 @@ navigate={Routes.pack_show_path(Endpoint, :show, pack)} class="text-primary-600 link" aria-label={ - dgettext("actions", "View ammo group of %{pack_count} bullets", - pack_count: pack_count - ) + dgettext("actions", "View pack of %{pack_count} bullets", pack_count: pack_count) } > diff --git a/lib/cannery_web/live/pack_live/form_component.ex b/lib/cannery_web/live/pack_live/form_component.ex index 9f567b37..96e350d8 100644 --- a/lib/cannery_web/live/pack_live/form_component.ex +++ b/lib/cannery_web/live/pack_live/form_component.ex @@ -4,7 +4,7 @@ defmodule CanneryWeb.PackLive.FormComponent do """ use CanneryWeb, :live_component - alias Cannery.Ammo.{Pack, AmmoType} + alias Cannery.Ammo.{AmmoType, Pack} alias Cannery.{Accounts.User, Ammo, Containers, Containers.Container} alias Ecto.Changeset alias Phoenix.LiveView.Socket diff --git a/lib/cannery_web/live/pack_live/index.ex b/lib/cannery_web/live/pack_live/index.ex index b9193b08..d17eb694 100644 --- a/lib/cannery_web/live/pack_live/index.ex +++ b/lib/cannery_web/live/pack_live/index.ex @@ -148,7 +148,7 @@ defmodule CanneryWeb.PackLive.Index do } } = socket ) do - # get total number of ammo groups to determine whether to display onboarding + # get total number of packs to determine whether to display onboarding # prompts packs_count = Ammo.get_packs_count!(current_user, true) packs = Ammo.list_packs(search, class, current_user, show_used) diff --git a/lib/cannery_web/live/pack_live/index.html.heex b/lib/cannery_web/live/pack_live/index.html.heex index 3910b94a..b74388c0 100644 --- a/lib/cannery_web/live/pack_live/index.html.heex +++ b/lib/cannery_web/live/pack_live/index.html.heex @@ -151,9 +151,7 @@ navigate={Routes.pack_show_path(Endpoint, :show, pack)} class="text-primary-600 link" aria-label={ - dgettext("actions", "View ammo group of %{pack_count} bullets", - pack_count: pack_count - ) + dgettext("actions", "View pack of %{pack_count} bullets", pack_count: pack_count) } > @@ -163,9 +161,7 @@ patch={Routes.pack_index_path(Endpoint, :edit, pack)} class="text-primary-600 link" aria-label={ - dgettext("actions", "Edit ammo group of %{pack_count} bullets", - pack_count: pack_count - ) + dgettext("actions", "Edit pack of %{pack_count} bullets", pack_count: pack_count) } > @@ -175,7 +171,7 @@ patch={Routes.pack_index_path(Endpoint, :clone, pack)} class="text-primary-600 link" aria-label={ - dgettext("actions", "Clone ammo group of %{pack_count} bullets", + dgettext("actions", "Clone pack of %{pack_count} bullets", pack_count: pack_count ) } @@ -190,7 +186,7 @@ phx-value-id={pack.id} data-confirm={dgettext("prompts", "Are you sure you want to delete this ammo?")} aria-label={ - dgettext("actions", "Delete ammo group of %{pack_count} bullets", + dgettext("actions", "Delete pack of %{pack_count} bullets", pack_count: pack_count ) } diff --git a/lib/cannery_web/live/pack_live/show.html.heex b/lib/cannery_web/live/pack_live/show.html.heex index 7d37dad7..d4bbc8ca 100644 --- a/lib/cannery_web/live/pack_live/show.html.heex +++ b/lib/cannery_web/live/pack_live/show.html.heex @@ -59,7 +59,7 @@ patch={Routes.pack_show_path(Endpoint, :edit, @pack)} class="mx-4 my-2 text-primary-600 link" aria-label={ - dgettext("actions", "Edit ammo group of %{pack_count} bullets", pack_count: @pack.count) + dgettext("actions", "Edit pack of %{pack_count} bullets", pack_count: @pack.count) } > @@ -71,9 +71,7 @@ phx-click="delete" data-confirm={dgettext("prompts", "Are you sure you want to delete this ammo?")} aria-label={ - dgettext("actions", "Delete ammo group of %{pack_count} bullets", - pack_count: @pack.count - ) + dgettext("actions", "Delete pack of %{pack_count} bullets", pack_count: @pack.count) } > diff --git a/priv/gettext/actions.pot b/priv/gettext/actions.pot index 91b4cb61..a8cd936d 100644 --- a/priv/gettext/actions.pot +++ b/priv/gettext/actions.pot @@ -157,7 +157,7 @@ msgid "Why not get some ready to shoot?" msgstr "" #: lib/cannery_web/live/pack_live/index.html.heex:127 -#: lib/cannery_web/live/pack_live/show.html.heex:98 +#: lib/cannery_web/live/pack_live/show.html.heex:96 #: lib/cannery_web/live/range_live/index.html.heex:45 #, elixir-autogen, elixir-format msgid "Record shots" @@ -210,7 +210,7 @@ msgstr "" #: lib/cannery_web/components/move_pack_component.ex:78 #: lib/cannery_web/live/pack_live/index.html.heex:144 -#: lib/cannery_web/live/pack_live/show.html.heex:91 +#: lib/cannery_web/live/pack_live/show.html.heex:89 #, elixir-autogen, elixir-format msgid "Move ammo" msgstr "" @@ -220,13 +220,13 @@ msgstr "" msgid "Set Unlimited" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:87 +#: lib/cannery_web/live/pack_live/show.html.heex:85 #: lib/cannery_web/live/range_live/index.html.heex:38 #, elixir-autogen, elixir-format msgid "Stage for range" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:86 +#: lib/cannery_web/live/pack_live/show.html.heex:84 #: lib/cannery_web/live/range_live/index.html.heex:37 #, elixir-autogen, elixir-format msgid "Unstage from range" @@ -336,25 +336,25 @@ msgstr "" msgid "View %{ammo_type_name}" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:178 +#: lib/cannery_web/live/pack_live/index.html.heex:174 #, elixir-autogen, elixir-format -msgid "Clone ammo group of %{pack_count} bullets" +msgid "Clone pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:193 +#: lib/cannery_web/live/pack_live/index.html.heex:189 #: lib/cannery_web/live/pack_live/show.html.heex:74 #, elixir-autogen, elixir-format -msgid "Delete ammo group of %{pack_count} bullets" +msgid "Delete pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:166 +#: lib/cannery_web/live/pack_live/index.html.heex:164 #: lib/cannery_web/live/pack_live/show.html.heex:62 #, elixir-autogen, elixir-format -msgid "Edit ammo group of %{pack_count} bullets" +msgid "Edit pack of %{pack_count} bullets" msgstr "" #: lib/cannery_web/live/ammo_type_live/show.html.heex:206 #: lib/cannery_web/live/pack_live/index.html.heex:154 #, elixir-autogen, elixir-format -msgid "View ammo group of %{pack_count} bullets" +msgid "View pack of %{pack_count} bullets" msgstr "" diff --git a/priv/gettext/de/LC_MESSAGES/actions.po b/priv/gettext/de/LC_MESSAGES/actions.po index 51b83dd6..be472f9c 100644 --- a/priv/gettext/de/LC_MESSAGES/actions.po +++ b/priv/gettext/de/LC_MESSAGES/actions.po @@ -170,7 +170,7 @@ msgid "Why not get some ready to shoot?" msgstr "Warum nicht einige für den Schießstand auswählen?" #: lib/cannery_web/live/pack_live/index.html.heex:127 -#: lib/cannery_web/live/pack_live/show.html.heex:98 +#: lib/cannery_web/live/pack_live/show.html.heex:96 #: lib/cannery_web/live/range_live/index.html.heex:45 #, elixir-autogen, elixir-format msgid "Record shots" @@ -223,7 +223,7 @@ msgstr "" #: lib/cannery_web/components/move_pack_component.ex:78 #: lib/cannery_web/live/pack_live/index.html.heex:144 -#: lib/cannery_web/live/pack_live/show.html.heex:91 +#: lib/cannery_web/live/pack_live/show.html.heex:89 #, elixir-autogen, elixir-format msgid "Move ammo" msgstr "" @@ -233,13 +233,13 @@ msgstr "" msgid "Set Unlimited" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:87 +#: lib/cannery_web/live/pack_live/show.html.heex:85 #: lib/cannery_web/live/range_live/index.html.heex:38 #, elixir-autogen, elixir-format msgid "Stage for range" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:86 +#: lib/cannery_web/live/pack_live/show.html.heex:84 #: lib/cannery_web/live/range_live/index.html.heex:37 #, elixir-autogen, elixir-format msgid "Unstage from range" @@ -349,25 +349,25 @@ msgstr "" msgid "View %{ammo_type_name}" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:178 +#: lib/cannery_web/live/pack_live/index.html.heex:174 #, elixir-autogen, elixir-format, fuzzy -msgid "Clone ammo group of %{pack_count} bullets" +msgid "Clone pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:193 +#: lib/cannery_web/live/pack_live/index.html.heex:189 #: lib/cannery_web/live/pack_live/show.html.heex:74 #, elixir-autogen, elixir-format, fuzzy -msgid "Delete ammo group of %{pack_count} bullets" +msgid "Delete pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:166 +#: lib/cannery_web/live/pack_live/index.html.heex:164 #: lib/cannery_web/live/pack_live/show.html.heex:62 #, elixir-autogen, elixir-format, fuzzy -msgid "Edit ammo group of %{pack_count} bullets" +msgid "Edit pack of %{pack_count} bullets" msgstr "" #: lib/cannery_web/live/ammo_type_live/show.html.heex:206 #: lib/cannery_web/live/pack_live/index.html.heex:154 #, elixir-autogen, elixir-format, fuzzy -msgid "View ammo group of %{pack_count} bullets" +msgid "View pack of %{pack_count} bullets" msgstr "" diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index 23683ec4..63ce2593 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -366,7 +366,7 @@ msgstr "Einfach:" msgid "Steel" msgstr "Stahl" -#: lib/cannery_web/live/pack_live/show.html.heex:108 +#: lib/cannery_web/live/pack_live/show.html.heex:106 #, elixir-autogen, elixir-format msgid "Stored in" msgstr "Gelagert in" @@ -647,7 +647,7 @@ msgstr "Ursprüngliche Anzahl:" msgid "Percentage left:" msgstr "Prozent verbleibend:" -#: lib/cannery_web/live/pack_live/show.html.heex:121 +#: lib/cannery_web/live/pack_live/show.html.heex:119 #, elixir-autogen, elixir-format msgid "Rounds used" msgstr "Patronen verbraucht" @@ -762,7 +762,7 @@ msgstr "Keine Munitionsgruppe in diesem Behälter" msgid "Show Ammo" msgstr "Zeige Munitionsarten" -#: lib/cannery_web/live/pack_live/show.html.heex:113 +#: lib/cannery_web/live/pack_live/show.html.heex:111 #, elixir-autogen, elixir-format, fuzzy msgid "This ammo is not in a container" msgstr "Diese Munitionsgruppe ist nicht in einem Behälter" diff --git a/priv/gettext/de/LC_MESSAGES/prompts.po b/priv/gettext/de/LC_MESSAGES/prompts.po index 81243b5f..58d75b1f 100644 --- a/priv/gettext/de/LC_MESSAGES/prompts.po +++ b/priv/gettext/de/LC_MESSAGES/prompts.po @@ -73,7 +73,7 @@ msgstr "" msgid "Are you sure you want to delete %{name}?" msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?" -#: lib/cannery_web/live/pack_live/index.html.heex:191 +#: lib/cannery_web/live/pack_live/index.html.heex:187 #: lib/cannery_web/live/pack_live/show.html.heex:72 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete this ammo?" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 98356592..7a7834f9 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -360,7 +360,7 @@ msgstr "" msgid "Steel" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:108 +#: lib/cannery_web/live/pack_live/show.html.heex:106 #, elixir-autogen, elixir-format msgid "Stored in" msgstr "" @@ -641,7 +641,7 @@ msgstr "" msgid "Percentage left:" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:121 +#: lib/cannery_web/live/pack_live/show.html.heex:119 #, elixir-autogen, elixir-format msgid "Rounds used" msgstr "" @@ -756,7 +756,7 @@ msgstr "" msgid "Show Ammo" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:113 +#: lib/cannery_web/live/pack_live/show.html.heex:111 #, elixir-autogen, elixir-format msgid "This ammo is not in a container" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/actions.po b/priv/gettext/en/LC_MESSAGES/actions.po index 42541ff8..378b9d27 100644 --- a/priv/gettext/en/LC_MESSAGES/actions.po +++ b/priv/gettext/en/LC_MESSAGES/actions.po @@ -157,7 +157,7 @@ msgid "Why not get some ready to shoot?" msgstr "" #: lib/cannery_web/live/pack_live/index.html.heex:127 -#: lib/cannery_web/live/pack_live/show.html.heex:98 +#: lib/cannery_web/live/pack_live/show.html.heex:96 #: lib/cannery_web/live/range_live/index.html.heex:45 #, elixir-autogen, elixir-format msgid "Record shots" @@ -210,7 +210,7 @@ msgstr "" #: lib/cannery_web/components/move_pack_component.ex:78 #: lib/cannery_web/live/pack_live/index.html.heex:144 -#: lib/cannery_web/live/pack_live/show.html.heex:91 +#: lib/cannery_web/live/pack_live/show.html.heex:89 #, elixir-autogen, elixir-format msgid "Move ammo" msgstr "" @@ -220,13 +220,13 @@ msgstr "" msgid "Set Unlimited" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:87 +#: lib/cannery_web/live/pack_live/show.html.heex:85 #: lib/cannery_web/live/range_live/index.html.heex:38 #, elixir-autogen, elixir-format msgid "Stage for range" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:86 +#: lib/cannery_web/live/pack_live/show.html.heex:84 #: lib/cannery_web/live/range_live/index.html.heex:37 #, elixir-autogen, elixir-format msgid "Unstage from range" @@ -336,25 +336,25 @@ msgstr "" msgid "View %{ammo_type_name}" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:178 +#: lib/cannery_web/live/pack_live/index.html.heex:174 #, elixir-autogen, elixir-format, fuzzy -msgid "Clone ammo group of %{pack_count} bullets" +msgid "Clone pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:193 +#: lib/cannery_web/live/pack_live/index.html.heex:189 #: lib/cannery_web/live/pack_live/show.html.heex:74 #, elixir-autogen, elixir-format, fuzzy -msgid "Delete ammo group of %{pack_count} bullets" +msgid "Delete pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:166 +#: lib/cannery_web/live/pack_live/index.html.heex:164 #: lib/cannery_web/live/pack_live/show.html.heex:62 #, elixir-autogen, elixir-format, fuzzy -msgid "Edit ammo group of %{pack_count} bullets" +msgid "Edit pack of %{pack_count} bullets" msgstr "" #: lib/cannery_web/live/ammo_type_live/show.html.heex:206 #: lib/cannery_web/live/pack_live/index.html.heex:154 #, elixir-autogen, elixir-format, fuzzy -msgid "View ammo group of %{pack_count} bullets" +msgid "View pack of %{pack_count} bullets" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index e4a3bb5d..1750d833 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -360,7 +360,7 @@ msgstr "" msgid "Steel" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:108 +#: lib/cannery_web/live/pack_live/show.html.heex:106 #, elixir-autogen, elixir-format msgid "Stored in" msgstr "" @@ -641,7 +641,7 @@ msgstr "" msgid "Percentage left:" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:121 +#: lib/cannery_web/live/pack_live/show.html.heex:119 #, elixir-autogen, elixir-format, fuzzy msgid "Rounds used" msgstr "" @@ -756,7 +756,7 @@ msgstr "" msgid "Show Ammo" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:113 +#: lib/cannery_web/live/pack_live/show.html.heex:111 #, elixir-autogen, elixir-format, fuzzy msgid "This ammo is not in a container" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po index 906d58c4..7ff70c1e 100644 --- a/priv/gettext/en/LC_MESSAGES/prompts.po +++ b/priv/gettext/en/LC_MESSAGES/prompts.po @@ -58,7 +58,7 @@ msgstr "" msgid "Are you sure you want to delete %{name}?" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:191 +#: lib/cannery_web/live/pack_live/index.html.heex:187 #: lib/cannery_web/live/pack_live/show.html.heex:72 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete this ammo?" diff --git a/priv/gettext/es/LC_MESSAGES/actions.po b/priv/gettext/es/LC_MESSAGES/actions.po index 3f5a06bf..16edb8b5 100644 --- a/priv/gettext/es/LC_MESSAGES/actions.po +++ b/priv/gettext/es/LC_MESSAGES/actions.po @@ -170,7 +170,7 @@ msgid "Why not get some ready to shoot?" msgstr "¿Por qué no preparar parte para disparar?" #: lib/cannery_web/live/pack_live/index.html.heex:127 -#: lib/cannery_web/live/pack_live/show.html.heex:98 +#: lib/cannery_web/live/pack_live/show.html.heex:96 #: lib/cannery_web/live/range_live/index.html.heex:45 #, elixir-autogen, elixir-format msgid "Record shots" @@ -223,7 +223,7 @@ msgstr "añade primero un tipo de munición" #: lib/cannery_web/components/move_pack_component.ex:78 #: lib/cannery_web/live/pack_live/index.html.heex:144 -#: lib/cannery_web/live/pack_live/show.html.heex:91 +#: lib/cannery_web/live/pack_live/show.html.heex:89 #, elixir-autogen, elixir-format msgid "Move ammo" msgstr "Mover munición" @@ -233,13 +233,13 @@ msgstr "Mover munición" msgid "Set Unlimited" msgstr "Activar ilimitados" -#: lib/cannery_web/live/pack_live/show.html.heex:87 +#: lib/cannery_web/live/pack_live/show.html.heex:85 #: lib/cannery_web/live/range_live/index.html.heex:38 #, elixir-autogen, elixir-format msgid "Stage for range" msgstr "Preparar para el campo de tiro" -#: lib/cannery_web/live/pack_live/show.html.heex:86 +#: lib/cannery_web/live/pack_live/show.html.heex:84 #: lib/cannery_web/live/range_live/index.html.heex:37 #, elixir-autogen, elixir-format msgid "Unstage from range" @@ -349,25 +349,25 @@ msgstr "" msgid "View %{ammo_type_name}" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:178 +#: lib/cannery_web/live/pack_live/index.html.heex:174 #, elixir-autogen, elixir-format, fuzzy -msgid "Clone ammo group of %{pack_count} bullets" +msgid "Clone pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:193 +#: lib/cannery_web/live/pack_live/index.html.heex:189 #: lib/cannery_web/live/pack_live/show.html.heex:74 #, elixir-autogen, elixir-format, fuzzy -msgid "Delete ammo group of %{pack_count} bullets" +msgid "Delete pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:166 +#: lib/cannery_web/live/pack_live/index.html.heex:164 #: lib/cannery_web/live/pack_live/show.html.heex:62 #, elixir-autogen, elixir-format, fuzzy -msgid "Edit ammo group of %{pack_count} bullets" +msgid "Edit pack of %{pack_count} bullets" msgstr "" #: lib/cannery_web/live/ammo_type_live/show.html.heex:206 #: lib/cannery_web/live/pack_live/index.html.heex:154 #, elixir-autogen, elixir-format, fuzzy -msgid "View ammo group of %{pack_count} bullets" +msgid "View pack of %{pack_count} bullets" msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po index ebb52e04..482b4a42 100644 --- a/priv/gettext/es/LC_MESSAGES/default.po +++ b/priv/gettext/es/LC_MESSAGES/default.po @@ -366,7 +366,7 @@ msgstr "Simple:" msgid "Steel" msgstr "Acero" -#: lib/cannery_web/live/pack_live/show.html.heex:108 +#: lib/cannery_web/live/pack_live/show.html.heex:106 #, elixir-autogen, elixir-format msgid "Stored in" msgstr "Guardado en" @@ -648,7 +648,7 @@ msgstr "Cantidad original:" msgid "Percentage left:" msgstr "Pocentaje restante:" -#: lib/cannery_web/live/pack_live/show.html.heex:121 +#: lib/cannery_web/live/pack_live/show.html.heex:119 #, elixir-autogen, elixir-format msgid "Rounds used" msgstr "Balas usadas" @@ -763,7 +763,7 @@ msgstr "No hay munición en este contenedor" msgid "Show Ammo" msgstr "Mostrar Munición" -#: lib/cannery_web/live/pack_live/show.html.heex:113 +#: lib/cannery_web/live/pack_live/show.html.heex:111 #, elixir-autogen, elixir-format msgid "This ammo is not in a container" msgstr "Esta munición no está en un contenedor" diff --git a/priv/gettext/es/LC_MESSAGES/prompts.po b/priv/gettext/es/LC_MESSAGES/prompts.po index 26cb775c..6fa49285 100644 --- a/priv/gettext/es/LC_MESSAGES/prompts.po +++ b/priv/gettext/es/LC_MESSAGES/prompts.po @@ -73,7 +73,7 @@ msgstr "Está seguro que desea eliminar %{email}? Esta acción es permanente!" msgid "Are you sure you want to delete %{name}?" msgstr "Está seguro que desea eliminar %{name}?" -#: lib/cannery_web/live/pack_live/index.html.heex:191 +#: lib/cannery_web/live/pack_live/index.html.heex:187 #: lib/cannery_web/live/pack_live/show.html.heex:72 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete this ammo?" diff --git a/priv/gettext/fr/LC_MESSAGES/actions.po b/priv/gettext/fr/LC_MESSAGES/actions.po index da637d30..8791bec1 100644 --- a/priv/gettext/fr/LC_MESSAGES/actions.po +++ b/priv/gettext/fr/LC_MESSAGES/actions.po @@ -170,7 +170,7 @@ msgid "Why not get some ready to shoot?" msgstr "Pourquoi pas en préparer pour tirer ?" #: lib/cannery_web/live/pack_live/index.html.heex:127 -#: lib/cannery_web/live/pack_live/show.html.heex:98 +#: lib/cannery_web/live/pack_live/show.html.heex:96 #: lib/cannery_web/live/range_live/index.html.heex:45 #, elixir-autogen, elixir-format msgid "Record shots" @@ -223,7 +223,7 @@ msgstr "Ajoutez d'abord un type de munitions" #: lib/cannery_web/components/move_pack_component.ex:78 #: lib/cannery_web/live/pack_live/index.html.heex:144 -#: lib/cannery_web/live/pack_live/show.html.heex:91 +#: lib/cannery_web/live/pack_live/show.html.heex:89 #, elixir-autogen, elixir-format msgid "Move ammo" msgstr "" @@ -233,13 +233,13 @@ msgstr "" msgid "Set Unlimited" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:87 +#: lib/cannery_web/live/pack_live/show.html.heex:85 #: lib/cannery_web/live/range_live/index.html.heex:38 #, elixir-autogen, elixir-format msgid "Stage for range" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:86 +#: lib/cannery_web/live/pack_live/show.html.heex:84 #: lib/cannery_web/live/range_live/index.html.heex:37 #, elixir-autogen, elixir-format msgid "Unstage from range" @@ -349,25 +349,25 @@ msgstr "" msgid "View %{ammo_type_name}" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:178 +#: lib/cannery_web/live/pack_live/index.html.heex:174 #, elixir-autogen, elixir-format, fuzzy -msgid "Clone ammo group of %{pack_count} bullets" +msgid "Clone pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:193 +#: lib/cannery_web/live/pack_live/index.html.heex:189 #: lib/cannery_web/live/pack_live/show.html.heex:74 #, elixir-autogen, elixir-format, fuzzy -msgid "Delete ammo group of %{pack_count} bullets" +msgid "Delete pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:166 +#: lib/cannery_web/live/pack_live/index.html.heex:164 #: lib/cannery_web/live/pack_live/show.html.heex:62 #, elixir-autogen, elixir-format, fuzzy -msgid "Edit ammo group of %{pack_count} bullets" +msgid "Edit pack of %{pack_count} bullets" msgstr "" #: lib/cannery_web/live/ammo_type_live/show.html.heex:206 #: lib/cannery_web/live/pack_live/index.html.heex:154 #, elixir-autogen, elixir-format, fuzzy -msgid "View ammo group of %{pack_count} bullets" +msgid "View pack of %{pack_count} bullets" msgstr "" diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po index f121b3f2..32b78e48 100644 --- a/priv/gettext/fr/LC_MESSAGES/default.po +++ b/priv/gettext/fr/LC_MESSAGES/default.po @@ -366,7 +366,7 @@ msgstr "Simple :" msgid "Steel" msgstr "Acier" -#: lib/cannery_web/live/pack_live/show.html.heex:108 +#: lib/cannery_web/live/pack_live/show.html.heex:106 #, elixir-autogen, elixir-format msgid "Stored in" msgstr "Est stocké dans" @@ -649,7 +649,7 @@ msgstr "Nombre original :" msgid "Percentage left:" msgstr "Pourcentage restant :" -#: lib/cannery_web/live/pack_live/show.html.heex:121 +#: lib/cannery_web/live/pack_live/show.html.heex:119 #, elixir-autogen, elixir-format msgid "Rounds used" msgstr "Cartouches utilisées" @@ -764,7 +764,7 @@ msgstr "Aucun groupe de munition pour ce conteneur" msgid "Show Ammo" msgstr "Montrer le type de munition" -#: lib/cannery_web/live/pack_live/show.html.heex:113 +#: lib/cannery_web/live/pack_live/show.html.heex:111 #, elixir-autogen, elixir-format, fuzzy msgid "This ammo is not in a container" msgstr "Ce groupe de munition n’est pas dans un conteneur" diff --git a/priv/gettext/fr/LC_MESSAGES/prompts.po b/priv/gettext/fr/LC_MESSAGES/prompts.po index 4a1bd9bb..338865a5 100644 --- a/priv/gettext/fr/LC_MESSAGES/prompts.po +++ b/priv/gettext/fr/LC_MESSAGES/prompts.po @@ -74,7 +74,7 @@ msgstr "" msgid "Are you sure you want to delete %{name}?" msgstr "Êtes-vous certain·e de supprimer %{name} ?" -#: lib/cannery_web/live/pack_live/index.html.heex:191 +#: lib/cannery_web/live/pack_live/index.html.heex:187 #: lib/cannery_web/live/pack_live/show.html.heex:72 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete this ammo?" diff --git a/priv/gettext/ga/LC_MESSAGES/actions.po b/priv/gettext/ga/LC_MESSAGES/actions.po index f9010f4d..698036ab 100644 --- a/priv/gettext/ga/LC_MESSAGES/actions.po +++ b/priv/gettext/ga/LC_MESSAGES/actions.po @@ -168,7 +168,7 @@ msgid "Why not get some ready to shoot?" msgstr "" #: lib/cannery_web/live/pack_live/index.html.heex:127 -#: lib/cannery_web/live/pack_live/show.html.heex:98 +#: lib/cannery_web/live/pack_live/show.html.heex:96 #: lib/cannery_web/live/range_live/index.html.heex:45 #, elixir-autogen, elixir-format msgid "Record shots" @@ -221,7 +221,7 @@ msgstr "" #: lib/cannery_web/components/move_pack_component.ex:78 #: lib/cannery_web/live/pack_live/index.html.heex:144 -#: lib/cannery_web/live/pack_live/show.html.heex:91 +#: lib/cannery_web/live/pack_live/show.html.heex:89 #, elixir-autogen, elixir-format msgid "Move ammo" msgstr "" @@ -231,13 +231,13 @@ msgstr "" msgid "Set Unlimited" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:87 +#: lib/cannery_web/live/pack_live/show.html.heex:85 #: lib/cannery_web/live/range_live/index.html.heex:38 #, elixir-autogen, elixir-format msgid "Stage for range" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:86 +#: lib/cannery_web/live/pack_live/show.html.heex:84 #: lib/cannery_web/live/range_live/index.html.heex:37 #, elixir-autogen, elixir-format msgid "Unstage from range" @@ -347,25 +347,25 @@ msgstr "" msgid "View %{ammo_type_name}" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:178 +#: lib/cannery_web/live/pack_live/index.html.heex:174 #, elixir-autogen, elixir-format, fuzzy -msgid "Clone ammo group of %{pack_count} bullets" +msgid "Clone pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:193 +#: lib/cannery_web/live/pack_live/index.html.heex:189 #: lib/cannery_web/live/pack_live/show.html.heex:74 #, elixir-autogen, elixir-format, fuzzy -msgid "Delete ammo group of %{pack_count} bullets" +msgid "Delete pack of %{pack_count} bullets" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:166 +#: lib/cannery_web/live/pack_live/index.html.heex:164 #: lib/cannery_web/live/pack_live/show.html.heex:62 #, elixir-autogen, elixir-format, fuzzy -msgid "Edit ammo group of %{pack_count} bullets" +msgid "Edit pack of %{pack_count} bullets" msgstr "" #: lib/cannery_web/live/ammo_type_live/show.html.heex:206 #: lib/cannery_web/live/pack_live/index.html.heex:154 #, elixir-autogen, elixir-format, fuzzy -msgid "View ammo group of %{pack_count} bullets" +msgid "View pack of %{pack_count} bullets" msgstr "" diff --git a/priv/gettext/ga/LC_MESSAGES/default.po b/priv/gettext/ga/LC_MESSAGES/default.po index f29a2b94..62477de1 100644 --- a/priv/gettext/ga/LC_MESSAGES/default.po +++ b/priv/gettext/ga/LC_MESSAGES/default.po @@ -362,7 +362,7 @@ msgstr "" msgid "Steel" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:108 +#: lib/cannery_web/live/pack_live/show.html.heex:106 #, elixir-autogen, elixir-format msgid "Stored in" msgstr "" @@ -643,7 +643,7 @@ msgstr "" msgid "Percentage left:" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:121 +#: lib/cannery_web/live/pack_live/show.html.heex:119 #, elixir-autogen, elixir-format msgid "Rounds used" msgstr "" @@ -758,7 +758,7 @@ msgstr "" msgid "Show Ammo" msgstr "" -#: lib/cannery_web/live/pack_live/show.html.heex:113 +#: lib/cannery_web/live/pack_live/show.html.heex:111 #, elixir-autogen, elixir-format msgid "This ammo is not in a container" msgstr "" diff --git a/priv/gettext/ga/LC_MESSAGES/prompts.po b/priv/gettext/ga/LC_MESSAGES/prompts.po index 0a3b2281..fd016850 100644 --- a/priv/gettext/ga/LC_MESSAGES/prompts.po +++ b/priv/gettext/ga/LC_MESSAGES/prompts.po @@ -69,7 +69,7 @@ msgstr "" msgid "Are you sure you want to delete %{name}?" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:191 +#: lib/cannery_web/live/pack_live/index.html.heex:187 #: lib/cannery_web/live/pack_live/show.html.heex:72 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete this ammo?" diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index feb0bbec..3efe87a8 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -58,7 +58,7 @@ msgstr "" msgid "Are you sure you want to delete %{name}?" msgstr "" -#: lib/cannery_web/live/pack_live/index.html.heex:191 +#: lib/cannery_web/live/pack_live/index.html.heex:187 #: lib/cannery_web/live/pack_live/show.html.heex:72 #, elixir-autogen, elixir-format msgid "Are you sure you want to delete this ammo?" diff --git a/test/cannery/activity_log_test.exs b/test/cannery/activity_log_test.exs index 7958d902..ac371d83 100644 --- a/test/cannery/activity_log_test.exs +++ b/test/cannery/activity_log_test.exs @@ -59,7 +59,7 @@ defmodule Cannery.ActivityLogTest do assert shot_group.notes == "some notes" end - test "create_shot_group/3 removes corresponding count from ammo group", + test "create_shot_group/3 removes corresponding count from pack", %{ current_user: current_user, pack: %{id: pack_id, count: org_count} = pack @@ -75,7 +75,7 @@ defmodule Cannery.ActivityLogTest do assert new_count == 10 end - test "create_shot_group/3 does not remove more than ammo group amount", + test "create_shot_group/3 does not remove more tha pack amount", %{current_user: current_user, pack: %{id: pack_id} = pack} do valid_attrs = %{count: 20, date: ~D[2022-02-13], notes: "some notes"} @@ -302,7 +302,7 @@ defmodule Cannery.ActivityLogTest do [ammo_type, another_ammo_type] |> ActivityLog.get_used_count_for_ammo_types(current_user) - # use generated ammo group + # use generated pack shot_group_fixture(%{count: 5}, current_user, pack) used_counts = @@ -311,7 +311,7 @@ defmodule Cannery.ActivityLogTest do assert %{^ammo_type_id => 5} = used_counts assert %{^another_ammo_type_id => 5} = used_counts - # use generated ammo group again + # use generated pack again shot_group_fixture(%{count: 1}, current_user, pack) used_counts = @@ -407,7 +407,7 @@ defmodule Cannery.ActivityLogTest do # notes assert ActivityLog.list_shot_groups("amazing", :all, current_user) == [shot_group_a] - # ammo group attributes + # pack attributes assert ActivityLog.list_shot_groups("stupendous", :all, current_user) == [shot_group_b] # ammo type attributes diff --git a/test/cannery/ammo_test.exs b/test/cannery/ammo_test.exs index 9613e88f..fad8f0ac 100644 --- a/test/cannery/ammo_test.exs +++ b/test/cannery/ammo_test.exs @@ -4,7 +4,7 @@ defmodule Cannery.AmmoTest do """ use Cannery.DataCase - alias Cannery.{Ammo, Ammo.Pack, Ammo.AmmoType, Containers} + alias Cannery.{Ammo, Ammo.AmmoType, Ammo.Pack, Containers} alias Ecto.Changeset @moduletag :ammo_test @@ -211,7 +211,7 @@ defmodule Cannery.AmmoTest do end end - describe "ammo types with ammo groups" do + describe "ammo types with packs" do setup do current_user = user_fixture() ammo_type = ammo_type_fixture(current_user) @@ -516,14 +516,14 @@ defmodule Cannery.AmmoTest do [ammo_type, another_ammo_type] |> Ammo.get_used_packs_count_for_types(current_user) - # testing ammo type with ammo group + # testing ammo type with pack {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user) assert %{} == [ammo_type, another_ammo_type] |> Ammo.get_used_packs_count_for_types(current_user) - # testing ammo type with used ammo group + # testing ammo type with used pack {1, [another_pack]} = pack_fixture(%{count: 50}, another_ammo_type, container, current_user) shot_group_fixture(%{count: 50}, current_user, another_pack) @@ -532,7 +532,7 @@ defmodule Cannery.AmmoTest do [ammo_type, another_ammo_type] |> Ammo.get_used_packs_count_for_types(current_user) - # testing two ammo types with zero and one used ammo groups + # testing two ammo types with zero and one used packs {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user) shot_group_fixture(%{count: 50}, current_user, pack) @@ -542,7 +542,7 @@ defmodule Cannery.AmmoTest do assert %{^ammo_type_id => 1} = used_counts assert %{^another_ammo_type_id => 1} = used_counts - # testing two ammo type with one and two used ammo groups + # testing two ammo type with one and two used packs shot_group_fixture(%{count: 1}, current_user, first_pack) used_counts = @@ -778,14 +778,14 @@ defmodule Cannery.AmmoTest do assert pack in packs end - test "list_packs/4 returns relevant ammo groups when searched", %{ + test "list_packs/4 returns relevant packs when searched", %{ ammo_type: ammo_type, pack: pack, container: container, current_user: current_user } do {1, [another_pack]} = - %{count: 49, notes: "cool ammo group"} + %{count: 49, notes: "cool pack"} |> pack_fixture(ammo_type, container, current_user) another_ammo_type = ammo_type_fixture(%{name: "amazing ammo"}, current_user) @@ -806,7 +806,7 @@ defmodule Cannery.AmmoTest do assert another_pack in packs assert pack in packs - # search works for ammo group attributes + # search works for pack attributes assert Ammo.list_packs("cool", :all, current_user, true) == [another_pack] # search works for ammo type attributes diff --git a/test/cannery_web/live/ammo_type_live_test.exs b/test/cannery_web/live/ammo_type_live_test.exs index edd89281..5a77cda3 100644 --- a/test/cannery_web/live/ammo_type_live_test.exs +++ b/test/cannery_web/live/ammo_type_live_test.exs @@ -34,7 +34,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do grains: nil } @pack_attrs %{ - notes: "some ammo group", + notes: "some pack", count: 20 } @shot_group_attrs %{ @@ -248,10 +248,10 @@ defmodule CanneryWeb.AmmoTypeLiveTest do end end - describe "Index with ammo group" do + describe "Index with pack" do setup [:register_and_log_in_user, :create_ammo_type, :create_pack] - test "shows used ammo groups on toggle", + test "shows used packs on toggle", %{conn: conn, pack: pack, current_user: current_user} do {:ok, index_live, html} = live(conn, Routes.ammo_type_index_path(conn, :index)) @@ -327,10 +327,10 @@ defmodule CanneryWeb.AmmoTypeLiveTest do end end - describe "Show ammo type with ammo group" do + describe "Show ammo type with pack" do setup [:register_and_log_in_user, :create_ammo_type, :create_pack] - test "displays ammo group", %{ + test "displays pack", %{ conn: conn, ammo_type: %{name: ammo_type_name} = ammo_type, container: %{name: container_name} @@ -342,7 +342,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do assert html =~ container_name end - test "displays ammo group in table", + test "displays pack in table", %{conn: conn, ammo_type: ammo_type, container: %{name: container_name}} do {:ok, show_live, _html} = live(conn, Routes.ammo_type_show_path(conn, :show, ammo_type)) @@ -356,10 +356,10 @@ defmodule CanneryWeb.AmmoTypeLiveTest do end end - describe "Show ammo type with empty ammo group" do + describe "Show ammo type with empty pack" do setup [:register_and_log_in_user, :create_ammo_type, :create_empty_pack] - test "displays empty ammo groups on toggle", + test "displays empty packs on toggle", %{conn: conn, ammo_type: ammo_type, container: %{name: container_name}} do {:ok, show_live, html} = live(conn, Routes.ammo_type_show_path(conn, :show, ammo_type)) assert html =~ "Show used" @@ -375,7 +375,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do assert html =~ container_name end - test "displays empty ammo groups in table on toggle", + test "displays empty packs in table on toggle", %{conn: conn, ammo_type: ammo_type, container: %{name: container_name}} do {:ok, show_live, _html} = live(conn, Routes.ammo_type_show_path(conn, :show, ammo_type)) diff --git a/test/cannery_web/live/container_live_test.exs b/test/cannery_web/live/container_live_test.exs index bd1c2418..7908760d 100644 --- a/test/cannery_web/live/container_live_test.exs +++ b/test/cannery_web/live/container_live_test.exs @@ -31,7 +31,7 @@ defmodule CanneryWeb.ContainerLiveTest do grains: 120 } @pack_attrs %{ - notes: "some ammo group", + notes: "some pack", count: 20 } @@ -298,10 +298,10 @@ defmodule CanneryWeb.ContainerLiveTest do end end - describe "Show with ammo group" do + describe "Show with pack" do setup [:register_and_log_in_user, :create_container, :create_pack] - test "displays ammo group", + test "displays pack", %{conn: conn, ammo_type: %{name: ammo_type_name}, container: container} do {:ok, _show_live, html} = live(conn, Routes.container_show_path(conn, :show, container)) @@ -309,7 +309,7 @@ defmodule CanneryWeb.ContainerLiveTest do assert html =~ "\n20\n" end - test "displays ammo group in table", + test "displays pack in table", %{conn: conn, ammo_type: %{name: ammo_type_name}, container: container} do {:ok, show_live, _html} = live(conn, Routes.container_show_path(conn, :show, container)) diff --git a/test/cannery_web/live/pack_live_test.exs b/test/cannery_web/live/pack_live_test.exs index 69171a92..807fb5d8 100644 --- a/test/cannery_web/live/pack_live_test.exs +++ b/test/cannery_web/live/pack_live_test.exs @@ -1,6 +1,6 @@ defmodule CanneryWeb.PackLiveTest do @moduledoc """ - Tests ammo group live pages + Tests pack live pages """ use CanneryWeb.ConnCase @@ -52,7 +52,7 @@ defmodule CanneryWeb.PackLiveTest do [empty_pack: pack, shot_group: shot_group] end - describe "Index of ammo group" do + describe "Index of pack" do setup [:register_and_log_in_user, :create_pack] test "lists all packs", %{conn: conn, pack: pack} do @@ -213,7 +213,7 @@ defmodule CanneryWeb.PackLiveTest do {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index)) assert index_live - |> element(~s/a[aria-label="Edit ammo group of #{pack.count} bullets"]/) + |> element(~s/a[aria-label="Edit pack of #{pack.count} bullets"]/) |> render_click() =~ "Edit ammo" assert_patch(index_live, Routes.pack_index_path(conn, :edit, pack)) @@ -237,7 +237,7 @@ defmodule CanneryWeb.PackLiveTest do html = index_live - |> element(~s/a[aria-label="Clone ammo group of #{pack.count} bullets"]/) + |> element(~s/a[aria-label="Clone pack of #{pack.count} bullets"]/) |> render_click() assert html =~ "Add Ammo" @@ -261,7 +261,7 @@ defmodule CanneryWeb.PackLiveTest do html = index_live - |> element(~s/a[aria-label="Clone ammo group of #{pack.count} bullets"]/) + |> element(~s/a[aria-label="Clone pack of #{pack.count} bullets"]/) |> render_click() assert html =~ "Add Ammo" @@ -279,7 +279,7 @@ defmodule CanneryWeb.PackLiveTest do html = index_live - |> element(~s/a[aria-label="Clone ammo group of #{pack.count} bullets"]/) + |> element(~s/a[aria-label="Clone pack of #{pack.count} bullets"]/) |> render_click() assert html =~ "Add Ammo" @@ -305,7 +305,7 @@ defmodule CanneryWeb.PackLiveTest do {:ok, index_live, _html} = live(conn, Routes.pack_index_path(conn, :index)) assert index_live - |> element(~s/a[aria-label="Delete ammo group of #{pack.count} bullets"]/) + |> element(~s/a[aria-label="Delete pack of #{pack.count} bullets"]/) |> render_click() refute has_element?(index_live, "#pack-#{pack.id}") @@ -334,10 +334,10 @@ defmodule CanneryWeb.PackLiveTest do defp display_currency(float), do: :erlang.float_to_binary(float, decimals: 2) end - describe "Index of empty ammo group" do + describe "Index of empty pack" do setup [:register_and_log_in_user, :create_pack, :create_empty_pack] - test "hides empty ammo groups by default", %{ + test "hides empty packs by default", %{ conn: conn, empty_pack: pack, current_user: current_user @@ -361,7 +361,7 @@ defmodule CanneryWeb.PackLiveTest do end end - describe "Show ammo group" do + describe "Show pack" do setup [:register_and_log_in_user, :create_pack] test "displays pack", %{conn: conn, pack: pack} do @@ -375,7 +375,7 @@ defmodule CanneryWeb.PackLiveTest do {:ok, show_live, _html} = live(conn, Routes.pack_show_path(conn, :show, pack)) assert show_live - |> element(~s/a[aria-label="Edit ammo group of #{pack.count} bullets"]/) + |> element(~s/a[aria-label="Edit pack of #{pack.count} bullets"]/) |> render_click() =~ "Edit Ammo" assert_patch(show_live, Routes.pack_show_path(conn, :edit, pack)) @@ -414,7 +414,7 @@ defmodule CanneryWeb.PackLiveTest do end end - describe "Show ammo group with shot group" do + describe "Show pack with shot group" do setup [:register_and_log_in_user, :create_pack, :create_shot_group] test "updates shot_group in listing", diff --git a/test/support/fixtures.ex b/test/support/fixtures.ex index 35332d3e..cde2d7ff 100644 --- a/test/support/fixtures.ex +++ b/test/support/fixtures.ex @@ -10,8 +10,8 @@ defmodule Cannery.Fixtures do Accounts.User, ActivityLog.ShotGroup, Ammo, - Ammo.Pack, Ammo.AmmoType, + Ammo.Pack, Containers, Containers.Container, Containers.Tag,