<.link
- navigate={Routes.ammo_type_show_path(Endpoint, :show, @pack.ammo_type)}
+ navigate={Routes.type_show_path(Endpoint, :show, @pack.type)}
class="mx-4 my-2 btn btn-primary"
>
<%= dgettext("actions", "View in Catalog") %>
diff --git a/lib/cannery_web/live/range_live/index.ex b/lib/cannery_web/live/range_live/index.ex
index 893ca3e..3ea192e 100644
--- a/lib/cannery_web/live/range_live/index.ex
+++ b/lib/cannery_web/live/range_live/index.ex
@@ -101,19 +101,19 @@ defmodule CanneryWeb.RangeLive.Index do
{:noreply, socket |> push_patch(to: Routes.range_index_path(Endpoint, :search, search_term))}
end
- def handle_event("change_class", %{"ammo_type" => %{"class" => "rifle"}}, socket) do
+ def handle_event("change_class", %{"type" => %{"class" => "rifle"}}, socket) do
{:noreply, socket |> assign(:class, :rifle) |> display_shot_records()}
end
- def handle_event("change_class", %{"ammo_type" => %{"class" => "shotgun"}}, socket) do
+ def handle_event("change_class", %{"type" => %{"class" => "shotgun"}}, socket) do
{:noreply, socket |> assign(:class, :shotgun) |> display_shot_records()}
end
- def handle_event("change_class", %{"ammo_type" => %{"class" => "pistol"}}, socket) do
+ def handle_event("change_class", %{"type" => %{"class" => "pistol"}}, socket) do
{:noreply, socket |> assign(:class, :pistol) |> display_shot_records()}
end
- def handle_event("change_class", %{"ammo_type" => %{"class" => _all}}, socket) do
+ def handle_event("change_class", %{"type" => %{"class" => _all}}, socket) do
{:noreply, socket |> assign(:class, :all) |> display_shot_records()}
end
diff --git a/lib/cannery_web/live/range_live/index.html.heex b/lib/cannery_web/live/range_live/index.html.heex
index 5861bd0..a50a7c5 100644
--- a/lib/cannery_web/live/range_live/index.html.heex
+++ b/lib/cannery_web/live/range_live/index.html.heex
@@ -78,7 +78,7 @@
<.form
:let={f}
for={%{}}
- as={:ammo_type}
+ as={:type}
phx-change="change_class"
phx-submit="change_class"
class="flex items-center"
diff --git a/lib/cannery_web/router.ex b/lib/cannery_web/router.ex
index 1026d4f..d4c5eea 100644
--- a/lib/cannery_web/router.ex
+++ b/lib/cannery_web/router.ex
@@ -69,14 +69,14 @@ defmodule CanneryWeb.Router do
live "/tags/edit/:id", TagLive.Index, :edit
live "/tags/search/:search", TagLive.Index, :search
- live "/catalog", AmmoTypeLive.Index, :index
- live "/catalog/new", AmmoTypeLive.Index, :new
- live "/catalog/clone/:id", AmmoTypeLive.Index, :clone
- live "/catalog/edit/:id", AmmoTypeLive.Index, :edit
- live "/catalog/search/:search", AmmoTypeLive.Index, :search
+ live "/catalog", TypeLive.Index, :index
+ live "/catalog/new", TypeLive.Index, :new
+ live "/catalog/clone/:id", TypeLive.Index, :clone
+ live "/catalog/edit/:id", TypeLive.Index, :edit
+ live "/catalog/search/:search", TypeLive.Index, :search
- live "/type/:id", AmmoTypeLive.Show, :show
- live "/type/:id/edit", AmmoTypeLive.Show, :edit
+ live "/type/:id", TypeLive.Show, :show
+ live "/type/:id/edit", TypeLive.Show, :edit
live "/containers", ContainerLive.Index, :index
live "/containers/new", ContainerLive.Index, :new
diff --git a/priv/gettext/actions.pot b/priv/gettext/actions.pot
index 00bc32a..6c5ad2a 100644
--- a/priv/gettext/actions.pot
+++ b/priv/gettext/actions.pot
@@ -82,11 +82,6 @@ msgstr ""
msgid "Make your first tag!"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "New Container"
@@ -203,11 +198,6 @@ msgstr ""
msgid "View in Catalog"
msgstr ""
-#: lib/cannery_web/live/pack_live/index.html.heex:24
-#, elixir-autogen, elixir-format
-msgid "add an ammo type first"
-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:89
@@ -237,11 +227,6 @@ msgstr ""
msgid "Export Data as JSON"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:110
-#, elixir-autogen, elixir-format
-msgid "Clone %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:87
#: lib/cannery_web/live/container_live/index.html.heex:145
#, elixir-autogen, elixir-format
@@ -253,12 +238,6 @@ msgstr ""
msgid "Copy invite link for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:129
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:36
-#, elixir-autogen, elixir-format
-msgid "Delete %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:104
#: lib/cannery_web/live/container_live/index.html.heex:162
#: lib/cannery_web/live/container_live/show.html.heex:48
@@ -276,12 +255,6 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:100
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:77
#: lib/cannery_web/live/container_live/index.html.heex:135
#: lib/cannery_web/live/container_live/show.html.heex:35
@@ -315,11 +288,6 @@ msgstr ""
msgid "Unstage"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:90
-#, elixir-autogen, elixir-format
-msgid "View %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/pack_live/index.html.heex:174
#, elixir-autogen, elixir-format
msgid "Clone pack of %{pack_count} bullets"
@@ -337,7 +305,7 @@ msgstr ""
msgid "Edit pack of %{pack_count} bullets"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:204
#: lib/cannery_web/live/pack_live/index.html.heex:154
#, elixir-autogen, elixir-format
msgid "View pack of %{pack_count} bullets"
@@ -354,3 +322,35 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Edit shot record of %{shot_record_count} shots"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:105
+#, elixir-autogen, elixir-format
+msgid "Clone %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:35
+#, elixir-autogen, elixir-format
+msgid "Delete %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:97
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
+#, elixir-autogen, elixir-format
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
+#, elixir-autogen, elixir-format
+msgid "New Type"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:89
+#, elixir-autogen, elixir-format
+msgid "View %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/pack_live/index.html.heex:24
+#, elixir-autogen, elixir-format
+msgid "add a type first"
+msgstr ""
diff --git a/priv/gettext/de/LC_MESSAGES/actions.po b/priv/gettext/de/LC_MESSAGES/actions.po
index f3036d9..50ab95d 100644
--- a/priv/gettext/de/LC_MESSAGES/actions.po
+++ b/priv/gettext/de/LC_MESSAGES/actions.po
@@ -95,11 +95,6 @@ msgstr "Einloggen"
msgid "Make your first tag!"
msgstr "Erstellen Sie ihren ersten Tag!"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr "Neue Munitionsart"
-
#: lib/cannery_web/live/container_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "New Container"
@@ -216,11 +211,6 @@ msgstr "Sprache wechseln"
msgid "View in Catalog"
msgstr ""
-#: lib/cannery_web/live/pack_live/index.html.heex:24
-#, elixir-autogen, elixir-format
-msgid "add an ammo type first"
-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:89
@@ -250,11 +240,6 @@ msgstr ""
msgid "Export Data as JSON"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:110
-#, elixir-autogen, elixir-format
-msgid "Clone %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:87
#: lib/cannery_web/live/container_live/index.html.heex:145
#, elixir-autogen, elixir-format
@@ -266,12 +251,6 @@ msgstr ""
msgid "Copy invite link for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:129
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:36
-#, elixir-autogen, elixir-format
-msgid "Delete %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:104
#: lib/cannery_web/live/container_live/index.html.heex:162
#: lib/cannery_web/live/container_live/show.html.heex:48
@@ -289,12 +268,6 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:100
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:77
#: lib/cannery_web/live/container_live/index.html.heex:135
#: lib/cannery_web/live/container_live/show.html.heex:35
@@ -328,11 +301,6 @@ msgstr ""
msgid "Unstage"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:90
-#, elixir-autogen, elixir-format
-msgid "View %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/pack_live/index.html.heex:174
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone pack of %{pack_count} bullets"
@@ -350,7 +318,7 @@ msgstr ""
msgid "Edit pack of %{pack_count} bullets"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:204
#: lib/cannery_web/live/pack_live/index.html.heex:154
#, elixir-autogen, elixir-format, fuzzy
msgid "View pack of %{pack_count} bullets"
@@ -367,3 +335,35 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit shot record of %{shot_record_count} shots"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:105
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Clone %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:35
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Delete %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:97
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr "Neue Munitionsart"
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:89
+#, elixir-autogen, elixir-format, fuzzy
+msgid "View %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/pack_live/index.html.heex:24
+#, elixir-autogen, elixir-format, fuzzy
+msgid "add a type first"
+msgstr ""
diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po
index e5d0807..175aa74 100644
--- a/priv/gettext/de/LC_MESSAGES/default.po
+++ b/priv/gettext/de/LC_MESSAGES/default.po
@@ -38,12 +38,6 @@ msgstr "Admins:"
msgid "Ammo"
msgstr "Munition"
-#: lib/cannery_web/components/pack_table_component.ex:95
-#: lib/cannery_web/live/pack_live/form_component.html.heex:22
-#, elixir-autogen, elixir-format
-msgid "Ammo type"
-msgstr "Munitionsarten"
-
#: lib/cannery_web/live/tag_live/form_component.html.heex:25
#, elixir-autogen, elixir-format
msgid "Background color"
@@ -240,12 +234,6 @@ msgstr "Meine coole Munitionskiste"
msgid "Name"
msgstr "Name"
-#: lib/cannery_web/live/ammo_type_live/index.ex:36
-#: lib/cannery_web/live/ammo_type_live/index.ex:44
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr "Neuer Munitionstyp"
-
#: lib/cannery_web/live/container_live/index.ex:32
#: lib/cannery_web/live/container_live/index.ex:39
#, elixir-autogen, elixir-format
@@ -267,7 +255,7 @@ msgstr "Neuer Tag"
msgid "No Ammo"
msgstr "Keine Munition"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:180
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "No ammo for this type"
msgstr "Keine Munition dieser Art"
@@ -403,7 +391,9 @@ msgstr "Leuchtspur"
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_pack_component.ex:66
+#: lib/cannery_web/components/pack_table_component.ex:95
#: lib/cannery_web/live/container_live/form_component.html.heex:39
+#: lib/cannery_web/live/pack_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Type"
msgstr "Art"
@@ -513,7 +503,7 @@ msgstr "Schießkladde"
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:163
#: lib/cannery_web/components/pack_table_component.ex:246
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:150
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#, elixir-autogen, elixir-format
@@ -596,7 +586,7 @@ msgid "Edit %{name} tags"
msgstr "Editiere %{name} Tags"
#: lib/cannery_web/components/core_components/container_card.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:87
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
#: lib/cannery_web/live/container_live/show.html.heex:27
#, elixir-autogen, elixir-format
msgid "Rounds:"
@@ -605,7 +595,7 @@ msgstr "Patronen:"
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:160
#: lib/cannery_web/components/pack_table_component.ex:242
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr "Keine Preisinformationen"
@@ -676,7 +666,7 @@ msgstr "Schüsse dokumentieren"
msgid "Copies"
msgstr "Kopien"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:139
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:137
#, elixir-autogen, elixir-format
msgid "Added on:"
msgstr "Hinzugefügt am:"
@@ -756,7 +746,7 @@ msgid "This ammo is not in a container"
msgstr "Diese Munitionsgruppe ist nicht in einem Behälter"
#: lib/cannery_web/components/core_components/container_card.html.heex:32
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:111
#: lib/cannery_web/live/container_live/show.html.heex:22
#, elixir-autogen, elixir-format
msgid "Packs:"
@@ -784,7 +774,7 @@ msgid "Container:"
msgstr "Behälter"
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:164
#: lib/cannery_web/live/pack_live/index.html.heex:87
#, elixir-autogen, elixir-format
msgid "Show used"
@@ -813,7 +803,7 @@ msgstr ""
msgid "Rounds"
msgstr "Patronen:"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:172
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:170
#: lib/cannery_web/live/container_live/index.html.heex:40
#: lib/cannery_web/live/container_live/show.html.heex:115
#, elixir-autogen, elixir-format
@@ -825,7 +815,7 @@ msgstr ""
msgid "Total ever packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:130
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:128
#, elixir-autogen, elixir-format
msgid "Total ever packs:"
msgstr ""
@@ -835,7 +825,7 @@ msgstr ""
msgid "Total ever rounds"
msgstr "Summe aller Patronen"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:104
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:102
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds:"
msgstr "Summe abgegebener Schüsse:"
@@ -845,7 +835,7 @@ msgstr "Summe abgegebener Schüsse:"
msgid "Used packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:120
#, elixir-autogen, elixir-format
msgid "Used packs:"
msgstr ""
@@ -855,7 +845,7 @@ msgstr ""
msgid "Used rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:94
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds:"
msgstr ""
@@ -961,17 +951,11 @@ msgid "UPC:"
msgstr "UPC"
#: lib/cannery_web/components/ammo_type_table_component.ex:102
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:148
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:146
#, elixir-autogen, elixir-format
msgid "Average CPR"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:28
-#: lib/cannery_web/live/ammo_type_live/show.ex:82
-#, elixir-autogen, elixir-format, fuzzy
-msgid "Edit %{ammo_type_name}"
-msgstr "%{name} bearbeiten"
-
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:250
#, elixir-autogen, elixir-format
@@ -1035,12 +1019,6 @@ msgstr ""
msgid "Edit ammo"
msgstr "Munitionstyp bearbeiten"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
-#, elixir-autogen, elixir-format, fuzzy
-msgid "No Ammo types"
-msgstr "Keine Munitionsarten"
-
#: lib/cannery_web/live/ammo_type_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "Search catalog"
@@ -1311,14 +1289,14 @@ msgstr ""
msgid "No ammo"
msgstr "Keine Munition"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:60
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
#, elixir-autogen, elixir-format
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
#: lib/cannery_web/live/container_live/show.html.heex:106
#: lib/cannery_web/live/pack_live/index.html.heex:61
#: lib/cannery_web/live/range_live/index.html.heex:95
@@ -1343,7 +1321,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
#: lib/cannery_web/live/container_live/show.html.heex:104
#: lib/cannery_web/live/pack_live/index.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:93
@@ -1397,7 +1375,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:52
#: lib/cannery_web/live/container_live/show.html.heex:105
#: lib/cannery_web/live/pack_live/index.html.heex:60
#: lib/cannery_web/live/range_live/index.html.heex:94
@@ -1441,7 +1419,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/pack_live/index.html.heex:50
#: lib/cannery_web/live/range_live/index.html.heex:86
@@ -1465,3 +1443,21 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit Shot Record"
msgstr "Schießkladde editieren"
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:28
+#: lib/cannery_web/live/ammo_type_live/show.ex:82
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr "%{name} bearbeiten"
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:36
+#: lib/cannery_web/live/ammo_type_live/index.ex:44
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr "Neuer Munitionstyp"
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
+#, elixir-autogen, elixir-format, fuzzy
+msgid "No Types"
+msgstr "Art"
diff --git a/priv/gettext/de/LC_MESSAGES/errors.po b/priv/gettext/de/LC_MESSAGES/errors.po
index b8988b2..d2c528f 100644
--- a/priv/gettext/de/LC_MESSAGES/errors.po
+++ b/priv/gettext/de/LC_MESSAGES/errors.po
@@ -173,16 +173,11 @@ msgstr ""
"Ungültige Nummer an Kopien. Muss zwischen 1 and %{max} liegen. War "
"%{multiplier}"
-#: lib/cannery/ammo.ex:1123
+#: lib/cannery/ammo.ex:1121
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""
-#: lib/cannery/ammo/pack.ex:92
-#, elixir-autogen, elixir-format
-msgid "Please select an ammo type and container"
-msgstr ""
-
#: lib/cannery_web/live/range_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "Your browser does not support the canvas element."
@@ -212,3 +207,8 @@ msgstr "Anzahl muss weniger als %{count} betragen"
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
+
+#: lib/cannery/ammo/pack.ex:92
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Please select a type and container"
+msgstr ""
diff --git a/priv/gettext/de/LC_MESSAGES/prompts.po b/priv/gettext/de/LC_MESSAGES/prompts.po
index e7e18d5..f3c5804 100644
--- a/priv/gettext/de/LC_MESSAGES/prompts.po
+++ b/priv/gettext/de/LC_MESSAGES/prompts.po
@@ -23,7 +23,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:89
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:88
#: lib/cannery_web/live/container_live/form_component.ex:89
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:78
@@ -44,7 +44,7 @@ msgstr "%{name} erfolgreich gelöscht"
msgid "%{name} has been deleted"
msgstr "%{name} wurde gelöscht"
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:70
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:69
#: lib/cannery_web/live/container_live/form_component.ex:70
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:60
@@ -257,7 +257,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] "Munitionsgruppe erfolgreich aktualisiert"
msgstr[1] "Munitionsgruppe erfolgreich aktualisiert"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:116
#: lib/cannery_web/live/ammo_type_live/show.html.heex:29
#, elixir-autogen, elixir-format, fuzzy
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot
index 4759334..698acd4 100644
--- a/priv/gettext/default.pot
+++ b/priv/gettext/default.pot
@@ -34,12 +34,6 @@ msgstr ""
msgid "Ammo"
msgstr ""
-#: lib/cannery_web/components/pack_table_component.ex:95
-#: lib/cannery_web/live/pack_live/form_component.html.heex:22
-#, elixir-autogen, elixir-format
-msgid "Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/tag_live/form_component.html.heex:25
#, elixir-autogen, elixir-format
msgid "Background color"
@@ -236,12 +230,6 @@ msgstr ""
msgid "Name"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:36
-#: lib/cannery_web/live/ammo_type_live/index.ex:44
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.ex:32
#: lib/cannery_web/live/container_live/index.ex:39
#, elixir-autogen, elixir-format
@@ -263,7 +251,7 @@ msgstr ""
msgid "No Ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:180
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "No ammo for this type"
msgstr ""
@@ -397,7 +385,9 @@ msgstr ""
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_pack_component.ex:66
+#: lib/cannery_web/components/pack_table_component.ex:95
#: lib/cannery_web/live/container_live/form_component.html.heex:39
+#: lib/cannery_web/live/pack_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Type"
msgstr ""
@@ -507,7 +497,7 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:163
#: lib/cannery_web/components/pack_table_component.ex:246
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:150
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#, elixir-autogen, elixir-format
@@ -590,7 +580,7 @@ msgid "Edit %{name} tags"
msgstr ""
#: lib/cannery_web/components/core_components/container_card.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:87
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
#: lib/cannery_web/live/container_live/show.html.heex:27
#, elixir-autogen, elixir-format
msgid "Rounds:"
@@ -599,7 +589,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:160
#: lib/cannery_web/components/pack_table_component.ex:242
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr ""
@@ -670,7 +660,7 @@ msgstr ""
msgid "Copies"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:139
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:137
#, elixir-autogen, elixir-format
msgid "Added on:"
msgstr ""
@@ -750,7 +740,7 @@ msgid "This ammo is not in a container"
msgstr ""
#: lib/cannery_web/components/core_components/container_card.html.heex:32
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:111
#: lib/cannery_web/live/container_live/show.html.heex:22
#, elixir-autogen, elixir-format
msgid "Packs:"
@@ -778,7 +768,7 @@ msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:164
#: lib/cannery_web/live/pack_live/index.html.heex:87
#, elixir-autogen, elixir-format
msgid "Show used"
@@ -807,7 +797,7 @@ msgstr ""
msgid "Rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:172
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:170
#: lib/cannery_web/live/container_live/index.html.heex:40
#: lib/cannery_web/live/container_live/show.html.heex:115
#, elixir-autogen, elixir-format
@@ -819,7 +809,7 @@ msgstr ""
msgid "Total ever packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:130
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:128
#, elixir-autogen, elixir-format
msgid "Total ever packs:"
msgstr ""
@@ -829,7 +819,7 @@ msgstr ""
msgid "Total ever rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:104
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:102
#, elixir-autogen, elixir-format
msgid "Total ever rounds:"
msgstr ""
@@ -839,7 +829,7 @@ msgstr ""
msgid "Used packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:120
#, elixir-autogen, elixir-format
msgid "Used packs:"
msgstr ""
@@ -849,7 +839,7 @@ msgstr ""
msgid "Used rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:94
#, elixir-autogen, elixir-format
msgid "Used rounds:"
msgstr ""
@@ -955,17 +945,11 @@ msgid "UPC:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:102
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:148
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:146
#, elixir-autogen, elixir-format
msgid "Average CPR"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:28
-#: lib/cannery_web/live/ammo_type_live/show.ex:82
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:250
#, elixir-autogen, elixir-format
@@ -1029,12 +1013,6 @@ msgstr ""
msgid "Edit ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
-#, elixir-autogen, elixir-format
-msgid "No Ammo types"
-msgstr ""
-
#: lib/cannery_web/live/ammo_type_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "Search catalog"
@@ -1294,14 +1272,14 @@ msgstr ""
msgid "No ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:60
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
#, elixir-autogen, elixir-format
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
#: lib/cannery_web/live/container_live/show.html.heex:106
#: lib/cannery_web/live/pack_live/index.html.heex:61
#: lib/cannery_web/live/range_live/index.html.heex:95
@@ -1326,7 +1304,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
#: lib/cannery_web/live/container_live/show.html.heex:104
#: lib/cannery_web/live/pack_live/index.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:93
@@ -1380,7 +1358,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:52
#: lib/cannery_web/live/container_live/show.html.heex:105
#: lib/cannery_web/live/pack_live/index.html.heex:60
#: lib/cannery_web/live/range_live/index.html.heex:94
@@ -1424,7 +1402,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/pack_live/index.html.heex:50
#: lib/cannery_web/live/range_live/index.html.heex:86
@@ -1448,3 +1426,21 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Edit Shot Record"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:28
+#: lib/cannery_web/live/ammo_type_live/show.ex:82
+#, elixir-autogen, elixir-format
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:36
+#: lib/cannery_web/live/ammo_type_live/index.ex:44
+#, elixir-autogen, elixir-format
+msgid "New Type"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
+#, elixir-autogen, elixir-format
+msgid "No Types"
+msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/actions.po b/priv/gettext/en/LC_MESSAGES/actions.po
index ba53eca..91f6349 100644
--- a/priv/gettext/en/LC_MESSAGES/actions.po
+++ b/priv/gettext/en/LC_MESSAGES/actions.po
@@ -82,11 +82,6 @@ msgstr ""
msgid "Make your first tag!"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "New Container"
@@ -203,11 +198,6 @@ msgstr ""
msgid "View in Catalog"
msgstr ""
-#: lib/cannery_web/live/pack_live/index.html.heex:24
-#, elixir-autogen, elixir-format
-msgid "add an ammo type first"
-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:89
@@ -237,11 +227,6 @@ msgstr ""
msgid "Export Data as JSON"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:110
-#, elixir-autogen, elixir-format
-msgid "Clone %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:87
#: lib/cannery_web/live/container_live/index.html.heex:145
#, elixir-autogen, elixir-format
@@ -253,12 +238,6 @@ msgstr ""
msgid "Copy invite link for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:129
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:36
-#, elixir-autogen, elixir-format
-msgid "Delete %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:104
#: lib/cannery_web/live/container_live/index.html.heex:162
#: lib/cannery_web/live/container_live/show.html.heex:48
@@ -276,12 +255,6 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:100
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:77
#: lib/cannery_web/live/container_live/index.html.heex:135
#: lib/cannery_web/live/container_live/show.html.heex:35
@@ -315,11 +288,6 @@ msgstr ""
msgid "Unstage"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:90
-#, elixir-autogen, elixir-format
-msgid "View %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/pack_live/index.html.heex:174
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone pack of %{pack_count} bullets"
@@ -337,7 +305,7 @@ msgstr ""
msgid "Edit pack of %{pack_count} bullets"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:204
#: lib/cannery_web/live/pack_live/index.html.heex:154
#, elixir-autogen, elixir-format, fuzzy
msgid "View pack of %{pack_count} bullets"
@@ -354,3 +322,35 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit shot record of %{shot_record_count} shots"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:105
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Clone %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:35
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Delete %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:97
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:89
+#, elixir-autogen, elixir-format, fuzzy
+msgid "View %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/pack_live/index.html.heex:24
+#, elixir-autogen, elixir-format, fuzzy
+msgid "add a type first"
+msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po
index ca02471..f15af25 100644
--- a/priv/gettext/en/LC_MESSAGES/default.po
+++ b/priv/gettext/en/LC_MESSAGES/default.po
@@ -34,12 +34,6 @@ msgstr ""
msgid "Ammo"
msgstr ""
-#: lib/cannery_web/components/pack_table_component.ex:95
-#: lib/cannery_web/live/pack_live/form_component.html.heex:22
-#, elixir-autogen, elixir-format
-msgid "Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/tag_live/form_component.html.heex:25
#, elixir-autogen, elixir-format
msgid "Background color"
@@ -236,12 +230,6 @@ msgstr ""
msgid "Name"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:36
-#: lib/cannery_web/live/ammo_type_live/index.ex:44
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.ex:32
#: lib/cannery_web/live/container_live/index.ex:39
#, elixir-autogen, elixir-format
@@ -263,7 +251,7 @@ msgstr ""
msgid "No Ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:180
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "No ammo for this type"
msgstr ""
@@ -397,7 +385,9 @@ msgstr ""
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_pack_component.ex:66
+#: lib/cannery_web/components/pack_table_component.ex:95
#: lib/cannery_web/live/container_live/form_component.html.heex:39
+#: lib/cannery_web/live/pack_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Type"
msgstr ""
@@ -507,7 +497,7 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:163
#: lib/cannery_web/components/pack_table_component.ex:246
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:150
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#, elixir-autogen, elixir-format
@@ -590,7 +580,7 @@ msgid "Edit %{name} tags"
msgstr ""
#: lib/cannery_web/components/core_components/container_card.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:87
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
#: lib/cannery_web/live/container_live/show.html.heex:27
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds:"
@@ -599,7 +589,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:160
#: lib/cannery_web/components/pack_table_component.ex:242
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr ""
@@ -670,7 +660,7 @@ msgstr ""
msgid "Copies"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:139
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:137
#, elixir-autogen, elixir-format
msgid "Added on:"
msgstr ""
@@ -750,7 +740,7 @@ msgid "This ammo is not in a container"
msgstr ""
#: lib/cannery_web/components/core_components/container_card.html.heex:32
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:111
#: lib/cannery_web/live/container_live/show.html.heex:22
#, elixir-autogen, elixir-format
msgid "Packs:"
@@ -778,7 +768,7 @@ msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:164
#: lib/cannery_web/live/pack_live/index.html.heex:87
#, elixir-autogen, elixir-format
msgid "Show used"
@@ -807,7 +797,7 @@ msgstr ""
msgid "Rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:172
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:170
#: lib/cannery_web/live/container_live/index.html.heex:40
#: lib/cannery_web/live/container_live/show.html.heex:115
#, elixir-autogen, elixir-format
@@ -819,7 +809,7 @@ msgstr ""
msgid "Total ever packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:130
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:128
#, elixir-autogen, elixir-format
msgid "Total ever packs:"
msgstr ""
@@ -829,7 +819,7 @@ msgstr ""
msgid "Total ever rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:104
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:102
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds:"
msgstr ""
@@ -839,7 +829,7 @@ msgstr ""
msgid "Used packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:120
#, elixir-autogen, elixir-format
msgid "Used packs:"
msgstr ""
@@ -849,7 +839,7 @@ msgstr ""
msgid "Used rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:94
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds:"
msgstr ""
@@ -955,17 +945,11 @@ msgid "UPC:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:102
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:148
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:146
#, elixir-autogen, elixir-format
msgid "Average CPR"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:28
-#: lib/cannery_web/live/ammo_type_live/show.ex:82
-#, elixir-autogen, elixir-format, fuzzy
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:250
#, elixir-autogen, elixir-format
@@ -1029,12 +1013,6 @@ msgstr ""
msgid "Edit ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
-#, elixir-autogen, elixir-format, fuzzy
-msgid "No Ammo types"
-msgstr ""
-
#: lib/cannery_web/live/ammo_type_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "Search catalog"
@@ -1294,14 +1272,14 @@ msgstr ""
msgid "No ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:60
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
#, elixir-autogen, elixir-format
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
#: lib/cannery_web/live/container_live/show.html.heex:106
#: lib/cannery_web/live/pack_live/index.html.heex:61
#: lib/cannery_web/live/range_live/index.html.heex:95
@@ -1326,7 +1304,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
#: lib/cannery_web/live/container_live/show.html.heex:104
#: lib/cannery_web/live/pack_live/index.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:93
@@ -1380,7 +1358,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:52
#: lib/cannery_web/live/container_live/show.html.heex:105
#: lib/cannery_web/live/pack_live/index.html.heex:60
#: lib/cannery_web/live/range_live/index.html.heex:94
@@ -1424,7 +1402,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/pack_live/index.html.heex:50
#: lib/cannery_web/live/range_live/index.html.heex:86
@@ -1448,3 +1426,21 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit Shot Record"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:28
+#: lib/cannery_web/live/ammo_type_live/show.ex:82
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:36
+#: lib/cannery_web/live/ammo_type_live/index.ex:44
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
+#, elixir-autogen, elixir-format, fuzzy
+msgid "No Types"
+msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/errors.po b/priv/gettext/en/LC_MESSAGES/errors.po
index 92c9ca6..d8fda25 100644
--- a/priv/gettext/en/LC_MESSAGES/errors.po
+++ b/priv/gettext/en/LC_MESSAGES/errors.po
@@ -156,16 +156,11 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
-#: lib/cannery/ammo.ex:1123
+#: lib/cannery/ammo.ex:1121
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""
-#: lib/cannery/ammo/pack.ex:92
-#, elixir-autogen, elixir-format
-msgid "Please select an ammo type and container"
-msgstr ""
-
#: lib/cannery_web/live/range_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "Your browser does not support the canvas element."
@@ -195,3 +190,8 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
+
+#: lib/cannery/ammo/pack.ex:92
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Please select a type and container"
+msgstr ""
diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po
index d248f78..fdcc90c 100644
--- a/priv/gettext/en/LC_MESSAGES/prompts.po
+++ b/priv/gettext/en/LC_MESSAGES/prompts.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Language: en\n"
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:89
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:88
#: lib/cannery_web/live/container_live/form_component.ex:89
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:78
@@ -31,7 +31,7 @@ msgstr ""
msgid "%{name} has been deleted"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:70
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:69
#: lib/cannery_web/live/container_live/form_component.ex:70
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:60
@@ -236,7 +236,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:116
#: lib/cannery_web/live/ammo_type_live/show.html.heex:29
#, elixir-autogen, elixir-format, fuzzy
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
diff --git a/priv/gettext/errors.pot b/priv/gettext/errors.pot
index c43f330..68649bf 100644
--- a/priv/gettext/errors.pot
+++ b/priv/gettext/errors.pot
@@ -155,16 +155,11 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
-#: lib/cannery/ammo.ex:1123
+#: lib/cannery/ammo.ex:1121
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""
-#: lib/cannery/ammo/pack.ex:92
-#, elixir-autogen, elixir-format
-msgid "Please select an ammo type and container"
-msgstr ""
-
#: lib/cannery_web/live/range_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "Your browser does not support the canvas element."
@@ -194,3 +189,8 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
+
+#: lib/cannery/ammo/pack.ex:92
+#, elixir-autogen, elixir-format
+msgid "Please select a type and container"
+msgstr ""
diff --git a/priv/gettext/es/LC_MESSAGES/actions.po b/priv/gettext/es/LC_MESSAGES/actions.po
index 1e0eb34..b7ad8d4 100644
--- a/priv/gettext/es/LC_MESSAGES/actions.po
+++ b/priv/gettext/es/LC_MESSAGES/actions.po
@@ -95,11 +95,6 @@ msgstr "Entrar"
msgid "Make your first tag!"
msgstr "¡Aplica tu primera etiqueta!"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr "Nuevo tipo de Munición"
-
#: lib/cannery_web/live/container_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "New Container"
@@ -216,11 +211,6 @@ msgstr "Cambiar lenguaje"
msgid "View in Catalog"
msgstr "Ver en Catalogo"
-#: lib/cannery_web/live/pack_live/index.html.heex:24
-#, elixir-autogen, elixir-format
-msgid "add an ammo type first"
-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:89
@@ -250,11 +240,6 @@ msgstr "Desmontar del campo de tiro"
msgid "Export Data as JSON"
msgstr "Exportar datos como JSON"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:110
-#, elixir-autogen, elixir-format
-msgid "Clone %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:87
#: lib/cannery_web/live/container_live/index.html.heex:145
#, elixir-autogen, elixir-format
@@ -266,12 +251,6 @@ msgstr ""
msgid "Copy invite link for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:129
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:36
-#, elixir-autogen, elixir-format
-msgid "Delete %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:104
#: lib/cannery_web/live/container_live/index.html.heex:162
#: lib/cannery_web/live/container_live/show.html.heex:48
@@ -289,12 +268,6 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:100
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:77
#: lib/cannery_web/live/container_live/index.html.heex:135
#: lib/cannery_web/live/container_live/show.html.heex:35
@@ -328,11 +301,6 @@ msgstr ""
msgid "Unstage"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:90
-#, elixir-autogen, elixir-format
-msgid "View %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/pack_live/index.html.heex:174
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone pack of %{pack_count} bullets"
@@ -350,7 +318,7 @@ msgstr ""
msgid "Edit pack of %{pack_count} bullets"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:204
#: lib/cannery_web/live/pack_live/index.html.heex:154
#, elixir-autogen, elixir-format, fuzzy
msgid "View pack of %{pack_count} bullets"
@@ -367,3 +335,35 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit shot record of %{shot_record_count} shots"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:105
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Clone %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:35
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Delete %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:97
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr "Nuevo tipo de Munición"
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:89
+#, elixir-autogen, elixir-format, fuzzy
+msgid "View %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/pack_live/index.html.heex:24
+#, elixir-autogen, elixir-format, fuzzy
+msgid "add a type first"
+msgstr "añade primero un tipo de munición"
diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po
index 71891e2..4989e88 100644
--- a/priv/gettext/es/LC_MESSAGES/default.po
+++ b/priv/gettext/es/LC_MESSAGES/default.po
@@ -38,12 +38,6 @@ msgstr "Aministradores:"
msgid "Ammo"
msgstr "Munición"
-#: lib/cannery_web/components/pack_table_component.ex:95
-#: lib/cannery_web/live/pack_live/form_component.html.heex:22
-#, elixir-autogen, elixir-format
-msgid "Ammo type"
-msgstr "Tipo de munición"
-
#: lib/cannery_web/live/tag_live/form_component.html.heex:25
#, elixir-autogen, elixir-format
msgid "Background color"
@@ -240,12 +234,6 @@ msgstr "Mi lata de munición guapa"
msgid "Name"
msgstr "Nombre"
-#: lib/cannery_web/live/ammo_type_live/index.ex:36
-#: lib/cannery_web/live/ammo_type_live/index.ex:44
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr "Nuevo tipo de Munición"
-
#: lib/cannery_web/live/container_live/index.ex:32
#: lib/cannery_web/live/container_live/index.ex:39
#, elixir-autogen, elixir-format
@@ -267,7 +255,7 @@ msgstr "Nueva Etiqueta"
msgid "No Ammo"
msgstr "Sin Munición"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:180
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "No ammo for this type"
msgstr "Sin munición para este tipo"
@@ -404,7 +392,9 @@ msgstr "Trazadora"
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_pack_component.ex:66
+#: lib/cannery_web/components/pack_table_component.ex:95
#: lib/cannery_web/live/container_live/form_component.html.heex:39
+#: lib/cannery_web/live/pack_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Type"
msgstr "Tipo"
@@ -514,7 +504,7 @@ msgstr "Registro de tiros"
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:163
#: lib/cannery_web/components/pack_table_component.ex:246
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:150
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#, elixir-autogen, elixir-format
@@ -597,7 +587,7 @@ msgid "Edit %{name} tags"
msgstr "Editar etiquetas de %{name}"
#: lib/cannery_web/components/core_components/container_card.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:87
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
#: lib/cannery_web/live/container_live/show.html.heex:27
#, elixir-autogen, elixir-format
msgid "Rounds:"
@@ -606,7 +596,7 @@ msgstr "Balas:"
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:160
#: lib/cannery_web/components/pack_table_component.ex:242
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr "No hay información de coste"
@@ -677,7 +667,7 @@ msgstr "Tiros Récord"
msgid "Copies"
msgstr "Copias"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:139
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:137
#, elixir-autogen, elixir-format
msgid "Added on:"
msgstr "Añadido en:"
@@ -757,7 +747,7 @@ msgid "This ammo is not in a container"
msgstr "Esta munición no está en un contenedor"
#: lib/cannery_web/components/core_components/container_card.html.heex:32
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:111
#: lib/cannery_web/live/container_live/show.html.heex:22
#, elixir-autogen, elixir-format
msgid "Packs:"
@@ -786,7 +776,7 @@ msgid "Container:"
msgstr "Contenedor:"
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:164
#: lib/cannery_web/live/pack_live/index.html.heex:87
#, elixir-autogen, elixir-format
msgid "Show used"
@@ -815,7 +805,7 @@ msgstr "Paquetes"
msgid "Rounds"
msgstr "Balas"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:172
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:170
#: lib/cannery_web/live/container_live/index.html.heex:40
#: lib/cannery_web/live/container_live/show.html.heex:115
#, elixir-autogen, elixir-format
@@ -827,7 +817,7 @@ msgstr "Ver como tabla"
msgid "Total ever packs"
msgstr "Paquetes totales"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:130
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:128
#, elixir-autogen, elixir-format
msgid "Total ever packs:"
msgstr "Paquetes totales:"
@@ -837,7 +827,7 @@ msgstr "Paquetes totales:"
msgid "Total ever rounds"
msgstr "Balas totales"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:104
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:102
#, elixir-autogen, elixir-format
msgid "Total ever rounds:"
msgstr "Balas totales:"
@@ -847,7 +837,7 @@ msgstr "Balas totales:"
msgid "Used packs"
msgstr "Paquetes usados"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:120
#, elixir-autogen, elixir-format
msgid "Used packs:"
msgstr "Paquetes usados:"
@@ -857,7 +847,7 @@ msgstr "Paquetes usados:"
msgid "Used rounds"
msgstr "Balas usadas"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:94
#, elixir-autogen, elixir-format
msgid "Used rounds:"
msgstr "Balas usadas:"
@@ -963,17 +953,11 @@ msgid "UPC:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:102
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:148
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:146
#, elixir-autogen, elixir-format
msgid "Average CPR"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:28
-#: lib/cannery_web/live/ammo_type_live/show.ex:82
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr "Editar %{ammo_type_name}"
-
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:250
#, elixir-autogen, elixir-format
@@ -1037,12 +1021,6 @@ msgstr "Comprada en:"
msgid "Edit ammo"
msgstr "Editar munición"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
-#, elixir-autogen, elixir-format, fuzzy
-msgid "No Ammo types"
-msgstr "Sin tipo de Munición"
-
#: lib/cannery_web/live/ammo_type_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "Search catalog"
@@ -1313,14 +1291,14 @@ msgstr ""
msgid "No ammo"
msgstr "Sin Munición"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:60
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
#, elixir-autogen, elixir-format
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
#: lib/cannery_web/live/container_live/show.html.heex:106
#: lib/cannery_web/live/pack_live/index.html.heex:61
#: lib/cannery_web/live/range_live/index.html.heex:95
@@ -1345,7 +1323,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
#: lib/cannery_web/live/container_live/show.html.heex:104
#: lib/cannery_web/live/pack_live/index.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:93
@@ -1399,7 +1377,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:52
#: lib/cannery_web/live/container_live/show.html.heex:105
#: lib/cannery_web/live/pack_live/index.html.heex:60
#: lib/cannery_web/live/range_live/index.html.heex:94
@@ -1443,7 +1421,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/pack_live/index.html.heex:50
#: lib/cannery_web/live/range_live/index.html.heex:86
@@ -1467,3 +1445,21 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit Shot Record"
msgstr "Editar Tiros Récord"
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:28
+#: lib/cannery_web/live/ammo_type_live/show.ex:82
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr "Editar %{ammo_type_name}"
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:36
+#: lib/cannery_web/live/ammo_type_live/index.ex:44
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr "Nuevo tipo de Munición"
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
+#, elixir-autogen, elixir-format, fuzzy
+msgid "No Types"
+msgstr "Tipo"
diff --git a/priv/gettext/es/LC_MESSAGES/errors.po b/priv/gettext/es/LC_MESSAGES/errors.po
index 7cf7d5c..bb122c6 100644
--- a/priv/gettext/es/LC_MESSAGES/errors.po
+++ b/priv/gettext/es/LC_MESSAGES/errors.po
@@ -171,16 +171,11 @@ msgstr "No se ha podido procesar el número de copias"
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "Número inválido de copias, debe ser entre 1 y %{max}. Fue %{multiplier"
-#: lib/cannery/ammo.ex:1123
+#: lib/cannery/ammo.ex:1121
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr "Multiplicador inválido"
-#: lib/cannery/ammo/pack.ex:92
-#, elixir-autogen, elixir-format
-msgid "Please select an ammo type and container"
-msgstr "Por favor escoja un tipo de munición y un contenedor"
-
#: lib/cannery_web/live/range_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "Your browser does not support the canvas element."
@@ -210,3 +205,8 @@ msgstr "El recuento debe ser menos de %{count}"
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
+
+#: lib/cannery/ammo/pack.ex:92
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Please select a type and container"
+msgstr "Por favor escoja un tipo de munición y un contenedor"
diff --git a/priv/gettext/es/LC_MESSAGES/prompts.po b/priv/gettext/es/LC_MESSAGES/prompts.po
index 31ba17b..e338620 100644
--- a/priv/gettext/es/LC_MESSAGES/prompts.po
+++ b/priv/gettext/es/LC_MESSAGES/prompts.po
@@ -23,7 +23,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:89
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:88
#: lib/cannery_web/live/container_live/form_component.ex:89
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:78
@@ -44,7 +44,7 @@ msgstr "%{name} borrado exitosamente"
msgid "%{name} has been deleted"
msgstr "%{name} ha sido borrado"
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:70
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:69
#: lib/cannery_web/live/container_live/form_component.ex:70
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:60
@@ -256,7 +256,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] "Munición añadida exitosamente"
msgstr[1] "Municiones añadidas exitosamente"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:116
#: lib/cannery_web/live/ammo_type_live/show.html.heex:29
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
diff --git a/priv/gettext/fr/LC_MESSAGES/actions.po b/priv/gettext/fr/LC_MESSAGES/actions.po
index 07a35d9..134a05d 100644
--- a/priv/gettext/fr/LC_MESSAGES/actions.po
+++ b/priv/gettext/fr/LC_MESSAGES/actions.po
@@ -95,11 +95,6 @@ msgstr "Se connecter"
msgid "Make your first tag!"
msgstr "Faîtes votre premier tag !"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr "Nouveau type de munition"
-
#: lib/cannery_web/live/container_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "New Container"
@@ -216,11 +211,6 @@ msgstr "Changer la langue"
msgid "View in Catalog"
msgstr "Voir en catalogue"
-#: lib/cannery_web/live/pack_live/index.html.heex:24
-#, elixir-autogen, elixir-format
-msgid "add an ammo type first"
-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:89
@@ -250,11 +240,6 @@ msgstr ""
msgid "Export Data as JSON"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:110
-#, elixir-autogen, elixir-format
-msgid "Clone %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:87
#: lib/cannery_web/live/container_live/index.html.heex:145
#, elixir-autogen, elixir-format
@@ -266,12 +251,6 @@ msgstr ""
msgid "Copy invite link for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:129
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:36
-#, elixir-autogen, elixir-format
-msgid "Delete %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:104
#: lib/cannery_web/live/container_live/index.html.heex:162
#: lib/cannery_web/live/container_live/show.html.heex:48
@@ -289,12 +268,6 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:100
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:77
#: lib/cannery_web/live/container_live/index.html.heex:135
#: lib/cannery_web/live/container_live/show.html.heex:35
@@ -328,11 +301,6 @@ msgstr ""
msgid "Unstage"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:90
-#, elixir-autogen, elixir-format
-msgid "View %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/pack_live/index.html.heex:174
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone pack of %{pack_count} bullets"
@@ -350,7 +318,7 @@ msgstr ""
msgid "Edit pack of %{pack_count} bullets"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:204
#: lib/cannery_web/live/pack_live/index.html.heex:154
#, elixir-autogen, elixir-format, fuzzy
msgid "View pack of %{pack_count} bullets"
@@ -367,3 +335,35 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit shot record of %{shot_record_count} shots"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:105
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Clone %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:35
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Delete %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:97
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr "Nouveau type de munition"
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:89
+#, elixir-autogen, elixir-format, fuzzy
+msgid "View %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/pack_live/index.html.heex:24
+#, elixir-autogen, elixir-format, fuzzy
+msgid "add a type first"
+msgstr "Ajoutez d'abord un type de munitions"
diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po
index b4d98a6..77b4bfe 100644
--- a/priv/gettext/fr/LC_MESSAGES/default.po
+++ b/priv/gettext/fr/LC_MESSAGES/default.po
@@ -38,12 +38,6 @@ msgstr "Administrateur·ices :"
msgid "Ammo"
msgstr "Munition"
-#: lib/cannery_web/components/pack_table_component.ex:95
-#: lib/cannery_web/live/pack_live/form_component.html.heex:22
-#, elixir-autogen, elixir-format
-msgid "Ammo type"
-msgstr "Type de munition"
-
#: lib/cannery_web/live/tag_live/form_component.html.heex:25
#, elixir-autogen, elixir-format
msgid "Background color"
@@ -240,12 +234,6 @@ msgstr "Ma superbe boite de munition"
msgid "Name"
msgstr "Nom"
-#: lib/cannery_web/live/ammo_type_live/index.ex:36
-#: lib/cannery_web/live/ammo_type_live/index.ex:44
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr "Nouveau type de munition"
-
#: lib/cannery_web/live/container_live/index.ex:32
#: lib/cannery_web/live/container_live/index.ex:39
#, elixir-autogen, elixir-format
@@ -267,7 +255,7 @@ msgstr "Nouveau tag"
msgid "No Ammo"
msgstr "Aucune munition"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:180
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "No ammo for this type"
msgstr "Aucune munition pour ce type"
@@ -405,7 +393,9 @@ msgstr "Traceuse"
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_pack_component.ex:66
+#: lib/cannery_web/components/pack_table_component.ex:95
#: lib/cannery_web/live/container_live/form_component.html.heex:39
+#: lib/cannery_web/live/pack_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Type"
msgstr "Type"
@@ -515,7 +505,7 @@ msgstr "Évènements de tir"
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:163
#: lib/cannery_web/components/pack_table_component.ex:246
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:150
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#, elixir-autogen, elixir-format
@@ -598,7 +588,7 @@ msgid "Edit %{name} tags"
msgstr "Éditer les tags de %{name}"
#: lib/cannery_web/components/core_components/container_card.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:87
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
#: lib/cannery_web/live/container_live/show.html.heex:27
#, elixir-autogen, elixir-format
msgid "Rounds:"
@@ -607,7 +597,7 @@ msgstr "Cartouches :"
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:160
#: lib/cannery_web/components/pack_table_component.ex:242
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr "Aucune information de prix"
@@ -678,7 +668,7 @@ msgstr "Enregistrer des tirs"
msgid "Copies"
msgstr "Exemplaires"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:139
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:137
#, elixir-autogen, elixir-format
msgid "Added on:"
msgstr "Ajouté le :"
@@ -758,7 +748,7 @@ msgid "This ammo is not in a container"
msgstr "Ce groupe de munition n’est pas dans un conteneur"
#: lib/cannery_web/components/core_components/container_card.html.heex:32
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:111
#: lib/cannery_web/live/container_live/show.html.heex:22
#, elixir-autogen, elixir-format
msgid "Packs:"
@@ -787,7 +777,7 @@ msgid "Container:"
msgstr "Conteneur"
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:164
#: lib/cannery_web/live/pack_live/index.html.heex:87
#, elixir-autogen, elixir-format
msgid "Show used"
@@ -816,7 +806,7 @@ msgstr "Packages :"
msgid "Rounds"
msgstr "Cartouches :"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:172
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:170
#: lib/cannery_web/live/container_live/index.html.heex:40
#: lib/cannery_web/live/container_live/show.html.heex:115
#, elixir-autogen, elixir-format
@@ -828,7 +818,7 @@ msgstr ""
msgid "Total ever packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:130
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:128
#, elixir-autogen, elixir-format
msgid "Total ever packs:"
msgstr ""
@@ -838,7 +828,7 @@ msgstr ""
msgid "Total ever rounds"
msgstr "Quantité de cartouches"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:104
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:102
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds:"
msgstr "Nombre totale de cartouches tirées :"
@@ -848,7 +838,7 @@ msgstr "Nombre totale de cartouches tirées :"
msgid "Used packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:120
#, elixir-autogen, elixir-format
msgid "Used packs:"
msgstr ""
@@ -858,7 +848,7 @@ msgstr ""
msgid "Used rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:94
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds:"
msgstr ""
@@ -964,17 +954,11 @@ msgid "UPC:"
msgstr "UPC"
#: lib/cannery_web/components/ammo_type_table_component.ex:102
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:148
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:146
#, elixir-autogen, elixir-format
msgid "Average CPR"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:28
-#: lib/cannery_web/live/ammo_type_live/show.ex:82
-#, elixir-autogen, elixir-format, fuzzy
-msgid "Edit %{ammo_type_name}"
-msgstr "Éditer %{name}"
-
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:250
#, elixir-autogen, elixir-format
@@ -1038,12 +1022,6 @@ msgstr ""
msgid "Edit ammo"
msgstr "Éditer le type de munition"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
-#, elixir-autogen, elixir-format, fuzzy
-msgid "No Ammo types"
-msgstr "Aucun type de munition"
-
#: lib/cannery_web/live/ammo_type_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "Search catalog"
@@ -1314,14 +1292,14 @@ msgstr ""
msgid "No ammo"
msgstr "Aucune munition"
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:60
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
#, elixir-autogen, elixir-format
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
#: lib/cannery_web/live/container_live/show.html.heex:106
#: lib/cannery_web/live/pack_live/index.html.heex:61
#: lib/cannery_web/live/range_live/index.html.heex:95
@@ -1346,7 +1324,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
#: lib/cannery_web/live/container_live/show.html.heex:104
#: lib/cannery_web/live/pack_live/index.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:93
@@ -1400,7 +1378,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:52
#: lib/cannery_web/live/container_live/show.html.heex:105
#: lib/cannery_web/live/pack_live/index.html.heex:60
#: lib/cannery_web/live/range_live/index.html.heex:94
@@ -1444,7 +1422,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/pack_live/index.html.heex:50
#: lib/cannery_web/live/range_live/index.html.heex:86
@@ -1468,3 +1446,21 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit Shot Record"
msgstr "Modifier les enregistrements de tir"
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:28
+#: lib/cannery_web/live/ammo_type_live/show.ex:82
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr "Éditer %{name}"
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:36
+#: lib/cannery_web/live/ammo_type_live/index.ex:44
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr "Nouveau type de munition"
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
+#, elixir-autogen, elixir-format, fuzzy
+msgid "No Types"
+msgstr "Type"
diff --git a/priv/gettext/fr/LC_MESSAGES/errors.po b/priv/gettext/fr/LC_MESSAGES/errors.po
index fd8dd8b..5a6b9ba 100644
--- a/priv/gettext/fr/LC_MESSAGES/errors.po
+++ b/priv/gettext/fr/LC_MESSAGES/errors.po
@@ -172,16 +172,11 @@ msgstr "Impossible d'analyser le nombre de copies"
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "Nombre de copies invalide, doit être 1 et %{max}. Été %{multiplier}"
-#: lib/cannery/ammo.ex:1123
+#: lib/cannery/ammo.ex:1121
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr "Multiplicateur invalide"
-#: lib/cannery/ammo/pack.ex:92
-#, elixir-autogen, elixir-format
-msgid "Please select an ammo type and container"
-msgstr "Veuillez choisir un type de munitions et un conteneur"
-
#: lib/cannery_web/live/range_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "Your browser does not support the canvas element."
@@ -211,3 +206,8 @@ msgstr "La quantité doit être inférieur à %{count}"
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
+
+#: lib/cannery/ammo/pack.ex:92
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Please select a type and container"
+msgstr "Veuillez choisir un type de munitions et un conteneur"
diff --git a/priv/gettext/fr/LC_MESSAGES/prompts.po b/priv/gettext/fr/LC_MESSAGES/prompts.po
index f988720..d5e07e4 100644
--- a/priv/gettext/fr/LC_MESSAGES/prompts.po
+++ b/priv/gettext/fr/LC_MESSAGES/prompts.po
@@ -23,7 +23,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:89
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:88
#: lib/cannery_web/live/container_live/form_component.ex:89
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:78
@@ -44,7 +44,7 @@ msgstr "%{name} supprimé· avec succès"
msgid "%{name} has been deleted"
msgstr "%{name} a été supprimé·e"
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:70
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:69
#: lib/cannery_web/live/container_live/form_component.ex:70
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:60
@@ -258,7 +258,7 @@ 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"
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:116
#: lib/cannery_web/live/ammo_type_live/show.html.heex:29
#, elixir-autogen, elixir-format, fuzzy
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
diff --git a/priv/gettext/ga/LC_MESSAGES/actions.po b/priv/gettext/ga/LC_MESSAGES/actions.po
index 4efea20..c980856 100644
--- a/priv/gettext/ga/LC_MESSAGES/actions.po
+++ b/priv/gettext/ga/LC_MESSAGES/actions.po
@@ -93,11 +93,6 @@ msgstr ""
msgid "Make your first tag!"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:17
#, elixir-autogen, elixir-format
msgid "New Container"
@@ -214,11 +209,6 @@ msgstr ""
msgid "View in Catalog"
msgstr ""
-#: lib/cannery_web/live/pack_live/index.html.heex:24
-#, elixir-autogen, elixir-format
-msgid "add an ammo type first"
-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:89
@@ -248,11 +238,6 @@ msgstr ""
msgid "Export Data as JSON"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:110
-#, elixir-autogen, elixir-format
-msgid "Clone %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:87
#: lib/cannery_web/live/container_live/index.html.heex:145
#, elixir-autogen, elixir-format
@@ -264,12 +249,6 @@ msgstr ""
msgid "Copy invite link for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:129
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:36
-#, elixir-autogen, elixir-format
-msgid "Delete %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:104
#: lib/cannery_web/live/container_live/index.html.heex:162
#: lib/cannery_web/live/container_live/show.html.heex:48
@@ -287,12 +266,6 @@ msgstr ""
msgid "Delete invite for %{invite_name}"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:100
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
-#, elixir-autogen, elixir-format
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.html.heex:77
#: lib/cannery_web/live/container_live/index.html.heex:135
#: lib/cannery_web/live/container_live/show.html.heex:35
@@ -326,11 +299,6 @@ msgstr ""
msgid "Unstage"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:90
-#, elixir-autogen, elixir-format
-msgid "View %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/live/pack_live/index.html.heex:174
#, elixir-autogen, elixir-format, fuzzy
msgid "Clone pack of %{pack_count} bullets"
@@ -348,7 +316,7 @@ msgstr ""
msgid "Edit pack of %{pack_count} bullets"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:206
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:204
#: lib/cannery_web/live/pack_live/index.html.heex:154
#, elixir-autogen, elixir-format, fuzzy
msgid "View pack of %{pack_count} bullets"
@@ -365,3 +333,35 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit shot record of %{shot_record_count} shots"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:105
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Clone %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:35
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Delete %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:97
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:19
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:17
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:89
+#, elixir-autogen, elixir-format, fuzzy
+msgid "View %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/pack_live/index.html.heex:24
+#, elixir-autogen, elixir-format, fuzzy
+msgid "add a type first"
+msgstr ""
diff --git a/priv/gettext/ga/LC_MESSAGES/default.po b/priv/gettext/ga/LC_MESSAGES/default.po
index 7e98ffc..9146b88 100644
--- a/priv/gettext/ga/LC_MESSAGES/default.po
+++ b/priv/gettext/ga/LC_MESSAGES/default.po
@@ -36,12 +36,6 @@ msgstr ""
msgid "Ammo"
msgstr ""
-#: lib/cannery_web/components/pack_table_component.ex:95
-#: lib/cannery_web/live/pack_live/form_component.html.heex:22
-#, elixir-autogen, elixir-format
-msgid "Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/tag_live/form_component.html.heex:25
#, elixir-autogen, elixir-format
msgid "Background color"
@@ -238,12 +232,6 @@ msgstr ""
msgid "Name"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:36
-#: lib/cannery_web/live/ammo_type_live/index.ex:44
-#, elixir-autogen, elixir-format
-msgid "New Ammo type"
-msgstr ""
-
#: lib/cannery_web/live/container_live/index.ex:32
#: lib/cannery_web/live/container_live/index.ex:39
#, elixir-autogen, elixir-format
@@ -265,7 +253,7 @@ msgstr ""
msgid "No Ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:180
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:178
#, elixir-autogen, elixir-format
msgid "No ammo for this type"
msgstr ""
@@ -399,7 +387,9 @@ msgstr ""
#: lib/cannery_web/components/container_table_component.ex:48
#: lib/cannery_web/components/move_pack_component.ex:66
+#: lib/cannery_web/components/pack_table_component.ex:95
#: lib/cannery_web/live/container_live/form_component.html.heex:39
+#: lib/cannery_web/live/pack_live/form_component.html.heex:22
#, elixir-autogen, elixir-format
msgid "Type"
msgstr ""
@@ -509,7 +499,7 @@ msgstr ""
#: lib/cannery_web/components/core_components/pack_card.html.heex:47
#: lib/cannery_web/components/pack_table_component.ex:163
#: lib/cannery_web/components/pack_table_component.ex:246
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:150
#: lib/cannery_web/live/pack_live/show.html.heex:37
#: lib/cannery_web/live/pack_live/show.html.heex:42
#, elixir-autogen, elixir-format
@@ -592,7 +582,7 @@ msgid "Edit %{name} tags"
msgstr ""
#: lib/cannery_web/components/core_components/container_card.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:87
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
#: lib/cannery_web/live/container_live/show.html.heex:27
#, elixir-autogen, elixir-format
msgid "Rounds:"
@@ -601,7 +591,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:260
#: lib/cannery_web/components/pack_table_component.ex:160
#: lib/cannery_web/components/pack_table_component.ex:242
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:156
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:154
#, elixir-autogen, elixir-format
msgid "No cost information"
msgstr ""
@@ -672,7 +662,7 @@ msgstr ""
msgid "Copies"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:139
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:137
#, elixir-autogen, elixir-format
msgid "Added on:"
msgstr ""
@@ -752,7 +742,7 @@ msgid "This ammo is not in a container"
msgstr ""
#: lib/cannery_web/components/core_components/container_card.html.heex:32
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:113
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:111
#: lib/cannery_web/live/container_live/show.html.heex:22
#, elixir-autogen, elixir-format
msgid "Packs:"
@@ -780,7 +770,7 @@ msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.html.heex:64
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:166
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:164
#: lib/cannery_web/live/pack_live/index.html.heex:87
#, elixir-autogen, elixir-format
msgid "Show used"
@@ -809,7 +799,7 @@ msgstr ""
msgid "Rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:172
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:170
#: lib/cannery_web/live/container_live/index.html.heex:40
#: lib/cannery_web/live/container_live/show.html.heex:115
#, elixir-autogen, elixir-format
@@ -821,7 +811,7 @@ msgstr ""
msgid "Total ever packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:130
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:128
#, elixir-autogen, elixir-format
msgid "Total ever packs:"
msgstr ""
@@ -831,7 +821,7 @@ msgstr ""
msgid "Total ever rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:104
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:102
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds:"
msgstr ""
@@ -841,7 +831,7 @@ msgstr ""
msgid "Used packs"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:120
#, elixir-autogen, elixir-format
msgid "Used packs:"
msgstr ""
@@ -851,7 +841,7 @@ msgstr ""
msgid "Used rounds"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:96
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:94
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds:"
msgstr ""
@@ -957,17 +947,11 @@ msgid "UPC:"
msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:102
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:148
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:146
#, elixir-autogen, elixir-format
msgid "Average CPR"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.ex:28
-#: lib/cannery_web/live/ammo_type_live/show.ex:82
-#, elixir-autogen, elixir-format, fuzzy
-msgid "Edit %{ammo_type_name}"
-msgstr ""
-
#: lib/cannery_web/components/core_components/pack_card.html.heex:17
#: lib/cannery_web/components/pack_table_component.ex:250
#, elixir-autogen, elixir-format
@@ -1031,12 +1015,6 @@ msgstr ""
msgid "Edit ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
-#, elixir-autogen, elixir-format, fuzzy
-msgid "No Ammo types"
-msgstr ""
-
#: lib/cannery_web/live/ammo_type_live/index.html.heex:58
#, elixir-autogen, elixir-format
msgid "Search catalog"
@@ -1305,14 +1283,14 @@ msgstr ""
msgid "No ammo"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:60
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
#, elixir-autogen, elixir-format
msgid "None specified"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:38
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:58
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
#: lib/cannery_web/live/container_live/show.html.heex:106
#: lib/cannery_web/live/pack_live/index.html.heex:61
#: lib/cannery_web/live/range_live/index.html.heex:95
@@ -1337,7 +1315,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:36
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:56
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
#: lib/cannery_web/live/container_live/show.html.heex:104
#: lib/cannery_web/live/pack_live/index.html.heex:59
#: lib/cannery_web/live/range_live/index.html.heex:93
@@ -1391,7 +1369,7 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:25
#: lib/cannery_web/live/ammo_type_live/index.html.heex:37
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:54
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:52
#: lib/cannery_web/live/container_live/show.html.heex:105
#: lib/cannery_web/live/pack_live/index.html.heex:60
#: lib/cannery_web/live/range_live/index.html.heex:94
@@ -1435,7 +1413,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_type_table_component.ex:150
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_type_live/index.html.heex:29
-#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
+#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:97
#: lib/cannery_web/live/pack_live/index.html.heex:50
#: lib/cannery_web/live/range_live/index.html.heex:86
@@ -1459,3 +1437,21 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit Shot Record"
msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:28
+#: lib/cannery_web/live/ammo_type_live/show.ex:82
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Edit %{type_name}"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.ex:36
+#: lib/cannery_web/live/ammo_type_live/index.ex:44
+#, elixir-autogen, elixir-format, fuzzy
+msgid "New Type"
+msgstr ""
+
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:8
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:71
+#, elixir-autogen, elixir-format, fuzzy
+msgid "No Types"
+msgstr ""
diff --git a/priv/gettext/ga/LC_MESSAGES/errors.po b/priv/gettext/ga/LC_MESSAGES/errors.po
index eb82db6..15f8025 100644
--- a/priv/gettext/ga/LC_MESSAGES/errors.po
+++ b/priv/gettext/ga/LC_MESSAGES/errors.po
@@ -171,16 +171,11 @@ msgstr ""
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""
-#: lib/cannery/ammo.ex:1123
+#: lib/cannery/ammo.ex:1121
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr ""
-#: lib/cannery/ammo/pack.ex:92
-#, elixir-autogen, elixir-format
-msgid "Please select an ammo type and container"
-msgstr ""
-
#: lib/cannery_web/live/range_live/index.html.heex:74
#, elixir-autogen, elixir-format
msgid "Your browser does not support the canvas element."
@@ -210,3 +205,8 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "can't be blank"
msgstr ""
+
+#: lib/cannery/ammo/pack.ex:92
+#, elixir-autogen, elixir-format, fuzzy
+msgid "Please select a type and container"
+msgstr ""
diff --git a/priv/gettext/ga/LC_MESSAGES/prompts.po b/priv/gettext/ga/LC_MESSAGES/prompts.po
index 68b8fff..744346e 100644
--- a/priv/gettext/ga/LC_MESSAGES/prompts.po
+++ b/priv/gettext/ga/LC_MESSAGES/prompts.po
@@ -21,7 +21,7 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead.
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:89
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:88
#: lib/cannery_web/live/container_live/form_component.ex:89
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:78
@@ -42,7 +42,7 @@ msgstr ""
msgid "%{name} has been deleted"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:70
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:69
#: lib/cannery_web/live/container_live/form_component.ex:70
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:60
@@ -250,7 +250,7 @@ msgstr[2] ""
msgstr[3] ""
msgstr[4] ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:116
#: lib/cannery_web/live/ammo_type_live/show.html.heex:29
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot
index 832b5ce..3fdf4a6 100644
--- a/priv/gettext/prompts.pot
+++ b/priv/gettext/prompts.pot
@@ -10,7 +10,7 @@
msgid ""
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:89
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:88
#: lib/cannery_web/live/container_live/form_component.ex:89
#: lib/cannery_web/live/invite_live/form_component.ex:80
#: lib/cannery_web/live/tag_live/form_component.ex:78
@@ -31,7 +31,7 @@ msgstr ""
msgid "%{name} has been deleted"
msgstr ""
-#: lib/cannery_web/live/ammo_type_live/form_component.ex:70
+#: lib/cannery_web/live/ammo_type_live/form_component.ex:69
#: lib/cannery_web/live/container_live/form_component.ex:70
#: lib/cannery_web/live/invite_live/form_component.ex:62
#: lib/cannery_web/live/tag_live/form_component.ex:60
@@ -236,7 +236,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
-#: lib/cannery_web/live/ammo_type_live/index.html.heex:122
+#: lib/cannery_web/live/ammo_type_live/index.html.heex:116
#: lib/cannery_web/live/ammo_type_live/show.html.heex:29
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"
diff --git a/test/cannery/activity_log_test.exs b/test/cannery/activity_log_test.exs
index 3dc93ca..cb99487 100644
--- a/test/cannery/activity_log_test.exs
+++ b/test/cannery/activity_log_test.exs
@@ -13,10 +13,9 @@ defmodule Cannery.ActivityLogTest do
setup do
current_user = user_fixture()
container = container_fixture(current_user)
- ammo_type = ammo_type_fixture(current_user)
+ type = type_fixture(current_user)
- {1, [%{id: pack_id} = pack]} =
- pack_fixture(%{count: 25}, ammo_type, container, current_user)
+ {1, [%{id: pack_id} = pack]} = pack_fixture(%{count: 25}, type, container, current_user)
shot_record =
%{count: 5, date: ~N[2022-02-13 03:17:00], notes: "some notes"}
@@ -27,7 +26,7 @@ defmodule Cannery.ActivityLogTest do
[
current_user: current_user,
container: container,
- ammo_type: ammo_type,
+ type: type,
pack: pack,
shot_record: shot_record
]
@@ -47,8 +46,8 @@ defmodule Cannery.ActivityLogTest do
assert ActivityLog.get_shot_record_count!(other_user) == 0
container = container_fixture(other_user)
- ammo_type = ammo_type_fixture(other_user)
- {1, [pack]} = pack_fixture(%{count: 25}, ammo_type, container, other_user)
+ type = type_fixture(other_user)
+ {1, [pack]} = pack_fixture(%{count: 25}, type, container, other_user)
shot_record_fixture(%{count: 1, date: ~N[2022-02-13 03:17:00]}, other_user, pack)
assert ActivityLog.get_shot_record_count!(other_user) == 1
end
@@ -191,11 +190,11 @@ defmodule Cannery.ActivityLogTest do
test "get_used_count/2 returns accurate used count", %{
pack: pack,
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
- {1, [another_pack]} = pack_fixture(ammo_type, container, current_user)
+ {1, [another_pack]} = pack_fixture(type, container, current_user)
assert 0 = another_pack |> ActivityLog.get_used_count(current_user)
assert 5 = pack |> ActivityLog.get_used_count(current_user)
@@ -205,18 +204,17 @@ defmodule Cannery.ActivityLogTest do
shot_record_fixture(%{count: 10}, current_user, pack)
assert 30 = pack |> ActivityLog.get_used_count(current_user)
- {1, [another_pack]} = pack_fixture(ammo_type, container, current_user)
+ {1, [another_pack]} = pack_fixture(type, container, current_user)
assert 0 = another_pack |> ActivityLog.get_used_count(current_user)
end
test "get_used_counts/2 returns accurate used counts", %{
pack: %{id: pack_id} = pack,
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
- {1, [%{id: another_pack_id} = another_pack]} =
- pack_fixture(ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} = pack_fixture(type, container, current_user)
assert %{pack_id => 5} ==
[pack, another_pack] |> ActivityLog.get_used_counts(current_user)
@@ -239,12 +237,12 @@ defmodule Cannery.ActivityLogTest do
test "get_last_used_date/2 returns accurate used count", %{
pack: pack,
- ammo_type: ammo_type,
+ type: type,
container: container,
shot_record: %{date: date},
current_user: current_user
} do
- {1, [another_pack]} = pack_fixture(ammo_type, container, current_user)
+ {1, [another_pack]} = pack_fixture(type, container, current_user)
assert another_pack |> ActivityLog.get_last_used_date(current_user) |> is_nil()
assert ^date = pack |> ActivityLog.get_last_used_date(current_user)
@@ -257,13 +255,12 @@ defmodule Cannery.ActivityLogTest do
test "get_last_used_dates/2 returns accurate used counts", %{
pack: %{id: pack_id} = pack,
- ammo_type: ammo_type,
+ type: type,
container: container,
shot_record: %{date: date},
current_user: current_user
} do
- {1, [%{id: another_pack_id} = another_pack]} =
- pack_fixture(ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} = pack_fixture(type, container, current_user)
# unset date
assert %{pack_id => date} ==
@@ -297,49 +294,47 @@ defmodule Cannery.ActivityLogTest do
assert %{^another_pack_id => ~D[2022-11-09]} = last_used_shot_records
end
- test "get_used_count_for_ammo_type/2 gets accurate used round count for ammo type",
- %{ammo_type: ammo_type, pack: pack, current_user: current_user} do
- another_ammo_type = ammo_type_fixture(current_user)
- assert 0 = another_ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
- assert 5 = ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
+ test "get_used_count_for_type/2 gets accurate used round count for type",
+ %{type: type, pack: pack, current_user: current_user} do
+ another_type = type_fixture(current_user)
+ assert 0 = another_type |> ActivityLog.get_used_count_for_type(current_user)
+ assert 5 = type |> ActivityLog.get_used_count_for_type(current_user)
shot_record_fixture(%{count: 5}, current_user, pack)
- assert 10 = ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
+ assert 10 = type |> ActivityLog.get_used_count_for_type(current_user)
shot_record_fixture(%{count: 1}, current_user, pack)
- assert 11 = ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user)
+ assert 11 = type |> ActivityLog.get_used_count_for_type(current_user)
end
- test "get_used_count_for_ammo_types/2 gets accurate used round count for ammo types", %{
- ammo_type: %{id: ammo_type_id} = ammo_type,
+ test "get_used_count_for_types/2 gets accurate used round count for types", %{
+ type: %{id: type_id} = type,
container: container,
current_user: current_user
} do
- # testing unused ammo type
- %{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
- {1, [pack]} = pack_fixture(another_ammo_type, container, current_user)
+ # testing unused type
+ %{id: another_type_id} = another_type = type_fixture(current_user)
+ {1, [pack]} = pack_fixture(another_type, container, current_user)
- assert %{ammo_type_id => 5} ==
- [ammo_type, another_ammo_type]
- |> ActivityLog.get_used_count_for_ammo_types(current_user)
+ assert %{type_id => 5} ==
+ [type, another_type]
+ |> ActivityLog.get_used_count_for_types(current_user)
# use generated pack
shot_record_fixture(%{count: 5}, current_user, pack)
- used_counts =
- [ammo_type, another_ammo_type] |> ActivityLog.get_used_count_for_ammo_types(current_user)
+ used_counts = [type, another_type] |> ActivityLog.get_used_count_for_types(current_user)
- assert %{^ammo_type_id => 5} = used_counts
- assert %{^another_ammo_type_id => 5} = used_counts
+ assert %{^type_id => 5} = used_counts
+ assert %{^another_type_id => 5} = used_counts
# use generated pack again
shot_record_fixture(%{count: 1}, current_user, pack)
- used_counts =
- [ammo_type, another_ammo_type] |> ActivityLog.get_used_count_for_ammo_types(current_user)
+ used_counts = [type, another_type] |> ActivityLog.get_used_count_for_types(current_user)
- assert %{^ammo_type_id => 5} = used_counts
- assert %{^another_ammo_type_id => 6} = used_counts
+ assert %{^type_id => 5} = used_counts
+ assert %{^another_type_id => 6} = used_counts
end
end
@@ -347,13 +342,13 @@ defmodule Cannery.ActivityLogTest do
setup do
current_user = user_fixture()
container = container_fixture(current_user)
- ammo_type = ammo_type_fixture(current_user)
- {1, [pack]} = pack_fixture(ammo_type, container, current_user)
+ type = type_fixture(current_user)
+ {1, [pack]} = pack_fixture(type, container, current_user)
[
current_user: current_user,
container: container,
- ammo_type: ammo_type,
+ type: type,
pack: pack
]
end
@@ -364,21 +359,21 @@ defmodule Cannery.ActivityLogTest do
other_container = container_fixture(other_user)
for class <- ["rifle", "shotgun", "pistol"] do
- other_ammo_type = ammo_type_fixture(%{class: class}, other_user)
- {1, [other_pack]} = pack_fixture(other_ammo_type, other_container, other_user)
+ other_type = type_fixture(%{class: class}, other_user)
+ {1, [other_pack]} = pack_fixture(other_type, other_container, other_user)
shot_record_fixture(other_user, other_pack)
end
- rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
+ rifle_type = type_fixture(%{class: :rifle}, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
rifle_shot_record = shot_record_fixture(current_user, rifle_pack)
- shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
+ shotgun_type = type_fixture(%{class: :shotgun}, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
shotgun_shot_record = shot_record_fixture(current_user, shotgun_pack)
- pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
+ pistol_type = type_fixture(%{class: :pistol}, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
pistol_shot_record = shot_record_fixture(current_user, pistol_pack)
assert [^rifle_shot_record] = ActivityLog.list_shot_records(:rifle, current_user)
@@ -399,29 +394,28 @@ defmodule Cannery.ActivityLogTest do
end
test "list_shot_records/3 returns relevant shot_records for a search", %{
- ammo_type: ammo_type,
+ type: type,
pack: pack,
container: container,
current_user: current_user
} do
shot_record_a = shot_record_fixture(%{notes: "amazing"}, current_user, pack)
- {1, [another_pack]} =
- pack_fixture(%{notes: "stupendous"}, ammo_type, container, current_user)
+ {1, [another_pack]} = pack_fixture(%{notes: "stupendous"}, type, container, current_user)
shot_record_b = shot_record_fixture(current_user, another_pack)
- another_ammo_type = ammo_type_fixture(%{name: "fabulous ammo"}, current_user)
+ another_type = type_fixture(%{name: "fabulous ammo"}, current_user)
- {1, [yet_another_pack]} = pack_fixture(another_ammo_type, container, current_user)
+ {1, [yet_another_pack]} = pack_fixture(another_type, container, current_user)
shot_record_c = shot_record_fixture(current_user, yet_another_pack)
another_user = user_fixture()
another_container = container_fixture(another_user)
- another_ammo_type = ammo_type_fixture(another_user)
+ another_type = type_fixture(another_user)
- {1, [another_pack]} = pack_fixture(another_ammo_type, another_container, another_user)
+ {1, [another_pack]} = pack_fixture(another_type, another_container, another_user)
_shouldnt_return = shot_record_fixture(another_user, another_pack)
@@ -431,7 +425,7 @@ defmodule Cannery.ActivityLogTest do
# pack attributes
assert ActivityLog.list_shot_records("stupendous", :all, current_user) == [shot_record_b]
- # ammo type attributes
+ # type attributes
assert ActivityLog.list_shot_records("fabulous", :all, current_user) == [shot_record_c]
end
end
diff --git a/test/cannery/ammo_test.exs b/test/cannery/ammo_test.exs
index f1a0c45..bde2d3d 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.AmmoType, Ammo.Pack, Containers}
+ alias Cannery.{Ammo, Ammo.Pack, Ammo.Type, Containers}
alias Ecto.Changeset
@moduletag :ammo_test
@@ -34,531 +34,519 @@ defmodule Cannery.AmmoTest do
grains: nil
}
- describe "list_ammo_types/2" do
+ describe "list_types/2" do
setup do
current_user = user_fixture()
- rifle_ammo_type =
+ rifle_type =
%{
name: "bullets",
class: :rifle,
desc: "has some pews in it",
grains: 53_453
}
- |> ammo_type_fixture(current_user)
+ |> type_fixture(current_user)
- shotgun_ammo_type =
+ shotgun_type =
%{
name: "hollows",
class: :shotgun,
grains: 3_234_234
}
- |> ammo_type_fixture(current_user)
+ |> type_fixture(current_user)
- pistol_ammo_type =
+ pistol_type =
%{
class: :pistol,
name: "jackets",
desc: "brass shell",
tracer: true
}
- |> ammo_type_fixture(current_user)
+ |> type_fixture(current_user)
_shouldnt_return =
%{
name: "bullet",
desc: "pews brass shell"
}
- |> ammo_type_fixture(user_fixture())
+ |> type_fixture(user_fixture())
[
- rifle_ammo_type: rifle_ammo_type,
- shotgun_ammo_type: shotgun_ammo_type,
- pistol_ammo_type: pistol_ammo_type,
+ rifle_type: rifle_type,
+ shotgun_type: shotgun_type,
+ pistol_type: pistol_type,
current_user: current_user
]
end
- test "list_ammo_types/2 returns all ammo_types", %{
- rifle_ammo_type: rifle_ammo_type,
- shotgun_ammo_type: shotgun_ammo_type,
- pistol_ammo_type: pistol_ammo_type,
+ test "list_types/2 returns all types", %{
+ rifle_type: rifle_type,
+ shotgun_type: shotgun_type,
+ pistol_type: pistol_type,
current_user: current_user
} do
- results = Ammo.list_ammo_types(current_user, :all)
+ results = Ammo.list_types(current_user, :all)
assert results |> Enum.count() == 3
- assert rifle_ammo_type in results
- assert shotgun_ammo_type in results
- assert pistol_ammo_type in results
+ assert rifle_type in results
+ assert shotgun_type in results
+ assert pistol_type in results
end
- test "list_ammo_types/2 returns rifle ammo_types", %{
- rifle_ammo_type: rifle_ammo_type,
+ test "list_types/2 returns rifle types", %{
+ rifle_type: rifle_type,
current_user: current_user
} do
- assert [^rifle_ammo_type] = Ammo.list_ammo_types(current_user, :rifle)
+ assert [^rifle_type] = Ammo.list_types(current_user, :rifle)
end
- test "list_ammo_types/2 returns shotgun ammo_types", %{
- shotgun_ammo_type: shotgun_ammo_type,
+ test "list_types/2 returns shotgun types", %{
+ shotgun_type: shotgun_type,
current_user: current_user
} do
- assert [^shotgun_ammo_type] = Ammo.list_ammo_types(current_user, :shotgun)
+ assert [^shotgun_type] = Ammo.list_types(current_user, :shotgun)
end
- test "list_ammo_types/2 returns pistol ammo_types", %{
- pistol_ammo_type: pistol_ammo_type,
+ test "list_types/2 returns pistol types", %{
+ pistol_type: pistol_type,
current_user: current_user
} do
- assert [^pistol_ammo_type] = Ammo.list_ammo_types(current_user, :pistol)
+ assert [^pistol_type] = Ammo.list_types(current_user, :pistol)
end
- test "list_ammo_types/2 returns relevant ammo_types for a user", %{
- rifle_ammo_type: rifle_ammo_type,
- shotgun_ammo_type: shotgun_ammo_type,
- pistol_ammo_type: pistol_ammo_type,
+ test "list_types/2 returns relevant types for a user", %{
+ rifle_type: rifle_type,
+ shotgun_type: shotgun_type,
+ pistol_type: pistol_type,
current_user: current_user
} do
# name
- assert Ammo.list_ammo_types("bullet", current_user, :all) == [rifle_ammo_type]
- assert Ammo.list_ammo_types("bullets", current_user, :all) == [rifle_ammo_type]
- assert Ammo.list_ammo_types("hollow", current_user, :all) == [shotgun_ammo_type]
- assert Ammo.list_ammo_types("jacket", current_user, :all) == [pistol_ammo_type]
+ assert Ammo.list_types("bullet", current_user, :all) == [rifle_type]
+ assert Ammo.list_types("bullets", current_user, :all) == [rifle_type]
+ assert Ammo.list_types("hollow", current_user, :all) == [shotgun_type]
+ assert Ammo.list_types("jacket", current_user, :all) == [pistol_type]
# desc
- assert Ammo.list_ammo_types("pew", current_user, :all) == [rifle_ammo_type]
- assert Ammo.list_ammo_types("brass", current_user, :all) == [pistol_ammo_type]
- assert Ammo.list_ammo_types("shell", current_user, :all) == [pistol_ammo_type]
+ assert Ammo.list_types("pew", current_user, :all) == [rifle_type]
+ assert Ammo.list_types("brass", current_user, :all) == [pistol_type]
+ assert Ammo.list_types("shell", current_user, :all) == [pistol_type]
# grains (integer)
- assert Ammo.list_ammo_types("53453", current_user, :all) == [rifle_ammo_type]
- assert Ammo.list_ammo_types("3234234", current_user, :all) == [shotgun_ammo_type]
+ assert Ammo.list_types("53453", current_user, :all) == [rifle_type]
+ assert Ammo.list_types("3234234", current_user, :all) == [shotgun_type]
# tracer (boolean)
- assert Ammo.list_ammo_types("tracer", current_user, :all) == [pistol_ammo_type]
+ assert Ammo.list_types("tracer", current_user, :all) == [pistol_type]
end
end
- describe "ammo types" do
+ describe "types" do
setup do
current_user = user_fixture()
- [ammo_type: ammo_type_fixture(current_user), current_user: current_user]
+ [type: type_fixture(current_user), current_user: current_user]
end
- test "get_ammo_type!/2 returns the ammo_type with given id",
- %{ammo_type: ammo_type, current_user: current_user} do
- assert Ammo.get_ammo_type!(ammo_type.id, current_user) == ammo_type
+ test "get_type!/2 returns the type with given id",
+ %{type: type, current_user: current_user} do
+ assert Ammo.get_type!(type.id, current_user) == type
end
- test "get_ammo_types_count!/1 returns the correct amount of ammo",
+ test "get_types_count!/1 returns the correct amount of ammo",
%{current_user: current_user} do
- assert Ammo.get_ammo_types_count!(current_user) == 1
+ assert Ammo.get_types_count!(current_user) == 1
- ammo_type_fixture(current_user)
- assert Ammo.get_ammo_types_count!(current_user) == 2
+ type_fixture(current_user)
+ assert Ammo.get_types_count!(current_user) == 2
- ammo_type_fixture(current_user)
- assert Ammo.get_ammo_types_count!(current_user) == 3
+ type_fixture(current_user)
+ assert Ammo.get_types_count!(current_user) == 3
other_user = user_fixture()
- assert Ammo.get_ammo_types_count!(other_user) == 0
+ assert Ammo.get_types_count!(other_user) == 0
- ammo_type_fixture(other_user)
- assert Ammo.get_ammo_types_count!(other_user) == 1
+ type_fixture(other_user)
+ assert Ammo.get_types_count!(other_user) == 1
end
- test "create_ammo_type/2 with valid data creates a ammo_type",
+ test "create_type/2 with valid data creates a type",
%{current_user: current_user} do
- assert {:ok, %AmmoType{} = ammo_type} = Ammo.create_ammo_type(@valid_attrs, current_user)
- assert ammo_type.bullet_type == "some bullet_type"
- assert ammo_type.case_material == "some case_material"
- assert ammo_type.desc == "some desc"
- assert ammo_type.manufacturer == "some manufacturer"
- assert ammo_type.name == "some name"
- assert ammo_type.grains == 120
+ assert {:ok, %Type{} = type} = Ammo.create_type(@valid_attrs, current_user)
+ assert type.bullet_type == "some bullet_type"
+ assert type.case_material == "some case_material"
+ assert type.desc == "some desc"
+ assert type.manufacturer == "some manufacturer"
+ assert type.name == "some name"
+ assert type.grains == 120
end
- test "create_ammo_type/2 with invalid data returns error changeset",
+ test "create_type/2 with invalid data returns error changeset",
%{current_user: current_user} do
- assert {:error, %Changeset{}} = Ammo.create_ammo_type(@invalid_attrs, current_user)
+ assert {:error, %Changeset{}} = Ammo.create_type(@invalid_attrs, current_user)
end
- test "update_ammo_type/3 with valid data updates the ammo_type",
- %{ammo_type: ammo_type, current_user: current_user} do
- assert {:ok, %AmmoType{} = ammo_type} =
- Ammo.update_ammo_type(ammo_type, @update_attrs, current_user)
+ test "update_type/3 with valid data updates the type",
+ %{type: type, current_user: current_user} do
+ assert {:ok, %Type{} = type} = Ammo.update_type(type, @update_attrs, current_user)
- assert ammo_type.bullet_type == "some updated bullet_type"
- assert ammo_type.case_material == "some updated case_material"
- assert ammo_type.desc == "some updated desc"
- assert ammo_type.manufacturer == "some updated manufacturer"
- assert ammo_type.name == "some updated name"
- assert ammo_type.grains == 456
+ assert type.bullet_type == "some updated bullet_type"
+ assert type.case_material == "some updated case_material"
+ assert type.desc == "some updated desc"
+ assert type.manufacturer == "some updated manufacturer"
+ assert type.name == "some updated name"
+ assert type.grains == 456
end
- test "update_ammo_type/3 with invalid data returns error changeset",
- %{ammo_type: ammo_type, current_user: current_user} do
- assert {:error, %Changeset{}} =
- Ammo.update_ammo_type(ammo_type, @invalid_attrs, current_user)
+ test "update_type/3 with invalid data returns error changeset",
+ %{type: type, current_user: current_user} do
+ assert {:error, %Changeset{}} = Ammo.update_type(type, @invalid_attrs, current_user)
- assert ammo_type == Ammo.get_ammo_type!(ammo_type.id, current_user)
+ assert type == Ammo.get_type!(type.id, current_user)
end
- test "delete_ammo_type/2 deletes the ammo_type",
- %{ammo_type: ammo_type, current_user: current_user} 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
+ test "delete_type/2 deletes the type",
+ %{type: type, current_user: current_user} do
+ assert {:ok, %Type{}} = Ammo.delete_type(type, current_user)
+ assert_raise Ecto.NoResultsError, fn -> Ammo.get_type!(type.id, current_user) end
end
end
- describe "ammo types with packs" do
+ describe "types with packs" do
setup do
current_user = user_fixture()
- ammo_type = ammo_type_fixture(current_user)
+ type = type_fixture(current_user)
container = container_fixture(current_user)
[
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
]
end
- test "get_average_cost_for_ammo_type/2 gets average cost for ammo type",
- %{ammo_type: ammo_type, current_user: current_user, container: container} do
+ test "get_average_cost_for_type/2 gets average cost for type",
+ %{type: type, current_user: current_user, container: container} do
{1, [_pack]} =
pack_fixture(
%{price_paid: 25.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- assert 25.0 = Ammo.get_average_cost_for_ammo_type(ammo_type, current_user)
+ assert 25.0 = Ammo.get_average_cost_for_type(type, current_user)
{1, [_pack]} =
pack_fixture(
%{price_paid: 25.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- assert 25.0 = Ammo.get_average_cost_for_ammo_type(ammo_type, current_user)
+ assert 25.0 = Ammo.get_average_cost_for_type(type, current_user)
{1, [_pack]} =
pack_fixture(
%{price_paid: 70.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- assert 40.0 = Ammo.get_average_cost_for_ammo_type(ammo_type, current_user)
+ assert 40.0 = Ammo.get_average_cost_for_type(type, current_user)
{1, [_pack]} =
pack_fixture(
%{price_paid: 30.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- assert 37.5 = Ammo.get_average_cost_for_ammo_type(ammo_type, current_user)
+ assert 37.5 = Ammo.get_average_cost_for_type(type, current_user)
end
- test "get_average_cost_for_ammo_types/2 gets average costs for ammo types", %{
- ammo_type: %{id: ammo_type_id} = ammo_type,
+ test "get_average_cost_for_types/2 gets average costs for types", %{
+ type: %{id: type_id} = type,
current_user: current_user,
container: container
} do
- assert %{} == [ammo_type] |> Ammo.get_average_cost_for_ammo_types(current_user)
+ assert %{} == [type] |> Ammo.get_average_cost_for_types(current_user)
- %{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
+ %{id: another_type_id} = another_type = type_fixture(current_user)
assert %{} ==
- [ammo_type, another_ammo_type]
- |> Ammo.get_average_cost_for_ammo_types(current_user)
+ [type, another_type]
+ |> Ammo.get_average_cost_for_types(current_user)
{1, [_pack]} =
pack_fixture(
%{price_paid: 25.00, count: 1},
- another_ammo_type,
+ another_type,
container,
current_user
)
- assert %{another_ammo_type_id => 25.0} ==
- [ammo_type, another_ammo_type]
- |> Ammo.get_average_cost_for_ammo_types(current_user)
+ assert %{another_type_id => 25.0} ==
+ [type, another_type]
+ |> Ammo.get_average_cost_for_types(current_user)
{1, [_pack]} =
pack_fixture(
%{price_paid: 25.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- average_costs =
- [ammo_type, another_ammo_type] |> Ammo.get_average_cost_for_ammo_types(current_user)
+ average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
- assert %{^ammo_type_id => 25.0} = average_costs
- assert %{^another_ammo_type_id => 25.0} = average_costs
+ assert %{^type_id => 25.0} = average_costs
+ assert %{^another_type_id => 25.0} = average_costs
{1, [_pack]} =
pack_fixture(
%{price_paid: 25.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- average_costs =
- [ammo_type, another_ammo_type] |> Ammo.get_average_cost_for_ammo_types(current_user)
+ average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
- assert %{^ammo_type_id => 25.0} = average_costs
- assert %{^another_ammo_type_id => 25.0} = average_costs
+ assert %{^type_id => 25.0} = average_costs
+ assert %{^another_type_id => 25.0} = average_costs
{1, [_pack]} =
pack_fixture(
%{price_paid: 70.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- average_costs =
- [ammo_type, another_ammo_type] |> Ammo.get_average_cost_for_ammo_types(current_user)
+ average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
- assert %{^ammo_type_id => 40.0} = average_costs
- assert %{^another_ammo_type_id => 25.0} = average_costs
+ assert %{^type_id => 40.0} = average_costs
+ assert %{^another_type_id => 25.0} = average_costs
{1, [_pack]} =
pack_fixture(
%{price_paid: 30.00, count: 1},
- ammo_type,
+ type,
container,
current_user
)
- average_costs =
- [ammo_type, another_ammo_type] |> Ammo.get_average_cost_for_ammo_types(current_user)
+ average_costs = [type, another_type] |> Ammo.get_average_cost_for_types(current_user)
- assert %{^ammo_type_id => 37.5} = average_costs
- assert %{^another_ammo_type_id => 25.0} = average_costs
+ assert %{^type_id => 37.5} = average_costs
+ assert %{^another_type_id => 25.0} = average_costs
end
- test "get_round_count_for_ammo_type/2 gets accurate round count for ammo type",
- %{ammo_type: ammo_type, current_user: current_user, container: container} do
- another_ammo_type = ammo_type_fixture(current_user)
- assert 0 = Ammo.get_round_count_for_ammo_type(another_ammo_type, current_user)
+ test "get_round_count_for_type/2 gets accurate round count for type",
+ %{type: type, current_user: current_user, container: container} do
+ another_type = type_fixture(current_user)
+ assert 0 = Ammo.get_round_count_for_type(another_type, current_user)
- {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
- assert 1 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
+ assert 1 = Ammo.get_round_count_for_type(type, current_user)
- {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
- assert 51 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
+ assert 51 = Ammo.get_round_count_for_type(type, current_user)
shot_record_fixture(%{count: 26}, current_user, pack)
- assert 25 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
+ assert 25 = Ammo.get_round_count_for_type(type, current_user)
shot_record_fixture(%{count: 1}, current_user, first_pack)
- assert 24 = Ammo.get_round_count_for_ammo_type(ammo_type, current_user)
+ assert 24 = Ammo.get_round_count_for_type(type, current_user)
end
- test "get_round_count_for_ammo_types/2 gets accurate round counts for ammo types", %{
- ammo_type: %{id: ammo_type_id} = ammo_type,
+ test "get_round_count_for_types/2 gets accurate round counts for types", %{
+ type: %{id: type_id} = type,
current_user: current_user,
container: container
} do
- {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
- assert %{ammo_type_id => 1} ==
- [ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
+ assert %{type_id => 1} ==
+ [type] |> Ammo.get_round_count_for_types(current_user)
- %{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
+ %{id: another_type_id} = another_type = type_fixture(current_user)
- {1, [_another_pack]} = pack_fixture(%{count: 1}, another_ammo_type, container, current_user)
+ {1, [_another_pack]} = pack_fixture(%{count: 1}, another_type, container, current_user)
- round_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
+ round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
- assert %{^ammo_type_id => 1} = round_counts
- assert %{^another_ammo_type_id => 1} = round_counts
+ assert %{^type_id => 1} = round_counts
+ assert %{^another_type_id => 1} = round_counts
- {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
- round_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
+ round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
- assert %{^ammo_type_id => 51} = round_counts
- assert %{^another_ammo_type_id => 1} = round_counts
+ assert %{^type_id => 51} = round_counts
+ assert %{^another_type_id => 1} = round_counts
shot_record_fixture(%{count: 26}, current_user, pack)
- round_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
+ round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
- assert %{^ammo_type_id => 25} = round_counts
- assert %{^another_ammo_type_id => 1} = round_counts
+ assert %{^type_id => 25} = round_counts
+ assert %{^another_type_id => 1} = round_counts
shot_record_fixture(%{count: 1}, current_user, first_pack)
- round_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_round_count_for_ammo_types(current_user)
+ round_counts = [type, another_type] |> Ammo.get_round_count_for_types(current_user)
- assert %{^ammo_type_id => 24} = round_counts
- assert %{^another_ammo_type_id => 1} = round_counts
+ assert %{^type_id => 24} = round_counts
+ assert %{^another_type_id => 1} = round_counts
end
- test "get_historical_count_for_ammo_type/2 gets accurate total round count for ammo type",
- %{ammo_type: ammo_type, current_user: current_user, container: container} do
- assert 0 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
+ test "get_historical_count_for_type/2 gets accurate total round count for type",
+ %{type: type, current_user: current_user, container: container} do
+ assert 0 = Ammo.get_historical_count_for_type(type, current_user)
- {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
- assert 1 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
+ assert 1 = Ammo.get_historical_count_for_type(type, current_user)
- {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
- assert 51 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
+ assert 51 = Ammo.get_historical_count_for_type(type, current_user)
shot_record_fixture(%{count: 26}, current_user, pack)
- assert 51 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
+ assert 51 = Ammo.get_historical_count_for_type(type, current_user)
shot_record_fixture(%{count: 1}, current_user, first_pack)
- assert 51 = Ammo.get_historical_count_for_ammo_type(ammo_type, current_user)
+ assert 51 = Ammo.get_historical_count_for_type(type, current_user)
end
- test "get_historical_count_for_ammo_types/2 gets accurate total round counts for ammo types",
+ test "get_historical_count_for_types/2 gets accurate total round counts for types",
%{
- ammo_type: %{id: ammo_type_id} = ammo_type,
+ type: %{id: type_id} = type,
current_user: current_user,
container: container
} do
- assert %{} == [ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
+ assert %{} == [type] |> Ammo.get_historical_count_for_types(current_user)
- {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
- assert %{ammo_type_id => 1} ==
- [ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
+ assert %{type_id => 1} ==
+ [type] |> Ammo.get_historical_count_for_types(current_user)
- %{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
+ %{id: another_type_id} = another_type = type_fixture(current_user)
- {1, [_pack]} = pack_fixture(%{count: 1}, another_ammo_type, container, current_user)
+ {1, [_pack]} = pack_fixture(%{count: 1}, another_type, container, current_user)
historical_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
+ [type, another_type] |> Ammo.get_historical_count_for_types(current_user)
- assert %{^ammo_type_id => 1} = historical_counts
- assert %{^another_ammo_type_id => 1} = historical_counts
+ assert %{^type_id => 1} = historical_counts
+ assert %{^another_type_id => 1} = historical_counts
- {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
historical_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
+ [type, another_type] |> Ammo.get_historical_count_for_types(current_user)
- assert %{^ammo_type_id => 51} = historical_counts
- assert %{^another_ammo_type_id => 1} = historical_counts
+ assert %{^type_id => 51} = historical_counts
+ assert %{^another_type_id => 1} = historical_counts
shot_record_fixture(%{count: 26}, current_user, pack)
historical_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
+ [type, another_type] |> Ammo.get_historical_count_for_types(current_user)
- assert %{^ammo_type_id => 51} = historical_counts
- assert %{^another_ammo_type_id => 1} = historical_counts
+ assert %{^type_id => 51} = historical_counts
+ assert %{^another_type_id => 1} = historical_counts
shot_record_fixture(%{count: 1}, current_user, first_pack)
historical_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_historical_count_for_ammo_types(current_user)
+ [type, another_type] |> Ammo.get_historical_count_for_types(current_user)
- assert %{^ammo_type_id => 51} = historical_counts
- assert %{^another_ammo_type_id => 1} = historical_counts
+ assert %{^type_id => 51} = historical_counts
+ assert %{^another_type_id => 1} = historical_counts
end
- test "get_used_packs_count_for_type/2 gets accurate total ammo count for ammo type",
- %{ammo_type: ammo_type, current_user: current_user, container: container} do
- assert 0 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
+ test "get_used_packs_count_for_type/2 gets accurate total ammo count for type",
+ %{type: type, current_user: current_user, container: container} do
+ assert 0 = Ammo.get_used_packs_count_for_type(type, current_user)
- {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
- assert 0 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
+ assert 0 = Ammo.get_used_packs_count_for_type(type, current_user)
- {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
- assert 0 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
+ assert 0 = Ammo.get_used_packs_count_for_type(type, current_user)
shot_record_fixture(%{count: 50}, current_user, pack)
- assert 1 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
+ assert 1 = Ammo.get_used_packs_count_for_type(type, current_user)
shot_record_fixture(%{count: 1}, current_user, first_pack)
- assert 2 = Ammo.get_used_packs_count_for_type(ammo_type, current_user)
+ assert 2 = Ammo.get_used_packs_count_for_type(type, current_user)
end
- test "get_used_packs_count_for_types/2 gets accurate total ammo counts for ammo types",
+ test "get_used_packs_count_for_types/2 gets accurate total ammo counts for types",
%{
- ammo_type: %{id: ammo_type_id} = ammo_type,
+ type: %{id: type_id} = type,
current_user: current_user,
container: container
} do
- # testing empty ammo type
- assert %{} == [ammo_type] |> Ammo.get_used_packs_count_for_types(current_user)
+ # testing empty type
+ assert %{} == [type] |> Ammo.get_used_packs_count_for_types(current_user)
- # testing two empty ammo types
- %{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
+ # testing two empty types
+ %{id: another_type_id} = another_type = type_fixture(current_user)
assert %{} ==
- [ammo_type, another_ammo_type]
+ [type, another_type]
|> Ammo.get_used_packs_count_for_types(current_user)
- # testing ammo type with pack
- {1, [first_pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ # testing type with pack
+ {1, [first_pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert %{} ==
- [ammo_type, another_ammo_type]
+ [type, another_type]
|> Ammo.get_used_packs_count_for_types(current_user)
- # testing ammo type with used pack
- {1, [another_pack]} = pack_fixture(%{count: 50}, another_ammo_type, container, current_user)
+ # testing type with used pack
+ {1, [another_pack]} = pack_fixture(%{count: 50}, another_type, container, current_user)
shot_record_fixture(%{count: 50}, current_user, another_pack)
- assert %{another_ammo_type_id => 1} ==
- [ammo_type, another_ammo_type]
+ assert %{another_type_id => 1} ==
+ [type, another_type]
|> Ammo.get_used_packs_count_for_types(current_user)
- # testing two ammo types with zero and one used packs
- {1, [pack]} = pack_fixture(%{count: 50}, ammo_type, container, current_user)
+ # testing two types with zero and one used packs
+ {1, [pack]} = pack_fixture(%{count: 50}, type, container, current_user)
shot_record_fixture(%{count: 50}, current_user, pack)
- used_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_used_packs_count_for_types(current_user)
+ used_counts = [type, another_type] |> Ammo.get_used_packs_count_for_types(current_user)
- assert %{^ammo_type_id => 1} = used_counts
- assert %{^another_ammo_type_id => 1} = used_counts
+ assert %{^type_id => 1} = used_counts
+ assert %{^another_type_id => 1} = used_counts
- # testing two ammo type with one and two used packs
+ # testing two type with one and two used packs
shot_record_fixture(%{count: 1}, current_user, first_pack)
- used_counts =
- [ammo_type, another_ammo_type] |> Ammo.get_used_packs_count_for_types(current_user)
+ used_counts = [type, another_type] |> Ammo.get_used_packs_count_for_types(current_user)
- assert %{^ammo_type_id => 2} = used_counts
- assert %{^another_ammo_type_id => 1} = used_counts
+ assert %{^type_id => 2} = used_counts
+ assert %{^another_type_id => 1} = used_counts
end
test "get_packs_count_for_container!/2 gets accurate ammo count for container",
- %{ammo_type: ammo_type, current_user: current_user, container: container} do
- {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
+ %{type: type, current_user: current_user, container: container} do
+ {1, [first_pack]} = pack_fixture(%{count: 5}, type, container, current_user)
assert 1 = Ammo.get_packs_count_for_container!(container, current_user)
- {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
assert 26 = Ammo.get_packs_count_for_container!(container, current_user)
@@ -570,15 +558,15 @@ defmodule Cannery.AmmoTest do
end
test "get_packs_count_for_containers/2 gets accurate ammo count for containers", %{
- ammo_type: ammo_type,
+ type: type,
current_user: current_user,
container: %{id: container_id} = container
} do
%{id: another_container_id} = another_container = container_fixture(current_user)
- {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 5}, type, container, current_user)
- {1, [_first_pack]} = pack_fixture(%{count: 5}, ammo_type, another_container, current_user)
+ {1, [_first_pack]} = pack_fixture(%{count: 5}, type, another_container, current_user)
packs_count =
[container, another_container]
@@ -587,7 +575,7 @@ defmodule Cannery.AmmoTest do
assert %{^container_id => 1} = packs_count
assert %{^another_container_id => 1} = packs_count
- {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
packs_count =
[container, another_container]
@@ -616,12 +604,12 @@ defmodule Cannery.AmmoTest do
end
test "get_round_count_for_container!/2 gets accurate total round count for container",
- %{ammo_type: ammo_type, current_user: current_user, container: container} do
- {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
+ %{type: type, current_user: current_user, container: container} do
+ {1, [first_pack]} = pack_fixture(%{count: 5}, type, container, current_user)
assert 5 = Ammo.get_round_count_for_container!(container, current_user)
- {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
assert 130 = Ammo.get_round_count_for_container!(container, current_user)
@@ -631,15 +619,15 @@ defmodule Cannery.AmmoTest do
test "get_round_count_for_containers/2 gets accurate total round count for containers",
%{
- ammo_type: ammo_type,
+ type: type,
current_user: current_user,
container: %{id: container_id} = container
} do
%{id: another_container_id} = another_container = container_fixture(current_user)
- {1, [first_pack]} = pack_fixture(%{count: 5}, ammo_type, container, current_user)
+ {1, [first_pack]} = pack_fixture(%{count: 5}, type, container, current_user)
- {1, [_first_pack]} = pack_fixture(%{count: 5}, ammo_type, another_container, current_user)
+ {1, [_first_pack]} = pack_fixture(%{count: 5}, type, another_container, current_user)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
@@ -647,7 +635,7 @@ defmodule Cannery.AmmoTest do
assert %{^container_id => 5} = round_counts
assert %{^another_container_id => 5} = round_counts
- {25, _packs} = pack_fixture(%{count: 5}, 25, ammo_type, container, current_user)
+ {25, _packs} = pack_fixture(%{count: 5}, 25, type, container, current_user)
round_counts =
[container, another_container] |> Ammo.get_round_count_for_containers(current_user)
@@ -685,20 +673,19 @@ defmodule Cannery.AmmoTest do
setup do
current_user = user_fixture()
- ammo_type = ammo_type_fixture(current_user)
+ type = type_fixture(current_user)
container = container_fixture(current_user)
- {1, [pack]} =
- pack_fixture(%{count: 50, price_paid: 36.1}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{count: 50, price_paid: 36.1}, type, container, current_user)
another_user = user_fixture()
- another_ammo_type = ammo_type_fixture(another_user)
+ another_type = type_fixture(another_user)
another_container = container_fixture(another_user)
- {1, [_shouldnt_show_up]} = pack_fixture(another_ammo_type, another_container, another_user)
+ {1, [_shouldnt_show_up]} = pack_fixture(another_type, another_container, another_user)
[
- ammo_type: ammo_type,
+ type: type,
pack: pack,
container: container,
current_user: current_user
@@ -706,24 +693,23 @@ defmodule Cannery.AmmoTest do
end
test "get_packs_count!/2 returns the correct amount of ammo",
- %{ammo_type: ammo_type, container: container, current_user: current_user} do
+ %{type: type, container: container, current_user: current_user} do
assert Ammo.get_packs_count!(current_user) == 1
- pack_fixture(ammo_type, container, current_user)
+ pack_fixture(type, container, current_user)
assert Ammo.get_packs_count!(current_user) == 2
- pack_fixture(ammo_type, container, current_user)
+ pack_fixture(type, container, current_user)
assert Ammo.get_packs_count!(current_user) == 3
other_user = user_fixture()
assert Ammo.get_packs_count!(other_user) == 0
assert Ammo.get_packs_count!(other_user, true) == 0
- other_ammo_type = ammo_type_fixture(other_user)
+ other_type = type_fixture(other_user)
other_container = container_fixture(other_user)
- {1, [another_pack]} =
- pack_fixture(%{count: 30}, other_ammo_type, other_container, other_user)
+ {1, [another_pack]} = pack_fixture(%{count: 30}, other_type, other_container, other_user)
shot_record_fixture(%{count: 30}, other_user, another_pack)
assert Ammo.get_packs_count!(other_user) == 0
@@ -734,12 +720,12 @@ defmodule Cannery.AmmoTest do
current_user = user_fixture()
container = container_fixture(current_user)
- rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
- shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
- pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
+ rifle_type = type_fixture(%{class: :rifle}, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
+ shotgun_type = type_fixture(%{class: :shotgun}, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
+ pistol_type = type_fixture(%{class: :pistol}, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
assert [^rifle_pack] = Ammo.list_packs(nil, :rifle, current_user, false)
assert [^shotgun_pack] = Ammo.list_packs(nil, :shotgun, current_user, false)
@@ -759,13 +745,13 @@ defmodule Cannery.AmmoTest do
end
test "list_packs/4 returns all relevant packs including used", %{
- ammo_type: ammo_type,
+ type: type,
pack: pack,
container: container,
current_user: current_user
} do
{1, [%{id: another_pack_id} = another_pack]} =
- pack_fixture(%{count: 30}, ammo_type, container, current_user)
+ pack_fixture(%{count: 30}, type, container, current_user)
shot_record_fixture(%{count: 30}, current_user, another_pack)
another_pack = Ammo.get_pack!(another_pack_id, current_user)
@@ -779,25 +765,24 @@ defmodule Cannery.AmmoTest do
end
test "list_packs/4 returns relevant packs when searched", %{
- ammo_type: ammo_type,
+ type: type,
pack: pack,
container: container,
current_user: current_user
} do
{1, [another_pack]} =
%{count: 49, notes: "cool pack"}
- |> pack_fixture(ammo_type, container, current_user)
+ |> pack_fixture(type, container, current_user)
- another_ammo_type = ammo_type_fixture(%{name: "amazing ammo"}, current_user)
+ another_type = type_fixture(%{name: "amazing ammo"}, current_user)
another_container = container_fixture(%{name: "fantastic container"}, current_user)
tag = tag_fixture(%{name: "stupendous tag"}, current_user)
Containers.add_tag!(another_container, tag, current_user)
- {1, [amazing_pack]} = pack_fixture(%{count: 48}, another_ammo_type, container, current_user)
+ {1, [amazing_pack]} = pack_fixture(%{count: 48}, another_type, container, current_user)
- {1, [fantastic_pack]} =
- pack_fixture(%{count: 47}, ammo_type, another_container, current_user)
+ {1, [fantastic_pack]} = pack_fixture(%{count: 47}, type, another_container, current_user)
packs = Ammo.list_packs(nil, :all, current_user, false)
assert Enum.count(packs) == 4
@@ -809,7 +794,7 @@ defmodule Cannery.AmmoTest do
# search works for pack attributes
assert Ammo.list_packs("cool", :all, current_user, true) == [another_pack]
- # search works for ammo type attributes
+ # search works for type attributes
assert Ammo.list_packs("amazing", :all, current_user, true) == [amazing_pack]
# search works for container attributes
@@ -827,31 +812,31 @@ defmodule Cannery.AmmoTest do
container: container,
current_user: current_user
} do
- ammo_type = ammo_type_fixture(current_user)
- {1, [pack]} = pack_fixture(ammo_type, container, current_user)
- assert [^pack] = Ammo.list_packs_for_type(ammo_type, current_user)
+ type = type_fixture(current_user)
+ {1, [pack]} = pack_fixture(type, container, current_user)
+ assert [^pack] = Ammo.list_packs_for_type(type, current_user)
shot_record_fixture(current_user, pack)
pack = Ammo.get_pack!(pack.id, current_user)
- assert [] == Ammo.list_packs_for_type(ammo_type, current_user)
- assert [^pack] = Ammo.list_packs_for_type(ammo_type, current_user, true)
+ assert [] == Ammo.list_packs_for_type(type, current_user)
+ assert [^pack] = Ammo.list_packs_for_type(type, current_user, true)
end
test "list_packs_for_container/3 returns all packs for a container" do
current_user = user_fixture()
container = container_fixture(current_user)
- rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
- shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
- pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
+ rifle_type = type_fixture(%{class: :rifle}, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
+ shotgun_type = type_fixture(%{class: :shotgun}, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
+ pistol_type = type_fixture(%{class: :pistol}, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
another_container = container_fixture(current_user)
- pack_fixture(rifle_ammo_type, another_container, current_user)
- pack_fixture(shotgun_ammo_type, another_container, current_user)
- pack_fixture(pistol_ammo_type, another_container, current_user)
+ pack_fixture(rifle_type, another_container, current_user)
+ pack_fixture(shotgun_type, another_container, current_user)
+ pack_fixture(pistol_type, another_container, current_user)
assert [^rifle_pack] = Ammo.list_packs_for_container(container, :rifle, current_user)
@@ -873,54 +858,54 @@ defmodule Cannery.AmmoTest do
end
test "get_packs_count_for_type/2 returns count of packs for a type", %{
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
- assert 1 = Ammo.get_packs_count_for_type(ammo_type, current_user)
+ assert 1 = Ammo.get_packs_count_for_type(type, current_user)
- another_ammo_type = ammo_type_fixture(current_user)
- assert 0 = Ammo.get_packs_count_for_type(another_ammo_type, current_user)
+ another_type = type_fixture(current_user)
+ assert 0 = Ammo.get_packs_count_for_type(another_type, current_user)
- {5, _packs} = pack_fixture(%{}, 5, ammo_type, container, current_user)
- assert 6 = Ammo.get_packs_count_for_type(ammo_type, current_user)
+ {5, _packs} = pack_fixture(%{}, 5, type, container, current_user)
+ assert 6 = Ammo.get_packs_count_for_type(type, current_user)
end
test "get_packs_count_for_types/2 returns counts of packs for types", %{
- ammo_type: %{id: ammo_type_id} = ammo_type,
+ type: %{id: type_id} = type,
container: container,
current_user: current_user
} do
- assert %{ammo_type_id => 1} ==
- [ammo_type] |> Ammo.get_packs_count_for_types(current_user)
+ assert %{type_id => 1} ==
+ [type] |> Ammo.get_packs_count_for_types(current_user)
- %{id: another_ammo_type_id} = another_ammo_type = ammo_type_fixture(current_user)
+ %{id: another_type_id} = another_type = type_fixture(current_user)
- assert %{ammo_type_id => 1} ==
- [ammo_type, another_ammo_type]
+ assert %{type_id => 1} ==
+ [type, another_type]
|> Ammo.get_packs_count_for_types(current_user)
- {1, [_pack]} = pack_fixture(another_ammo_type, container, current_user)
+ {1, [_pack]} = pack_fixture(another_type, container, current_user)
- packs_count = [ammo_type, another_ammo_type] |> Ammo.get_packs_count_for_types(current_user)
+ packs_count = [type, another_type] |> Ammo.get_packs_count_for_types(current_user)
- assert %{^ammo_type_id => 1} = packs_count
- assert %{^another_ammo_type_id => 1} = packs_count
+ assert %{^type_id => 1} = packs_count
+ assert %{^another_type_id => 1} = packs_count
- {5, _packs} = pack_fixture(%{}, 5, ammo_type, container, current_user)
+ {5, _packs} = pack_fixture(%{}, 5, type, container, current_user)
- packs_count = [ammo_type, another_ammo_type] |> Ammo.get_packs_count_for_types(current_user)
+ packs_count = [type, another_type] |> Ammo.get_packs_count_for_types(current_user)
- assert %{^ammo_type_id => 6} = packs_count
- assert %{^another_ammo_type_id => 1} = packs_count
+ assert %{^type_id => 6} = packs_count
+ assert %{^another_type_id => 1} = packs_count
end
test "list_staged_packs/1 returns all packs that are staged", %{
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
- {1, [another_pack]} = pack_fixture(%{staged: true}, ammo_type, container, current_user)
+ {1, [another_pack]} = pack_fixture(%{staged: true}, type, container, current_user)
assert Ammo.list_staged_packs(current_user) == [another_pack]
end
@@ -932,12 +917,11 @@ defmodule Cannery.AmmoTest do
test "get_packs/2 returns the packs with given id", %{
pack: %{id: pack_id} = pack,
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
- {1, [%{id: another_pack_id} = another_pack]} =
- pack_fixture(ammo_type, container, current_user)
+ {1, [%{id: another_pack_id} = another_pack]} = pack_fixture(type, container, current_user)
packs = Ammo.get_packs([pack_id, another_pack_id], current_user)
assert %{^pack_id => ^pack} = packs
@@ -945,13 +929,13 @@ defmodule Cannery.AmmoTest do
end
test "create_packs/3 with valid data creates a pack", %{
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
assert {:ok, {1, [%Pack{} = pack]}} =
@valid_attrs
- |> Map.merge(%{ammo_type_id: ammo_type.id, container_id: container.id})
+ |> Map.merge(%{type_id: type.id, container_id: container.id})
|> Ammo.create_packs(1, current_user)
assert pack.count == 42
@@ -960,13 +944,13 @@ defmodule Cannery.AmmoTest do
end
test "create_packs/3 with valid data creates multiple packs", %{
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
assert {:ok, {3, packs}} =
@valid_attrs
- |> Map.merge(%{ammo_type_id: ammo_type.id, container_id: container.id})
+ |> Map.merge(%{type_id: type.id, container_id: container.id})
|> Ammo.create_packs(3, current_user)
assert [%Pack{}, %Pack{}, %Pack{}] = packs
@@ -980,10 +964,10 @@ defmodule Cannery.AmmoTest do
end
test "create_packs/3 with invalid data returns error changeset",
- %{ammo_type: ammo_type, container: container, current_user: current_user} do
+ %{type: type, container: container, current_user: current_user} do
assert {:error, %Changeset{}} =
@invalid_attrs
- |> Map.merge(%{ammo_type_id: ammo_type.id, container_id: container.id})
+ |> Map.merge(%{type_id: type.id, container_id: container.id})
|> Ammo.create_packs(1, current_user)
end
@@ -1028,7 +1012,7 @@ defmodule Cannery.AmmoTest do
test "get_percentages_remaining/2 gets accurate total round count", %{
pack: %{id: pack_id} = pack,
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
@@ -1037,7 +1021,7 @@ defmodule Cannery.AmmoTest do
{1, [%{id: another_pack_id} = another_pack]} =
%{count: 50, price_paid: 36.1}
- |> pack_fixture(ammo_type, container, current_user)
+ |> pack_fixture(type, container, current_user)
percentages = [pack, another_pack] |> Ammo.get_percentages_remaining(current_user)
@@ -1070,14 +1054,14 @@ defmodule Cannery.AmmoTest do
end
test "get_cpr/2 gets accurate cpr",
- %{ammo_type: ammo_type, container: container, current_user: current_user} do
- {1, [pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ %{type: type, container: container, current_user: current_user} do
+ {1, [pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert pack |> Ammo.get_cpr(current_user) |> is_nil()
{1, [pack]} =
pack_fixture(
%{count: 1, price_paid: 1.0},
- ammo_type,
+ type,
container,
current_user
)
@@ -1087,7 +1071,7 @@ defmodule Cannery.AmmoTest do
{1, [pack]} =
pack_fixture(
%{count: 2, price_paid: 3.0},
- ammo_type,
+ type,
container,
current_user
)
@@ -1097,7 +1081,7 @@ defmodule Cannery.AmmoTest do
{1, [pack]} =
pack_fixture(
%{count: 50, price_paid: 36.1},
- ammo_type,
+ type,
container,
current_user
)
@@ -1111,14 +1095,14 @@ defmodule Cannery.AmmoTest do
end
test "get_cprs/2 gets accurate cprs",
- %{ammo_type: ammo_type, container: container, current_user: current_user} do
- {1, [pack]} = pack_fixture(%{count: 1}, ammo_type, container, current_user)
+ %{type: type, container: container, current_user: current_user} do
+ {1, [pack]} = pack_fixture(%{count: 1}, type, container, current_user)
assert %{} == [pack] |> Ammo.get_cprs(current_user)
{1, [%{id: pack_id} = pack]} =
pack_fixture(
%{count: 1, price_paid: 1.0},
- ammo_type,
+ type,
container,
current_user
)
@@ -1128,7 +1112,7 @@ defmodule Cannery.AmmoTest do
{1, [%{id: another_pack_id} = another_pack]} =
pack_fixture(
%{count: 2, price_paid: 3.0},
- ammo_type,
+ type,
container,
current_user
)
@@ -1140,7 +1124,7 @@ defmodule Cannery.AmmoTest do
{1, [%{id: yet_another_pack_id} = yet_another_pack]} =
pack_fixture(
%{count: 50, price_paid: 36.1},
- ammo_type,
+ type,
container,
current_user
)
@@ -1181,12 +1165,12 @@ defmodule Cannery.AmmoTest do
test "get_original_counts/2 gets accurate original counts", %{
pack: %{id: pack_id} = pack,
- ammo_type: ammo_type,
+ type: type,
container: container,
current_user: current_user
} do
{1, [%{id: another_pack_id} = another_pack]} =
- pack_fixture(%{count: 25}, ammo_type, container, current_user)
+ pack_fixture(%{count: 25}, type, container, current_user)
original_counts = [pack, another_pack] |> Ammo.get_original_counts(current_user)
assert %{^pack_id => 50} = original_counts
diff --git a/test/cannery_web/controllers/export_controller_test.exs b/test/cannery_web/controllers/export_controller_test.exs
index aca198b..d5b7fcb 100644
--- a/test/cannery_web/controllers/export_controller_test.exs
+++ b/test/cannery_web/controllers/export_controller_test.exs
@@ -11,16 +11,16 @@ defmodule CanneryWeb.ExportControllerTest do
setup [:register_and_log_in_user]
defp add_data(%{current_user: current_user}) do
- ammo_type = ammo_type_fixture(current_user)
+ type = type_fixture(current_user)
container = container_fixture(current_user)
tag = tag_fixture(current_user)
Containers.add_tag!(container, tag, current_user)
- {1, [pack]} = pack_fixture(ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(type, container, current_user)
shot_record = shot_record_fixture(current_user, pack)
pack = pack |> Repo.reload!()
%{
- ammo_type: ammo_type,
+ type: type,
pack: pack,
container: container,
shot_record: shot_record,
@@ -35,7 +35,7 @@ defmodule CanneryWeb.ExportControllerTest do
conn: conn,
current_user: current_user,
container: container,
- ammo_type: ammo_type,
+ type: type,
pack: pack,
shot_record: shot_record,
tag: tag
@@ -43,7 +43,7 @@ defmodule CanneryWeb.ExportControllerTest do
conn = get(conn, Routes.export_path(conn, :export, :json))
ideal_pack = %{
- "ammo_type_id" => pack.ammo_type_id,
+ "type_id" => pack.type_id,
"container_id" => pack.container_id,
"count" => pack.count,
"id" => pack.id,
@@ -56,34 +56,34 @@ defmodule CanneryWeb.ExportControllerTest do
"percentage_remaining" => pack |> Ammo.get_percentage_remaining(current_user)
}
- ideal_ammo_type = %{
- "blank" => ammo_type.blank,
- "bullet_core" => ammo_type.bullet_core,
- "bullet_type" => ammo_type.bullet_type,
- "caliber" => ammo_type.caliber,
- "cartridge" => ammo_type.cartridge,
- "case_material" => ammo_type.case_material,
- "corrosive" => ammo_type.corrosive,
- "desc" => ammo_type.desc,
- "firing_type" => ammo_type.firing_type,
- "grains" => ammo_type.grains,
- "id" => ammo_type.id,
- "incendiary" => ammo_type.incendiary,
- "jacket_type" => ammo_type.jacket_type,
- "manufacturer" => ammo_type.manufacturer,
- "muzzle_velocity" => ammo_type.muzzle_velocity,
- "name" => ammo_type.name,
- "powder_grains_per_charge" => ammo_type.powder_grains_per_charge,
- "powder_type" => ammo_type.powder_type,
- "pressure" => ammo_type.pressure,
- "primer_type" => ammo_type.primer_type,
- "tracer" => ammo_type.tracer,
- "upc" => ammo_type.upc,
- "average_cost" => ammo_type |> Ammo.get_average_cost_for_ammo_type(current_user),
- "round_count" => ammo_type |> Ammo.get_round_count_for_ammo_type(current_user),
- "used_count" => ammo_type |> ActivityLog.get_used_count_for_ammo_type(current_user),
- "pack_count" => ammo_type |> Ammo.get_packs_count_for_type(current_user),
- "total_pack_count" => ammo_type |> Ammo.get_packs_count_for_type(current_user, true)
+ ideal_type = %{
+ "blank" => type.blank,
+ "bullet_core" => type.bullet_core,
+ "bullet_type" => type.bullet_type,
+ "caliber" => type.caliber,
+ "cartridge" => type.cartridge,
+ "case_material" => type.case_material,
+ "corrosive" => type.corrosive,
+ "desc" => type.desc,
+ "firing_type" => type.firing_type,
+ "grains" => type.grains,
+ "id" => type.id,
+ "incendiary" => type.incendiary,
+ "jacket_type" => type.jacket_type,
+ "manufacturer" => type.manufacturer,
+ "muzzle_velocity" => type.muzzle_velocity,
+ "name" => type.name,
+ "powder_grains_per_charge" => type.powder_grains_per_charge,
+ "powder_type" => type.powder_type,
+ "pressure" => type.pressure,
+ "primer_type" => type.primer_type,
+ "tracer" => type.tracer,
+ "upc" => type.upc,
+ "average_cost" => type |> Ammo.get_average_cost_for_type(current_user),
+ "round_count" => type |> Ammo.get_round_count_for_type(current_user),
+ "used_count" => type |> ActivityLog.get_used_count_for_type(current_user),
+ "pack_count" => type |> Ammo.get_packs_count_for_type(current_user),
+ "total_pack_count" => type |> Ammo.get_packs_count_for_type(current_user, true)
}
ideal_container = %{
@@ -125,7 +125,7 @@ defmodule CanneryWeb.ExportControllerTest do
json_resp = conn |> json_response(200)
assert %{"packs" => [^ideal_pack]} = json_resp
- assert %{"ammo_types" => [^ideal_ammo_type]} = json_resp
+ assert %{"types" => [^ideal_type]} = json_resp
assert %{"containers" => [^ideal_container]} = json_resp
assert %{"shot_records" => [^ideal_shot_record]} = json_resp
assert %{"user" => ^ideal_user} = json_resp
diff --git a/test/cannery_web/live/ammo_type_live_test.exs b/test/cannery_web/live/ammo_type_live_test.exs
index 5ab3cff..1dab586 100644
--- a/test/cannery_web/live/ammo_type_live_test.exs
+++ b/test/cannery_web/live/ammo_type_live_test.exs
@@ -1,13 +1,13 @@
-defmodule CanneryWeb.AmmoTypeLiveTest do
+defmodule CanneryWeb.TypeLiveTest do
@moduledoc """
- Tests the ammo type liveview
+ Tests the type liveview
"""
use CanneryWeb.ConnCase
import Phoenix.LiveViewTest
alias Cannery.{Ammo, Repo}
- @moduletag :ammo_type_live_test
+ @moduletag :type_live_test
@create_attrs %{
bullet_type: "some bullet_type",
@@ -42,39 +42,39 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
count: 20
}
- defp create_ammo_type(%{current_user: current_user}) do
- [ammo_type: ammo_type_fixture(@create_attrs, current_user)]
+ defp create_type(%{current_user: current_user}) do
+ [type: type_fixture(@create_attrs, current_user)]
end
- defp create_pack(%{ammo_type: ammo_type, current_user: current_user}) do
+ defp create_pack(%{type: type, current_user: current_user}) do
container = container_fixture(current_user)
- {1, [pack]} = pack_fixture(@pack_attrs, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(@pack_attrs, type, container, current_user)
[pack: pack, container: container]
end
- defp create_empty_pack(%{ammo_type: ammo_type, current_user: current_user}) do
+ defp create_empty_pack(%{type: type, current_user: current_user}) do
container = container_fixture(current_user)
- {1, [pack]} = pack_fixture(@pack_attrs, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(@pack_attrs, type, container, current_user)
shot_record = shot_record_fixture(@shot_record_attrs, current_user, pack)
pack = pack |> Repo.reload!()
[pack: pack, container: container, shot_record: shot_record]
end
describe "Index" do
- setup [:register_and_log_in_user, :create_ammo_type]
+ setup [:register_and_log_in_user, :create_type]
- test "lists all ammo_types", %{conn: conn, ammo_type: ammo_type} do
- {:ok, _index_live, html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ test "lists all types", %{conn: conn, type: type} do
+ {:ok, _index_live, html} = live(conn, Routes.type_index_path(conn, :index))
assert html =~ "Catalog"
- assert html =~ ammo_type.bullet_type
+ assert html =~ type.bullet_type
end
test "can sort by class", %{conn: conn, current_user: current_user} do
- rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
- shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
+ rifle_type = type_fixture(%{class: :rifle}, current_user)
+ shotgun_type = type_fixture(%{class: :shotgun}, current_user)
+ pistol_type = type_fixture(%{class: :pistol}, current_user)
- {:ok, index_live, html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ {:ok, index_live, html} = live(conn, Routes.type_index_path(conn, :index))
assert html =~ "All"
@@ -85,7 +85,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :rifle})
+ |> render_change(type: %{class: :rifle})
assert html =~ rifle_type.name
refute html =~ shotgun_type.name
@@ -94,7 +94,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :shotgun})
+ |> render_change(type: %{class: :shotgun})
refute html =~ rifle_type.name
assert html =~ shotgun_type.name
@@ -103,7 +103,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :pistol})
+ |> render_change(type: %{class: :pistol})
refute html =~ rifle_type.name
refute html =~ shotgun_type.name
@@ -112,148 +112,148 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :all})
+ |> render_change(type: %{class: :all})
assert html =~ rifle_type.name
assert html =~ shotgun_type.name
assert html =~ pistol_type.name
end
- test "can search for ammo_type", %{conn: conn, ammo_type: ammo_type} do
- {:ok, index_live, html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ test "can search for type", %{conn: conn, type: type} do
+ {:ok, index_live, html} = live(conn, Routes.type_index_path(conn, :index))
- assert html =~ ammo_type.bullet_type
+ assert html =~ type.bullet_type
assert index_live
|> form(~s/form[phx-change="search"]/)
- |> render_change(search: %{search_term: ammo_type.bullet_type}) =~
- ammo_type.bullet_type
+ |> render_change(search: %{search_term: type.bullet_type}) =~
+ type.bullet_type
- assert_patch(index_live, Routes.ammo_type_index_path(conn, :search, ammo_type.bullet_type))
+ assert_patch(index_live, Routes.type_index_path(conn, :search, type.bullet_type))
refute index_live
|> form(~s/form[phx-change="search"]/)
- |> render_change(search: %{search_term: "something_else"}) =~ ammo_type.bullet_type
+ |> render_change(search: %{search_term: "something_else"}) =~ type.bullet_type
- assert_patch(index_live, Routes.ammo_type_index_path(conn, :search, "something_else"))
+ assert_patch(index_live, Routes.type_index_path(conn, :search, "something_else"))
assert index_live
|> form(~s/form[phx-change="search"]/)
- |> render_change(search: %{search_term: ""}) =~ ammo_type.bullet_type
+ |> render_change(search: %{search_term: ""}) =~ type.bullet_type
- assert_patch(index_live, Routes.ammo_type_index_path(conn, :index))
+ assert_patch(index_live, Routes.type_index_path(conn, :index))
end
- test "saves new ammo_type", %{conn: conn, current_user: current_user, ammo_type: ammo_type} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ test "saves new type", %{conn: conn, current_user: current_user, type: type} do
+ {:ok, index_live, _html} = live(conn, Routes.type_index_path(conn, :index))
- assert index_live |> element("a", "New Ammo type") |> render_click() =~ "New Ammo type"
- assert_patch(index_live, Routes.ammo_type_index_path(conn, :new))
+ assert index_live |> element("a", "New Type") |> render_click() =~ "New Type"
+ assert_patch(index_live, Routes.type_index_path(conn, :new))
assert index_live
- |> form("#ammo_type-form")
- |> render_change(ammo_type: @invalid_attrs) =~ "can't be blank"
+ |> form("#type-form")
+ |> render_change(type: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_type-form")
- |> render_submit(ammo_type: @create_attrs)
- |> follow_redirect(conn, Routes.ammo_type_index_path(conn, :index))
+ |> form("#type-form")
+ |> render_submit(type: @create_attrs)
+ |> follow_redirect(conn, Routes.type_index_path(conn, :index))
- ammo_type = ammo_type.id |> Ammo.get_ammo_type!(current_user)
- assert html =~ "#{ammo_type.name} created successfully"
+ type = type.id |> Ammo.get_type!(current_user)
+ assert html =~ "#{type.name} created successfully"
assert html =~ "some bullet_type"
end
- test "updates ammo_type in listing",
- %{conn: conn, current_user: current_user, ammo_type: ammo_type} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ test "updates type in listing",
+ %{conn: conn, current_user: current_user, type: type} do
+ {:ok, index_live, _html} = live(conn, Routes.type_index_path(conn, :index))
- assert index_live |> element(~s/a[aria-label="Edit #{ammo_type.name}"]/) |> render_click() =~
- "Edit #{ammo_type.name}"
+ assert index_live |> element(~s/a[aria-label="Edit #{type.name}"]/) |> render_click() =~
+ "Edit #{type.name}"
- assert_patch(index_live, Routes.ammo_type_index_path(conn, :edit, ammo_type))
+ assert_patch(index_live, Routes.type_index_path(conn, :edit, type))
assert index_live
- |> form("#ammo_type-form")
- |> render_change(ammo_type: @invalid_attrs) =~ "can't be blank"
+ |> form("#type-form")
+ |> render_change(type: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_type-form")
- |> render_submit(ammo_type: @update_attrs)
- |> follow_redirect(conn, Routes.ammo_type_index_path(conn, :index))
+ |> form("#type-form")
+ |> render_submit(type: @update_attrs)
+ |> follow_redirect(conn, Routes.type_index_path(conn, :index))
- ammo_type = ammo_type.id |> Ammo.get_ammo_type!(current_user)
- assert html =~ "#{ammo_type.name} updated successfully"
+ type = type.id |> Ammo.get_type!(current_user)
+ assert html =~ "#{type.name} updated successfully"
assert html =~ "some updated bullet_type"
end
- test "clones ammo_type in listing",
- %{conn: conn, current_user: current_user, ammo_type: ammo_type} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ test "clones type in listing",
+ %{conn: conn, current_user: current_user, type: type} do
+ {:ok, index_live, _html} = live(conn, Routes.type_index_path(conn, :index))
- html = index_live |> element(~s/a[aria-label="Clone #{ammo_type.name}"]/) |> render_click()
- assert html =~ "New Ammo type"
+ html = index_live |> element(~s/a[aria-label="Clone #{type.name}"]/) |> render_click()
+ assert html =~ "New Type"
assert html =~ "some bullet_type"
- assert_patch(index_live, Routes.ammo_type_index_path(conn, :clone, ammo_type))
+ assert_patch(index_live, Routes.type_index_path(conn, :clone, type))
assert index_live
- |> form("#ammo_type-form")
- |> render_change(ammo_type: @invalid_attrs) =~ "can't be blank"
+ |> form("#type-form")
+ |> render_change(type: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_type-form")
- |> render_submit(ammo_type: @create_attrs)
- |> follow_redirect(conn, Routes.ammo_type_index_path(conn, :index))
+ |> form("#type-form")
+ |> render_submit(type: @create_attrs)
+ |> follow_redirect(conn, Routes.type_index_path(conn, :index))
- ammo_type = ammo_type.id |> Ammo.get_ammo_type!(current_user)
- assert html =~ "#{ammo_type.name} created successfully"
+ type = type.id |> Ammo.get_type!(current_user)
+ assert html =~ "#{type.name} created successfully"
assert html =~ "some bullet_type"
end
- test "clones ammo_type in listing with updates",
- %{conn: conn, current_user: current_user, ammo_type: ammo_type} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ test "clones type in listing with updates",
+ %{conn: conn, current_user: current_user, type: type} do
+ {:ok, index_live, _html} = live(conn, Routes.type_index_path(conn, :index))
- html = index_live |> element(~s/a[aria-label="Clone #{ammo_type.name}"]/) |> render_click()
- assert html =~ "New Ammo type"
+ html = index_live |> element(~s/a[aria-label="Clone #{type.name}"]/) |> render_click()
+ assert html =~ "New Type"
assert html =~ "some bullet_type"
- assert_patch(index_live, Routes.ammo_type_index_path(conn, :clone, ammo_type))
+ assert_patch(index_live, Routes.type_index_path(conn, :clone, type))
assert index_live
- |> form("#ammo_type-form")
- |> render_change(ammo_type: @invalid_attrs) =~ "can't be blank"
+ |> form("#type-form")
+ |> render_change(type: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
index_live
- |> form("#ammo_type-form")
+ |> form("#type-form")
|> render_submit(
- ammo_type: Map.merge(@create_attrs, %{bullet_type: "some updated bullet_type"})
+ type: Map.merge(@create_attrs, %{bullet_type: "some updated bullet_type"})
)
- |> follow_redirect(conn, Routes.ammo_type_index_path(conn, :index))
+ |> follow_redirect(conn, Routes.type_index_path(conn, :index))
- ammo_type = ammo_type.id |> Ammo.get_ammo_type!(current_user)
- assert html =~ "#{ammo_type.name} created successfully"
+ type = type.id |> Ammo.get_type!(current_user)
+ assert html =~ "#{type.name} created successfully"
assert html =~ "some updated bullet_type"
end
- test "deletes ammo_type in listing", %{conn: conn, ammo_type: ammo_type} do
- {:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
- assert index_live |> element(~s/a[aria-label="Delete #{ammo_type.name}"]/) |> render_click()
- refute has_element?(index_live, "#ammo_type-#{ammo_type.id}")
+ test "deletes type in listing", %{conn: conn, type: type} do
+ {:ok, index_live, _html} = live(conn, Routes.type_index_path(conn, :index))
+ assert index_live |> element(~s/a[aria-label="Delete #{type.name}"]/) |> render_click()
+ refute has_element?(index_live, "#type-#{type.id}")
end
end
describe "Index with pack" do
- setup [:register_and_log_in_user, :create_ammo_type, :create_pack]
+ setup [:register_and_log_in_user, :create_type, :create_pack]
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))
+ {:ok, index_live, html} = live(conn, Routes.type_index_path(conn, :index))
assert html =~ "Show used"
refute html =~ "Used rounds"
@@ -277,7 +277,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
shot_record_fixture(%{count: 5}, current_user, pack)
- {:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
+ {:ok, index_live, _html} = live(conn, Routes.type_index_path(conn, :index))
html =
index_live
@@ -289,62 +289,62 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
end
end
- describe "Show ammo type" do
- setup [:register_and_log_in_user, :create_ammo_type]
+ describe "Show type" do
+ setup [:register_and_log_in_user, :create_type]
- test "displays ammo_type", %{
+ test "displays type", %{
conn: conn,
- ammo_type: %{name: name, bullet_type: bullet_type} = ammo_type
+ type: %{name: name, bullet_type: bullet_type} = type
} do
- {:ok, _show_live, html} = live(conn, Routes.ammo_type_show_path(conn, :show, ammo_type))
+ {:ok, _show_live, html} = live(conn, Routes.type_show_path(conn, :show, type))
assert html =~ name
assert html =~ bullet_type
end
- test "updates ammo_type within modal",
- %{conn: conn, current_user: current_user, ammo_type: %{name: name} = ammo_type} do
- {:ok, show_live, _html} = live(conn, Routes.ammo_type_show_path(conn, :show, ammo_type))
+ test "updates type within modal",
+ %{conn: conn, current_user: current_user, type: %{name: name} = type} do
+ {:ok, show_live, _html} = live(conn, Routes.type_show_path(conn, :show, type))
- assert show_live |> element(~s/a[aria-label="Edit #{ammo_type.name}"]/) |> render_click() =~
+ assert show_live |> element(~s/a[aria-label="Edit #{type.name}"]/) |> render_click() =~
"Edit #{name}"
- assert_patch(show_live, Routes.ammo_type_show_path(conn, :edit, ammo_type))
+ assert_patch(show_live, Routes.type_show_path(conn, :edit, type))
assert show_live
- |> form("#ammo_type-form")
- |> render_change(ammo_type: @invalid_attrs) =~ "can't be blank"
+ |> form("#type-form")
+ |> render_change(type: @invalid_attrs) =~ "can't be blank"
{:ok, _view, html} =
show_live
- |> form("#ammo_type-form")
- |> render_submit(ammo_type: @update_attrs)
- |> follow_redirect(conn, Routes.ammo_type_show_path(conn, :show, ammo_type))
+ |> form("#type-form")
+ |> render_submit(type: @update_attrs)
+ |> follow_redirect(conn, Routes.type_show_path(conn, :show, type))
- ammo_type = ammo_type.id |> Ammo.get_ammo_type!(current_user)
- assert html =~ "#{ammo_type.name} updated successfully"
+ type = type.id |> Ammo.get_type!(current_user)
+ assert html =~ "#{type.name} updated successfully"
assert html =~ "some updated bullet_type"
end
end
- describe "Show ammo type with pack" do
- setup [:register_and_log_in_user, :create_ammo_type, :create_pack]
+ describe "Show type with pack" do
+ setup [:register_and_log_in_user, :create_type, :create_pack]
test "displays pack", %{
conn: conn,
- ammo_type: %{name: ammo_type_name} = ammo_type,
+ type: %{name: type_name} = type,
container: %{name: container_name}
} do
- {:ok, _show_live, html} = live(conn, Routes.ammo_type_show_path(conn, :show, ammo_type))
+ {:ok, _show_live, html} = live(conn, Routes.type_show_path(conn, :show, type))
- assert html =~ ammo_type_name
+ assert html =~ type_name
assert html =~ "\n20\n"
assert html =~ container_name
end
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))
+ %{conn: conn, type: type, container: %{name: container_name}} do
+ {:ok, show_live, _html} = live(conn, Routes.type_show_path(conn, :show, type))
html =
show_live
@@ -356,12 +356,12 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
end
end
- describe "Show ammo type with empty pack" do
- setup [:register_and_log_in_user, :create_ammo_type, :create_empty_pack]
+ describe "Show type with empty pack" do
+ setup [:register_and_log_in_user, :create_type, :create_empty_pack]
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))
+ %{conn: conn, type: type, container: %{name: container_name}} do
+ {:ok, show_live, html} = live(conn, Routes.type_show_path(conn, :show, type))
assert html =~ "Show used"
refute html =~ "\n20\n"
@@ -376,8 +376,8 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
end
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))
+ %{conn: conn, type: type, container: %{name: container_name}} do
+ {:ok, show_live, _html} = live(conn, Routes.type_show_path(conn, :show, type))
html =
show_live
diff --git a/test/cannery_web/live/container_live_test.exs b/test/cannery_web/live/container_live_test.exs
index 7908760..9c0bafa 100644
--- a/test/cannery_web/live/container_live_test.exs
+++ b/test/cannery_web/live/container_live_test.exs
@@ -22,7 +22,7 @@ defmodule CanneryWeb.ContainerLiveTest do
type: "some updated type"
}
@invalid_attrs %{desc: nil, location: nil, name: nil, type: nil}
- @ammo_type_attrs %{
+ @type_attrs %{
bullet_type: "some bullet_type",
case_material: "some case_material",
desc: "some desc",
@@ -41,10 +41,10 @@ defmodule CanneryWeb.ContainerLiveTest do
end
defp create_pack(%{container: container, current_user: current_user}) do
- ammo_type = ammo_type_fixture(@ammo_type_attrs, current_user)
- {1, [pack]} = pack_fixture(@pack_attrs, ammo_type, container, current_user)
+ type = type_fixture(@type_attrs, current_user)
+ {1, [pack]} = pack_fixture(@pack_attrs, type, container, current_user)
- [ammo_type: ammo_type, pack: pack]
+ [type: type, pack: pack]
end
describe "Index" do
@@ -245,56 +245,56 @@ defmodule CanneryWeb.ContainerLiveTest do
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
- rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
+ rifle_type = type_fixture(%{class: :rifle}, current_user)
{1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
- shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
+ shotgun_type = type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
- pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
+ pistol_type = type_fixture(%{class: :pistol}, current_user)
{1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
{:ok, index_live, html} = live(conn, Routes.container_show_path(conn, :show, container))
assert html =~ "All"
- assert html =~ rifle_pack.ammo_type.name
- assert html =~ shotgun_pack.ammo_type.name
- assert html =~ pistol_pack.ammo_type.name
+ assert html =~ rifle_pack.type.name
+ assert html =~ shotgun_pack.type.name
+ assert html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :rifle})
+ |> render_change(type: %{class: :rifle})
- assert html =~ rifle_pack.ammo_type.name
- refute html =~ shotgun_pack.ammo_type.name
- refute html =~ pistol_pack.ammo_type.name
+ assert html =~ rifle_pack.type.name
+ refute html =~ shotgun_pack.type.name
+ refute html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :shotgun})
+ |> render_change(type: %{class: :shotgun})
- refute html =~ rifle_pack.ammo_type.name
- assert html =~ shotgun_pack.ammo_type.name
- refute html =~ pistol_pack.ammo_type.name
+ refute html =~ rifle_pack.type.name
+ assert html =~ shotgun_pack.type.name
+ refute html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :pistol})
+ |> render_change(type: %{class: :pistol})
- refute html =~ rifle_pack.ammo_type.name
- refute html =~ shotgun_pack.ammo_type.name
- assert html =~ pistol_pack.ammo_type.name
+ refute html =~ rifle_pack.type.name
+ refute html =~ shotgun_pack.type.name
+ assert html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :all})
+ |> render_change(type: %{class: :all})
- assert html =~ rifle_pack.ammo_type.name
- assert html =~ shotgun_pack.ammo_type.name
- assert html =~ pistol_pack.ammo_type.name
+ assert html =~ rifle_pack.type.name
+ assert html =~ shotgun_pack.type.name
+ assert html =~ pistol_pack.type.name
end
end
@@ -302,15 +302,15 @@ defmodule CanneryWeb.ContainerLiveTest do
setup [:register_and_log_in_user, :create_container, :create_pack]
test "displays pack",
- %{conn: conn, ammo_type: %{name: ammo_type_name}, container: container} do
+ %{conn: conn, type: %{name: type_name}, container: container} do
{:ok, _show_live, html} = live(conn, Routes.container_show_path(conn, :show, container))
- assert html =~ ammo_type_name
+ assert html =~ type_name
assert html =~ "\n20\n"
end
test "displays pack in table",
- %{conn: conn, ammo_type: %{name: ammo_type_name}, container: container} do
+ %{conn: conn, type: %{name: type_name}, container: container} do
{:ok, show_live, _html} = live(conn, Routes.container_show_path(conn, :show, container))
html =
@@ -318,7 +318,7 @@ defmodule CanneryWeb.ContainerLiveTest do
|> element(~s/input[type="checkbox"][aria-labelledby="toggle_table-label"}]/)
|> render_click()
- assert html =~ ammo_type_name
+ assert html =~ type_name
assert html =~ "\n20\n"
end
end
diff --git a/test/cannery_web/live/pack_live_test.exs b/test/cannery_web/live/pack_live_test.exs
index 43e5f06..f11c8e1 100644
--- a/test/cannery_web/live/pack_live_test.exs
+++ b/test/cannery_web/live/pack_live_test.exs
@@ -29,10 +29,10 @@ defmodule CanneryWeb.PackLiveTest do
}
defp create_pack(%{current_user: current_user}) do
- ammo_type = ammo_type_fixture(current_user)
+ type = type_fixture(current_user)
container = container_fixture(current_user)
- {1, [pack]} = pack_fixture(@create_attrs, ammo_type, container, current_user)
- [ammo_type: ammo_type, pack: pack, container: container]
+ {1, [pack]} = pack_fixture(@create_attrs, type, container, current_user)
+ [type: type, pack: pack, container: container]
end
defp create_shot_record(%{current_user: current_user, pack: pack}) do
@@ -43,10 +43,10 @@ defmodule CanneryWeb.PackLiveTest do
defp create_empty_pack(%{
current_user: current_user,
- ammo_type: ammo_type,
+ type: type,
container: container
}) do
- {1, [pack]} = pack_fixture(@empty_attrs, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(@empty_attrs, type, container, current_user)
shot_record = shot_record_fixture(@shot_record_attrs, current_user, pack)
pack = pack |> Repo.reload!()
[empty_pack: pack, shot_record: shot_record]
@@ -57,92 +57,92 @@ defmodule CanneryWeb.PackLiveTest do
test "lists all packs", %{conn: conn, pack: pack} do
{:ok, _index_live, html} = live(conn, Routes.pack_index_path(conn, :index))
- pack = pack |> Repo.preload(:ammo_type)
+ pack = pack |> Repo.preload(:type)
assert html =~ "Ammo"
- assert html =~ pack.ammo_type.name
+ assert html =~ pack.type.name
end
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
- rifle_type = ammo_type_fixture(%{class: :rifle}, current_user)
+ rifle_type = type_fixture(%{class: :rifle}, current_user)
{1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
- shotgun_type = ammo_type_fixture(%{class: :shotgun}, current_user)
+ shotgun_type = type_fixture(%{class: :shotgun}, current_user)
{1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
- pistol_type = ammo_type_fixture(%{class: :pistol}, current_user)
+ pistol_type = type_fixture(%{class: :pistol}, current_user)
{1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
{:ok, index_live, html} = live(conn, Routes.pack_index_path(conn, :index))
assert html =~ "All"
- assert html =~ rifle_pack.ammo_type.name
- assert html =~ shotgun_pack.ammo_type.name
- assert html =~ pistol_pack.ammo_type.name
+ assert html =~ rifle_pack.type.name
+ assert html =~ shotgun_pack.type.name
+ assert html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :rifle})
+ |> render_change(type: %{class: :rifle})
- assert html =~ rifle_pack.ammo_type.name
- refute html =~ shotgun_pack.ammo_type.name
- refute html =~ pistol_pack.ammo_type.name
+ assert html =~ rifle_pack.type.name
+ refute html =~ shotgun_pack.type.name
+ refute html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :shotgun})
+ |> render_change(type: %{class: :shotgun})
- refute html =~ rifle_pack.ammo_type.name
- assert html =~ shotgun_pack.ammo_type.name
- refute html =~ pistol_pack.ammo_type.name
+ refute html =~ rifle_pack.type.name
+ assert html =~ shotgun_pack.type.name
+ refute html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :pistol})
+ |> render_change(type: %{class: :pistol})
- refute html =~ rifle_pack.ammo_type.name
- refute html =~ shotgun_pack.ammo_type.name
- assert html =~ pistol_pack.ammo_type.name
+ refute html =~ rifle_pack.type.name
+ refute html =~ shotgun_pack.type.name
+ assert html =~ pistol_pack.type.name
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :all})
+ |> render_change(type: %{class: :all})
- assert html =~ rifle_pack.ammo_type.name
- assert html =~ shotgun_pack.ammo_type.name
- assert html =~ pistol_pack.ammo_type.name
+ assert html =~ rifle_pack.type.name
+ assert html =~ shotgun_pack.type.name
+ assert html =~ pistol_pack.type.name
end
test "can search for packs", %{conn: conn, pack: pack} do
{:ok, index_live, html} = live(conn, Routes.pack_index_path(conn, :index))
- pack = pack |> Repo.preload(:ammo_type)
+ pack = pack |> Repo.preload(:type)
- assert html =~ pack.ammo_type.name
+ assert html =~ pack.type.name
assert index_live
|> form(~s/form[phx-change="search"]/)
- |> render_change(search: %{search_term: pack.ammo_type.name}) =~
- pack.ammo_type.name
+ |> render_change(search: %{search_term: pack.type.name}) =~
+ pack.type.name
assert_patch(
index_live,
- Routes.pack_index_path(conn, :search, pack.ammo_type.name)
+ Routes.pack_index_path(conn, :search, pack.type.name)
)
refute index_live
|> form(~s/form[phx-change="search"]/)
|> render_change(search: %{search_term: "something_else"}) =~
- pack.ammo_type.name
+ pack.type.name
assert_patch(index_live, Routes.pack_index_path(conn, :search, "something_else"))
assert index_live
|> form(~s/form[phx-change="search"]/)
- |> render_change(search: %{search_term: ""}) =~ pack.ammo_type.name
+ |> render_change(search: %{search_term: ""}) =~ pack.type.name
assert_patch(index_live, Routes.pack_index_path(conn, :index))
end
@@ -366,9 +366,9 @@ defmodule CanneryWeb.PackLiveTest do
test "displays pack", %{conn: conn, pack: pack} do
{:ok, _show_live, html} = live(conn, Routes.pack_show_path(conn, :show, pack))
- pack = pack |> Repo.preload(:ammo_type)
+ pack = pack |> Repo.preload(:type)
assert html =~ "Show Ammo"
- assert html =~ pack.ammo_type.name
+ assert html =~ pack.type.name
end
test "updates pack within modal", %{conn: conn, pack: pack} do
diff --git a/test/cannery_web/live/range_live_test.exs b/test/cannery_web/live/range_live_test.exs
index b7e8385..69f57c1 100644
--- a/test/cannery_web/live/range_live_test.exs
+++ b/test/cannery_web/live/range_live_test.exs
@@ -14,9 +14,9 @@ defmodule CanneryWeb.RangeLiveTest do
defp create_shot_record(%{current_user: current_user}) do
container = container_fixture(%{staged: true}, current_user)
- ammo_type = ammo_type_fixture(current_user)
+ type = type_fixture(current_user)
- {1, [pack]} = pack_fixture(%{staged: true}, ammo_type, container, current_user)
+ {1, [pack]} = pack_fixture(%{staged: true}, type, container, current_user)
shot_record =
%{count: 5, date: ~N[2022-02-13 03:17:00], notes: "some notes"}
@@ -24,7 +24,7 @@ defmodule CanneryWeb.RangeLiveTest do
[
container: container,
- ammo_type: ammo_type,
+ type: type,
pack: pack,
shot_record: shot_record
]
@@ -42,18 +42,18 @@ defmodule CanneryWeb.RangeLiveTest do
test "can sort by type",
%{conn: conn, container: container, current_user: current_user} do
- rifle_ammo_type = ammo_type_fixture(%{class: :rifle}, current_user)
- {1, [rifle_pack]} = pack_fixture(rifle_ammo_type, container, current_user)
+ rifle_type = type_fixture(%{class: :rifle}, current_user)
+ {1, [rifle_pack]} = pack_fixture(rifle_type, container, current_user)
rifle_shot_record = shot_record_fixture(%{notes: "group_one"}, current_user, rifle_pack)
- shotgun_ammo_type = ammo_type_fixture(%{class: :shotgun}, current_user)
- {1, [shotgun_pack]} = pack_fixture(shotgun_ammo_type, container, current_user)
+ shotgun_type = type_fixture(%{class: :shotgun}, current_user)
+ {1, [shotgun_pack]} = pack_fixture(shotgun_type, container, current_user)
shotgun_shot_record = shot_record_fixture(%{notes: "group_two"}, current_user, shotgun_pack)
- pistol_ammo_type = ammo_type_fixture(%{class: :pistol}, current_user)
- {1, [pistol_pack]} = pack_fixture(pistol_ammo_type, container, current_user)
+ pistol_type = type_fixture(%{class: :pistol}, current_user)
+ {1, [pistol_pack]} = pack_fixture(pistol_type, container, current_user)
pistol_shot_record = shot_record_fixture(%{notes: "group_three"}, current_user, pistol_pack)
@@ -68,7 +68,7 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :rifle})
+ |> render_change(type: %{class: :rifle})
assert html =~ rifle_shot_record.notes
refute html =~ shotgun_shot_record.notes
@@ -77,7 +77,7 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :shotgun})
+ |> render_change(type: %{class: :shotgun})
refute html =~ rifle_shot_record.notes
assert html =~ shotgun_shot_record.notes
@@ -86,7 +86,7 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :pistol})
+ |> render_change(type: %{class: :pistol})
refute html =~ rifle_shot_record.notes
refute html =~ shotgun_shot_record.notes
@@ -95,7 +95,7 @@ defmodule CanneryWeb.RangeLiveTest do
html =
index_live
|> form(~s/form[phx-change="change_class"]/)
- |> render_change(ammo_type: %{class: :all})
+ |> render_change(type: %{class: :all})
assert html =~ rifle_shot_record.notes
assert html =~ shotgun_shot_record.notes
diff --git a/test/support/fixtures.ex b/test/support/fixtures.ex
index f3b2341..c1d9334 100644
--- a/test/support/fixtures.ex
+++ b/test/support/fixtures.ex
@@ -10,8 +10,8 @@ defmodule Cannery.Fixtures do
Accounts.User,
ActivityLog.ShotRecord,
Ammo,
- Ammo.AmmoType,
Ammo.Pack,
+ Ammo.Type,
Containers,
Containers.Container,
Containers.Tag,
@@ -102,11 +102,11 @@ defmodule Cannery.Fixtures do
end
@doc """
- Generate a AmmoType
+ Generate a Type
"""
- @spec ammo_type_fixture(User.t()) :: AmmoType.t()
- @spec ammo_type_fixture(attrs :: map(), User.t()) :: AmmoType.t()
- def ammo_type_fixture(attrs \\ %{}, %User{} = user) do
+ @spec type_fixture(User.t()) :: Type.t()
+ @spec type_fixture(attrs :: map(), User.t()) :: Type.t()
+ def type_fixture(attrs \\ %{}, %User{} = user) do
attrs
|> Enum.into(%{
name: random_string(),
@@ -142,34 +142,34 @@ defmodule Cannery.Fixtures do
manufacturer: random_string(),
upc: random_string()
})
- |> Ammo.create_ammo_type(user)
+ |> Ammo.create_type(user)
|> unwrap_ok_tuple()
end
@doc """
Generate a Pack
"""
- @spec pack_fixture(AmmoType.t(), Container.t(), User.t()) ::
+ @spec pack_fixture(Type.t(), Container.t(), User.t()) ::
{count :: non_neg_integer(), [Pack.t()]}
- @spec pack_fixture(attrs :: map(), AmmoType.t(), Container.t(), User.t()) ::
+ @spec pack_fixture(attrs :: map(), Type.t(), Container.t(), User.t()) ::
{count :: non_neg_integer(), [Pack.t()]}
@spec pack_fixture(
attrs :: map(),
multiplier :: non_neg_integer(),
- AmmoType.t(),
+ Type.t(),
Container.t(),
User.t()
) :: {count :: non_neg_integer(), [Pack.t()]}
def pack_fixture(
attrs \\ %{},
multiplier \\ 1,
- %AmmoType{id: ammo_type_id},
+ %Type{id: type_id},
%Container{id: container_id},
%User{} = user
) do
attrs
|> Enum.into(%{
- ammo_type_id: ammo_type_id,
+ type_id: type_id,
container_id: container_id,
count: 20,
purchased_on: Date.utc_today()