add search to catalog index

This commit is contained in:
shibao 2022-12-03 19:30:52 -05:00
parent 2ec60ba342
commit 7191fe8e4b
28 changed files with 551 additions and 293 deletions

View File

@ -1,3 +1,7 @@
# v0.8.0
- Add search to catalog
- Tweak urls for ammo types
# v0.7.2
- Code improvements

View File

@ -20,11 +20,38 @@ defmodule Cannery.Ammo do
iex> list_ammo_types(%User{id: 123})
[%AmmoType{}, ...]
iex> list_ammo_types("cool", %User{id: 123})
[%AmmoType{name: "My cool ammo type"}, ...]
"""
@spec list_ammo_types(User.t()) :: [AmmoType.t()]
def list_ammo_types(%User{id: user_id}),
@spec list_ammo_types(search :: nil | String.t(), User.t()) :: [AmmoType.t()]
def list_ammo_types(search \\ nil, user)
def list_ammo_types(search, %{id: user_id}) when search |> is_nil() or search == "",
do: Repo.all(from at in AmmoType, where: at.user_id == ^user_id, order_by: at.name)
def list_ammo_types(search, %{id: user_id}) when search |> is_binary() do
trimmed_search = String.trim(search)
Repo.all(
from at in AmmoType,
where: at.user_id == ^user_id,
where:
fragment(
"search @@ websearch_to_tsquery('english', ?)",
^trimmed_search
),
order_by: {
:desc,
fragment(
"ts_rank_cd(search, websearch_to_tsquery('english', ?), 4)",
^trimmed_search
)
}
)
end
@doc """
Returns a count of ammo_types.

View File

@ -104,6 +104,7 @@ defmodule CanneryWeb do
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import CanneryWeb.{ErrorHelpers, Gettext, LiveHelpers, ViewHelpers}
alias CanneryWeb.Endpoint
alias CanneryWeb.Router.Helpers, as: Routes
end
end

View File

@ -4,13 +4,15 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
"""
use CanneryWeb, :live_view
alias Cannery.{Ammo, Ammo.AmmoType}
alias CanneryWeb.Endpoint
@impl true
def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(show_used: false, search: search) |> list_ammo_types()}
end
def mount(_params, _session, socket) do
{:ok, socket |> assign(:show_used, false) |> list_ammo_types()}
{:ok, socket |> assign(show_used: false, search: nil) |> list_ammo_types()}
end
@impl true
@ -19,25 +21,49 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
end
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
%{name: ammo_type_name} = ammo_type = Ammo.get_ammo_type!(id, current_user)
socket
|> assign(:page_title, gettext("Edit Ammo type"))
|> assign(:ammo_type, Ammo.get_ammo_type!(id, current_user))
|> assign(
page_title: gettext("Edit %{ammo_type_name}", ammo_type_name: ammo_type_name),
ammo_type: ammo_type
)
end
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :clone, %{"id" => id}) do
socket
|> assign(:page_title, gettext("New Ammo type"))
|> assign(:ammo_type, %{Ammo.get_ammo_type!(id, current_user) | id: nil})
|> assign(
page_title: gettext("New Ammo type"),
ammo_type: %{Ammo.get_ammo_type!(id, current_user) | id: nil}
)
end
defp apply_action(socket, :new, _params) do
socket
|> assign(:page_title, gettext("New Ammo type"))
|> assign(:ammo_type, %AmmoType{})
|> assign(
page_title: gettext("New Ammo type"),
ammo_type: %AmmoType{}
)
end
defp apply_action(socket, :index, _params) do
socket |> assign(:page_title, gettext("Ammo types")) |> assign(:ammo_type, nil)
socket
|> assign(
page_title: gettext("Catalog"),
search: nil,
ammo_type: nil
)
|> list_ammo_types()
end
defp apply_action(socket, :search, %{"search" => search}) do
socket
|> assign(
page_title: gettext("Catalog"),
search: search,
ammo_type: nil
)
|> list_ammo_types()
end
@impl true
@ -54,8 +80,20 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
{:noreply, socket |> assign(:show_used, !show_used) |> list_ammo_types()}
end
defp list_ammo_types(%{assigns: %{current_user: current_user, show_used: show_used}} = socket) do
ammo_types = Ammo.list_ammo_types(current_user)
@impl true
def handle_event("search", %{"search" => %{"search_term" => ""}}, socket) do
{:noreply, socket |> push_patch(to: Routes.ammo_type_index_path(Endpoint, :index))}
end
def handle_event("search", %{"search" => %{"search_term" => search_term}}, socket) do
{:noreply,
socket |> push_patch(to: Routes.ammo_type_index_path(Endpoint, :search, search_term))}
end
defp list_ammo_types(
%{assigns: %{search: search, current_user: current_user, show_used: show_used}} = socket
) do
ammo_types = Ammo.list_ammo_types(search, current_user)
columns =
[

View File

@ -17,7 +17,23 @@
<%= dgettext("actions", "New Ammo type") %>
</.link>
<div class="flex flex-col justify-center items-center">
<div class="w-full flex flex-col sm:flex-row justify-center items-center space-y-4 sm:space-y-0 sm:space-x-4 max-w-xl">
<.form
:let={f}
for={:search}
phx-change="search"
phx-submit="search"
class="grow self-stretch flex flex-col items-stretch"
data-qa="ammo_type_search"
>
<%= text_input(f, :search_term,
class: "input input-primary",
value: @search,
phx_debounce: 300,
placeholder: gettext("Search catalog")
) %>
</.form>
<.toggle_button action="toggle_show_used" value={@show_used}>
<span class="title text-lg text-primary-600">
<%= gettext("Show used") %>

View File

@ -68,12 +68,13 @@ defmodule CanneryWeb.Router do
live "/catalog", AmmoTypeLive.Index, :index
live "/catalog/new", AmmoTypeLive.Index, :new
live "/catalog/:id/clone", AmmoTypeLive.Index, :clone
live "/catalog/:id/edit", AmmoTypeLive.Index, :edit
live "/catalog/clone/:id", AmmoTypeLive.Index, :clone
live "/catalog/edit/:id", AmmoTypeLive.Index, :edit
live "/catalog/search/:search", AmmoTypeLive.Index, :search
live "/catalog/:id/show", AmmoTypeLive.Show, :show
live "/catalog/:id/show/edit", AmmoTypeLive.Show, :edit
live "/catalog/:id/show/table", AmmoTypeLive.Show, :table
live "/type/:id", AmmoTypeLive.Show, :show
live "/type/:id/edit", AmmoTypeLive.Show, :edit
live "/type/:id/table", AmmoTypeLive.Show, :table
live "/containers", ContainerLive.Index, :index
live "/containers/table", ContainerLive.Index, :table

View File

@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
def project do
[
app: :cannery,
version: "0.7.2",
version: "0.8.0",
elixir: "1.14.1",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),

View File

@ -65,7 +65,7 @@ msgid "Background color"
msgstr "Hintergrundfarbe"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:82
#: lib/cannery_web/live/ammo_type_live/index.ex:120
#, elixir-autogen, elixir-format
msgid "Blank"
msgstr "Knallpatrone"
@ -76,31 +76,31 @@ msgid "Brass"
msgstr "Messing"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:64
#: lib/cannery_web/live/ammo_type_live/index.ex:102
#, elixir-autogen, elixir-format
msgid "Bullet core"
msgstr "Projektilkern"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:37
#: lib/cannery_web/live/ammo_type_live/index.ex:63
#: lib/cannery_web/live/ammo_type_live/index.ex:101
#, elixir-autogen, elixir-format
msgid "Bullet type"
msgstr "Patronenart"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/index.ex:104
#, elixir-autogen, elixir-format
msgid "Caliber"
msgstr "Kaliber"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
#: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#, elixir-autogen, elixir-format
msgid "Cartridge"
msgstr "Patrone"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/index.ex:105
#, elixir-autogen, elixir-format
msgid "Case material"
msgstr "Gehäusematerial"
@ -121,7 +121,7 @@ msgid "Containers"
msgstr "Behälter"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:83
#: lib/cannery_web/live/ammo_type_live/index.ex:121
#, elixir-autogen, elixir-format
msgid "Corrosive"
msgstr "Korrosiv"
@ -156,11 +156,6 @@ msgstr "Beschreibung:"
msgid "Easy to Use:"
msgstr "Einfache Anwendung:"
#: lib/cannery_web/live/ammo_type_live/index.ex:23
#, elixir-autogen, elixir-format
msgid "Edit Ammo type"
msgstr "Munitionstyp bearbeiten"
#: lib/cannery_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "Edit Invite"
@ -182,13 +177,13 @@ msgid "FMJ"
msgstr "VM"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:76
#: lib/cannery_web/live/ammo_type_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "Grains"
msgstr "Körner"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:81
#: lib/cannery_web/live/ammo_type_live/index.ex:119
#, elixir-autogen, elixir-format
msgid "Incendiary"
msgstr "Brandmunition"
@ -239,7 +234,7 @@ msgid "Magazine, Clip, Ammo Box, etc"
msgstr "Magazin, Ladestreifen, Munitionskiste usw."
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:84
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#, elixir-autogen, elixir-format
msgid "Manufacturer"
msgstr "Hersteller"
@ -255,7 +250,7 @@ msgid "My cool ammo can"
msgstr "Meine coole Munitionskiste"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:20
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.ex:100
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/container_live/index.ex:121
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
@ -264,8 +259,8 @@ msgstr "Meine coole Munitionskiste"
msgid "Name"
msgstr "Name"
#: lib/cannery_web/live/ammo_type_live/index.ex:29
#: lib/cannery_web/live/ammo_type_live/index.ex:35
#: 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"
@ -334,7 +329,7 @@ msgid "On the bookshelf"
msgstr "Auf dem Bücherregal"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:77
#: lib/cannery_web/live/ammo_type_live/index.ex:115
#, elixir-autogen, elixir-format
msgid "Pressure"
msgstr "Druck"
@ -351,7 +346,7 @@ msgid "Price paid:"
msgstr "Kaufpreis:"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:78
#: lib/cannery_web/live/ammo_type_live/index.ex:116
#, elixir-autogen, elixir-format
msgid "Primer type"
msgstr "Zündertyp"
@ -418,7 +413,7 @@ msgid "The self-hosted firearm tracker website"
msgstr "Die selbst-gehostete Website zur Verwaltung von Schusswaffen"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:80
#: lib/cannery_web/live/ammo_type_live/index.ex:118
#, elixir-autogen, elixir-format
msgid "Tracer"
msgstr "Leuchtspur"
@ -557,7 +552,7 @@ msgstr "Schießkladde"
#: lib/cannery_web/components/ammo_group_table_component.ex:224
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:179
#: lib/cannery_web/live/ammo_type_live/index.ex:217
#: lib/cannery_web/live/ammo_type_live/show.html.heex:136
#, elixir-autogen, elixir-format
msgid "$%{amount}"
@ -569,31 +564,31 @@ msgid "Bimetal"
msgstr "Bimetall"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/index.ex:106
#, elixir-autogen, elixir-format
msgid "Jacket type"
msgstr "Patronenhülse"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/index.ex:107
#, elixir-autogen, elixir-format
msgid "Muzzle velocity"
msgstr "Mündungsgeschwindigkeit"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:110
#, elixir-autogen, elixir-format
msgid "Powder grains per charge"
msgstr "Pulverkörner pro Ladung"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
#: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#, elixir-autogen, elixir-format
msgid "Powder type"
msgstr "Pulverart"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:85
#: lib/cannery_web/live/ammo_type_live/index.ex:123
#, elixir-autogen, elixir-format
msgid "UPC"
msgstr "UPC"
@ -625,7 +620,7 @@ msgid "Unstage"
msgstr "Demarkiert"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#, elixir-autogen, elixir-format
msgid "Firing type"
msgstr "Patronenhülsenform"
@ -660,7 +655,7 @@ msgid "Rounds:"
msgstr "Patronen:"
#: lib/cannery_web/components/ammo_group_table_component.ex:221
#: lib/cannery_web/live/ammo_type_live/index.ex:178
#: lib/cannery_web/live/ammo_type_live/index.ex:216
#: lib/cannery_web/live/ammo_type_live/show.html.heex:142
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -732,11 +727,6 @@ msgstr "Schüsse dokumentieren"
msgid "Copies"
msgstr "Kopien"
#: lib/cannery_web/live/ammo_type_live/index.ex:40
#, elixir-autogen, elixir-format
msgid "Ammo types"
msgstr "Munitionsart"
#: lib/cannery_web/live/ammo_type_live/show.html.heex:123
#, elixir-autogen, elixir-format
msgid "Added on:"
@ -791,6 +781,8 @@ msgid "View the source code"
msgstr "Quellcode ansehen"
#: lib/cannery_web/components/topbar.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:52
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Catalog"
@ -850,7 +842,7 @@ msgid "Container:"
msgstr "Behälter"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:48
#: lib/cannery_web/live/ammo_type_live/index.html.heex:23
#: lib/cannery_web/live/ammo_type_live/index.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
#: lib/cannery_web/live/container_live/show.html.heex:105
#, elixir-autogen, elixir-format
@ -868,13 +860,13 @@ msgstr ""
msgid "Rounds shot: %{count}"
msgstr "Patronen abgefeuert"
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#: lib/cannery_web/live/ammo_type_live/index.ex:155
#: lib/cannery_web/live/container_live/index.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Packs"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:97
#: lib/cannery_web/live/ammo_type_live/index.ex:135
#: lib/cannery_web/live/container_live/index.ex:126
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds"
@ -887,7 +879,7 @@ msgstr "Patronen:"
msgid "View as table"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:127
#: lib/cannery_web/live/ammo_type_live/index.ex:165
#, elixir-autogen, elixir-format
msgid "Total ever packs"
msgstr ""
@ -897,7 +889,7 @@ msgstr ""
msgid "Total ever packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#: lib/cannery_web/live/ammo_type_live/index.ex:146
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds"
msgstr "Summe aller Patronen"
@ -907,7 +899,7 @@ msgstr "Summe aller Patronen"
msgid "Total ever rounds:"
msgstr "Summe abgegebener Schüsse:"
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#: lib/cannery_web/live/ammo_type_live/index.ex:160
#, elixir-autogen, elixir-format
msgid "Used packs"
msgstr ""
@ -917,7 +909,7 @@ msgstr ""
msgid "Used packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:141
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds"
msgstr ""
@ -1032,12 +1024,13 @@ msgstr "Leuchtspur"
msgid "UPC:"
msgstr "UPC"
#: lib/cannery_web/live/ammo_type_live/index.ex:137
#: lib/cannery_web/live/ammo_type_live/index.ex:175
#: lib/cannery_web/live/ammo_type_live/show.html.heex:132
#, 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:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit %{ammo_type_name}"
@ -1120,3 +1113,8 @@ msgstr "Munitionstyp bearbeiten"
#, elixir-autogen, elixir-format, fuzzy
msgid "No Ammo types"
msgstr "Keine Munitionsarten"
#: lib/cannery_web/live/ammo_type_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Search catalog"
msgstr ""

View File

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

View File

@ -31,7 +31,7 @@ msgstr ""
msgid "%{name} created successfully"
msgstr "%{name} erfolgreich erstellt"
#: lib/cannery_web/live/ammo_type_live/index.ex:47
#: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.ex:55
#: lib/cannery_web/live/invite_live/index.ex:53
#: lib/cannery_web/live/invite_live/index.ex:133
@ -289,7 +289,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] "Munitionsgruppe erfolgreich aktualisiert"
msgstr[1] "Munitionsgruppe erfolgreich aktualisiert"
#: lib/cannery_web/live/ammo_type_live/index.ex:232
#: lib/cannery_web/live/ammo_type_live/index.ex:270
#: lib/cannery_web/live/ammo_type_live/show.html.heex:28
#, elixir-autogen, elixir-format, fuzzy
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"

View File

@ -50,7 +50,7 @@ msgid "Background color"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:82
#: lib/cannery_web/live/ammo_type_live/index.ex:120
#, elixir-autogen, elixir-format
msgid "Blank"
msgstr ""
@ -61,31 +61,31 @@ msgid "Brass"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:64
#: lib/cannery_web/live/ammo_type_live/index.ex:102
#, elixir-autogen, elixir-format
msgid "Bullet core"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:37
#: lib/cannery_web/live/ammo_type_live/index.ex:63
#: lib/cannery_web/live/ammo_type_live/index.ex:101
#, elixir-autogen, elixir-format
msgid "Bullet type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/index.ex:104
#, elixir-autogen, elixir-format
msgid "Caliber"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
#: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#, elixir-autogen, elixir-format
msgid "Cartridge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/index.ex:105
#, elixir-autogen, elixir-format
msgid "Case material"
msgstr ""
@ -106,7 +106,7 @@ msgid "Containers"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:83
#: lib/cannery_web/live/ammo_type_live/index.ex:121
#, elixir-autogen, elixir-format
msgid "Corrosive"
msgstr ""
@ -141,11 +141,6 @@ msgstr ""
msgid "Easy to Use:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:23
#, elixir-autogen, elixir-format
msgid "Edit Ammo type"
msgstr ""
#: lib/cannery_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "Edit Invite"
@ -167,13 +162,13 @@ msgid "FMJ"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:76
#: lib/cannery_web/live/ammo_type_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "Grains"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:81
#: lib/cannery_web/live/ammo_type_live/index.ex:119
#, elixir-autogen, elixir-format
msgid "Incendiary"
msgstr ""
@ -224,7 +219,7 @@ msgid "Magazine, Clip, Ammo Box, etc"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:84
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#, elixir-autogen, elixir-format
msgid "Manufacturer"
msgstr ""
@ -240,7 +235,7 @@ msgid "My cool ammo can"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:20
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.ex:100
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/container_live/index.ex:121
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
@ -249,8 +244,8 @@ msgstr ""
msgid "Name"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:29
#: lib/cannery_web/live/ammo_type_live/index.ex:35
#: 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 ""
@ -319,7 +314,7 @@ msgid "On the bookshelf"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:77
#: lib/cannery_web/live/ammo_type_live/index.ex:115
#, elixir-autogen, elixir-format
msgid "Pressure"
msgstr ""
@ -336,7 +331,7 @@ msgid "Price paid:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:78
#: lib/cannery_web/live/ammo_type_live/index.ex:116
#, elixir-autogen, elixir-format
msgid "Primer type"
msgstr ""
@ -401,7 +396,7 @@ msgid "The self-hosted firearm tracker website"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:80
#: lib/cannery_web/live/ammo_type_live/index.ex:118
#, elixir-autogen, elixir-format
msgid "Tracer"
msgstr ""
@ -540,7 +535,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:224
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:179
#: lib/cannery_web/live/ammo_type_live/index.ex:217
#: lib/cannery_web/live/ammo_type_live/show.html.heex:136
#, elixir-autogen, elixir-format
msgid "$%{amount}"
@ -552,31 +547,31 @@ msgid "Bimetal"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/index.ex:106
#, elixir-autogen, elixir-format
msgid "Jacket type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/index.ex:107
#, elixir-autogen, elixir-format
msgid "Muzzle velocity"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:110
#, elixir-autogen, elixir-format
msgid "Powder grains per charge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
#: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#, elixir-autogen, elixir-format
msgid "Powder type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:85
#: lib/cannery_web/live/ammo_type_live/index.ex:123
#, elixir-autogen, elixir-format
msgid "UPC"
msgstr ""
@ -608,7 +603,7 @@ msgid "Unstage"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#, elixir-autogen, elixir-format
msgid "Firing type"
msgstr ""
@ -643,7 +638,7 @@ msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:221
#: lib/cannery_web/live/ammo_type_live/index.ex:178
#: lib/cannery_web/live/ammo_type_live/index.ex:216
#: lib/cannery_web/live/ammo_type_live/show.html.heex:142
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -715,11 +710,6 @@ msgstr ""
msgid "Copies"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:40
#, elixir-autogen, elixir-format
msgid "Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/show.html.heex:123
#, elixir-autogen, elixir-format
msgid "Added on:"
@ -774,6 +764,8 @@ msgid "View the source code"
msgstr ""
#: lib/cannery_web/components/topbar.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:52
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Catalog"
@ -833,7 +825,7 @@ msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:48
#: lib/cannery_web/live/ammo_type_live/index.html.heex:23
#: lib/cannery_web/live/ammo_type_live/index.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
#: lib/cannery_web/live/container_live/show.html.heex:105
#, elixir-autogen, elixir-format
@ -851,13 +843,13 @@ msgstr ""
msgid "Rounds shot: %{count}"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#: lib/cannery_web/live/ammo_type_live/index.ex:155
#: lib/cannery_web/live/container_live/index.ex:125
#, elixir-autogen, elixir-format
msgid "Packs"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:97
#: lib/cannery_web/live/ammo_type_live/index.ex:135
#: lib/cannery_web/live/container_live/index.ex:126
#, elixir-autogen, elixir-format
msgid "Rounds"
@ -870,7 +862,7 @@ msgstr ""
msgid "View as table"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:127
#: lib/cannery_web/live/ammo_type_live/index.ex:165
#, elixir-autogen, elixir-format
msgid "Total ever packs"
msgstr ""
@ -880,7 +872,7 @@ msgstr ""
msgid "Total ever packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#: lib/cannery_web/live/ammo_type_live/index.ex:146
#, elixir-autogen, elixir-format
msgid "Total ever rounds"
msgstr ""
@ -890,7 +882,7 @@ msgstr ""
msgid "Total ever rounds:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#: lib/cannery_web/live/ammo_type_live/index.ex:160
#, elixir-autogen, elixir-format
msgid "Used packs"
msgstr ""
@ -900,7 +892,7 @@ msgstr ""
msgid "Used packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:141
#, elixir-autogen, elixir-format
msgid "Used rounds"
msgstr ""
@ -1015,12 +1007,13 @@ msgstr ""
msgid "UPC:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:137
#: lib/cannery_web/live/ammo_type_live/index.ex:175
#: lib/cannery_web/live/ammo_type_live/show.html.heex:132
#, 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:120
#, elixir-autogen, elixir-format
msgid "Edit %{ammo_type_name}"
@ -1103,3 +1096,8 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "No Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Search catalog"
msgstr ""

View File

@ -51,7 +51,7 @@ msgid "Background color"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:82
#: lib/cannery_web/live/ammo_type_live/index.ex:120
#, elixir-autogen, elixir-format
msgid "Blank"
msgstr ""
@ -62,31 +62,31 @@ msgid "Brass"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:64
#: lib/cannery_web/live/ammo_type_live/index.ex:102
#, elixir-autogen, elixir-format
msgid "Bullet core"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:37
#: lib/cannery_web/live/ammo_type_live/index.ex:63
#: lib/cannery_web/live/ammo_type_live/index.ex:101
#, elixir-autogen, elixir-format
msgid "Bullet type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/index.ex:104
#, elixir-autogen, elixir-format
msgid "Caliber"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
#: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#, elixir-autogen, elixir-format
msgid "Cartridge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/index.ex:105
#, elixir-autogen, elixir-format
msgid "Case material"
msgstr ""
@ -107,7 +107,7 @@ msgid "Containers"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:83
#: lib/cannery_web/live/ammo_type_live/index.ex:121
#, elixir-autogen, elixir-format
msgid "Corrosive"
msgstr ""
@ -142,11 +142,6 @@ msgstr ""
msgid "Easy to Use:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:23
#, elixir-autogen, elixir-format
msgid "Edit Ammo type"
msgstr ""
#: lib/cannery_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "Edit Invite"
@ -168,13 +163,13 @@ msgid "FMJ"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:76
#: lib/cannery_web/live/ammo_type_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "Grains"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:81
#: lib/cannery_web/live/ammo_type_live/index.ex:119
#, elixir-autogen, elixir-format
msgid "Incendiary"
msgstr ""
@ -225,7 +220,7 @@ msgid "Magazine, Clip, Ammo Box, etc"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:84
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#, elixir-autogen, elixir-format
msgid "Manufacturer"
msgstr ""
@ -241,7 +236,7 @@ msgid "My cool ammo can"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:20
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.ex:100
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/container_live/index.ex:121
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
@ -250,8 +245,8 @@ msgstr ""
msgid "Name"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:29
#: lib/cannery_web/live/ammo_type_live/index.ex:35
#: 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 ""
@ -320,7 +315,7 @@ msgid "On the bookshelf"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:77
#: lib/cannery_web/live/ammo_type_live/index.ex:115
#, elixir-autogen, elixir-format
msgid "Pressure"
msgstr ""
@ -337,7 +332,7 @@ msgid "Price paid:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:78
#: lib/cannery_web/live/ammo_type_live/index.ex:116
#, elixir-autogen, elixir-format
msgid "Primer type"
msgstr ""
@ -402,7 +397,7 @@ msgid "The self-hosted firearm tracker website"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:80
#: lib/cannery_web/live/ammo_type_live/index.ex:118
#, elixir-autogen, elixir-format
msgid "Tracer"
msgstr ""
@ -541,7 +536,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:224
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:179
#: lib/cannery_web/live/ammo_type_live/index.ex:217
#: lib/cannery_web/live/ammo_type_live/show.html.heex:136
#, elixir-autogen, elixir-format
msgid "$%{amount}"
@ -553,31 +548,31 @@ msgid "Bimetal"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/index.ex:106
#, elixir-autogen, elixir-format
msgid "Jacket type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/index.ex:107
#, elixir-autogen, elixir-format
msgid "Muzzle velocity"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:110
#, elixir-autogen, elixir-format
msgid "Powder grains per charge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
#: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#, elixir-autogen, elixir-format
msgid "Powder type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:85
#: lib/cannery_web/live/ammo_type_live/index.ex:123
#, elixir-autogen, elixir-format
msgid "UPC"
msgstr ""
@ -609,7 +604,7 @@ msgid "Unstage"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#, elixir-autogen, elixir-format
msgid "Firing type"
msgstr ""
@ -644,7 +639,7 @@ msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:221
#: lib/cannery_web/live/ammo_type_live/index.ex:178
#: lib/cannery_web/live/ammo_type_live/index.ex:216
#: lib/cannery_web/live/ammo_type_live/show.html.heex:142
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -716,11 +711,6 @@ msgstr ""
msgid "Copies"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:40
#, elixir-autogen, elixir-format, fuzzy
msgid "Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/show.html.heex:123
#, elixir-autogen, elixir-format
msgid "Added on:"
@ -775,6 +765,8 @@ msgid "View the source code"
msgstr ""
#: lib/cannery_web/components/topbar.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:52
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Catalog"
@ -834,7 +826,7 @@ msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:48
#: lib/cannery_web/live/ammo_type_live/index.html.heex:23
#: lib/cannery_web/live/ammo_type_live/index.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
#: lib/cannery_web/live/container_live/show.html.heex:105
#, elixir-autogen, elixir-format
@ -852,13 +844,13 @@ msgstr ""
msgid "Rounds shot: %{count}"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#: lib/cannery_web/live/ammo_type_live/index.ex:155
#: lib/cannery_web/live/container_live/index.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Packs"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:97
#: lib/cannery_web/live/ammo_type_live/index.ex:135
#: lib/cannery_web/live/container_live/index.ex:126
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds"
@ -871,7 +863,7 @@ msgstr ""
msgid "View as table"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:127
#: lib/cannery_web/live/ammo_type_live/index.ex:165
#, elixir-autogen, elixir-format
msgid "Total ever packs"
msgstr ""
@ -881,7 +873,7 @@ msgstr ""
msgid "Total ever packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#: lib/cannery_web/live/ammo_type_live/index.ex:146
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds"
msgstr ""
@ -891,7 +883,7 @@ msgstr ""
msgid "Total ever rounds:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#: lib/cannery_web/live/ammo_type_live/index.ex:160
#, elixir-autogen, elixir-format
msgid "Used packs"
msgstr ""
@ -901,7 +893,7 @@ msgstr ""
msgid "Used packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:141
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds"
msgstr ""
@ -1016,12 +1008,13 @@ msgstr ""
msgid "UPC:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:137
#: lib/cannery_web/live/ammo_type_live/index.ex:175
#: lib/cannery_web/live/ammo_type_live/show.html.heex:132
#, 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:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit %{ammo_type_name}"
@ -1104,3 +1097,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "No Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Search catalog"
msgstr ""

View File

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

View File

@ -19,7 +19,7 @@ msgstr ""
msgid "%{name} created successfully"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:47
#: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.ex:55
#: lib/cannery_web/live/invite_live/index.ex:53
#: lib/cannery_web/live/invite_live/index.ex:133
@ -269,7 +269,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
#: lib/cannery_web/live/ammo_type_live/index.ex:232
#: lib/cannery_web/live/ammo_type_live/index.ex:270
#: lib/cannery_web/live/ammo_type_live/show.html.heex:28
#, elixir-autogen, elixir-format, fuzzy
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"

View File

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

View File

@ -65,7 +65,7 @@ msgid "Background color"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:82
#: lib/cannery_web/live/ammo_type_live/index.ex:120
#, elixir-autogen, elixir-format
msgid "Blank"
msgstr ""
@ -76,31 +76,31 @@ msgid "Brass"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:64
#: lib/cannery_web/live/ammo_type_live/index.ex:102
#, elixir-autogen, elixir-format
msgid "Bullet core"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:37
#: lib/cannery_web/live/ammo_type_live/index.ex:63
#: lib/cannery_web/live/ammo_type_live/index.ex:101
#, elixir-autogen, elixir-format
msgid "Bullet type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/index.ex:104
#, elixir-autogen, elixir-format
msgid "Caliber"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
#: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#, elixir-autogen, elixir-format
msgid "Cartridge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/index.ex:105
#, elixir-autogen, elixir-format
msgid "Case material"
msgstr ""
@ -121,7 +121,7 @@ msgid "Containers"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:83
#: lib/cannery_web/live/ammo_type_live/index.ex:121
#, elixir-autogen, elixir-format
msgid "Corrosive"
msgstr ""
@ -156,11 +156,6 @@ msgstr ""
msgid "Easy to Use:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:23
#, elixir-autogen, elixir-format
msgid "Edit Ammo type"
msgstr ""
#: lib/cannery_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "Edit Invite"
@ -182,13 +177,13 @@ msgid "FMJ"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:76
#: lib/cannery_web/live/ammo_type_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "Grains"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:81
#: lib/cannery_web/live/ammo_type_live/index.ex:119
#, elixir-autogen, elixir-format
msgid "Incendiary"
msgstr ""
@ -239,7 +234,7 @@ msgid "Magazine, Clip, Ammo Box, etc"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:84
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#, elixir-autogen, elixir-format
msgid "Manufacturer"
msgstr ""
@ -255,7 +250,7 @@ msgid "My cool ammo can"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:20
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.ex:100
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/container_live/index.ex:121
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
@ -264,8 +259,8 @@ msgstr ""
msgid "Name"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:29
#: lib/cannery_web/live/ammo_type_live/index.ex:35
#: 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 ""
@ -334,7 +329,7 @@ msgid "On the bookshelf"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:77
#: lib/cannery_web/live/ammo_type_live/index.ex:115
#, elixir-autogen, elixir-format
msgid "Pressure"
msgstr ""
@ -351,7 +346,7 @@ msgid "Price paid:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:78
#: lib/cannery_web/live/ammo_type_live/index.ex:116
#, elixir-autogen, elixir-format
msgid "Primer type"
msgstr ""
@ -416,7 +411,7 @@ msgid "The self-hosted firearm tracker website"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:80
#: lib/cannery_web/live/ammo_type_live/index.ex:118
#, elixir-autogen, elixir-format
msgid "Tracer"
msgstr ""
@ -555,7 +550,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:224
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:179
#: lib/cannery_web/live/ammo_type_live/index.ex:217
#: lib/cannery_web/live/ammo_type_live/show.html.heex:136
#, elixir-autogen, elixir-format
msgid "$%{amount}"
@ -567,31 +562,31 @@ msgid "Bimetal"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/index.ex:106
#, elixir-autogen, elixir-format
msgid "Jacket type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/index.ex:107
#, elixir-autogen, elixir-format
msgid "Muzzle velocity"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:110
#, elixir-autogen, elixir-format
msgid "Powder grains per charge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
#: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#, elixir-autogen, elixir-format
msgid "Powder type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:85
#: lib/cannery_web/live/ammo_type_live/index.ex:123
#, elixir-autogen, elixir-format
msgid "UPC"
msgstr ""
@ -623,7 +618,7 @@ msgid "Unstage"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#, elixir-autogen, elixir-format
msgid "Firing type"
msgstr ""
@ -658,7 +653,7 @@ msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:221
#: lib/cannery_web/live/ammo_type_live/index.ex:178
#: lib/cannery_web/live/ammo_type_live/index.ex:216
#: lib/cannery_web/live/ammo_type_live/show.html.heex:142
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -730,11 +725,6 @@ msgstr ""
msgid "Copies"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:40
#, elixir-autogen, elixir-format
msgid "Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/show.html.heex:123
#, elixir-autogen, elixir-format
msgid "Added on:"
@ -789,6 +779,8 @@ msgid "View the source code"
msgstr ""
#: lib/cannery_web/components/topbar.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:52
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Catalog"
@ -848,7 +840,7 @@ msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:48
#: lib/cannery_web/live/ammo_type_live/index.html.heex:23
#: lib/cannery_web/live/ammo_type_live/index.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
#: lib/cannery_web/live/container_live/show.html.heex:105
#, elixir-autogen, elixir-format
@ -866,13 +858,13 @@ msgstr ""
msgid "Rounds shot: %{count}"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#: lib/cannery_web/live/ammo_type_live/index.ex:155
#: lib/cannery_web/live/container_live/index.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Packs"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:97
#: lib/cannery_web/live/ammo_type_live/index.ex:135
#: lib/cannery_web/live/container_live/index.ex:126
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds"
@ -885,7 +877,7 @@ msgstr ""
msgid "View as table"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:127
#: lib/cannery_web/live/ammo_type_live/index.ex:165
#, elixir-autogen, elixir-format
msgid "Total ever packs"
msgstr ""
@ -895,7 +887,7 @@ msgstr ""
msgid "Total ever packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#: lib/cannery_web/live/ammo_type_live/index.ex:146
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds"
msgstr ""
@ -905,7 +897,7 @@ msgstr ""
msgid "Total ever rounds:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#: lib/cannery_web/live/ammo_type_live/index.ex:160
#, elixir-autogen, elixir-format
msgid "Used packs"
msgstr ""
@ -915,7 +907,7 @@ msgstr ""
msgid "Used packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:141
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds"
msgstr ""
@ -1030,12 +1022,13 @@ msgstr ""
msgid "UPC:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:137
#: lib/cannery_web/live/ammo_type_live/index.ex:175
#: lib/cannery_web/live/ammo_type_live/show.html.heex:132
#, 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:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit %{ammo_type_name}"
@ -1118,3 +1111,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "No Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Search catalog"
msgstr ""

View File

@ -185,7 +185,7 @@ msgstr "No se pudo analizar 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:609
#: lib/cannery/ammo.ex:636
#, elixir-autogen, elixir-format
msgid "Invalid multiplier"
msgstr "Multiplicador inválido"

View File

@ -31,7 +31,7 @@ msgstr ""
msgid "%{name} created successfully"
msgstr "%{name} creado exitosamente"
#: lib/cannery_web/live/ammo_type_live/index.ex:47
#: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.ex:55
#: lib/cannery_web/live/invite_live/index.ex:53
#: lib/cannery_web/live/invite_live/index.ex:133
@ -288,7 +288,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
#: lib/cannery_web/live/ammo_type_live/index.ex:232
#: lib/cannery_web/live/ammo_type_live/index.ex:270
#: lib/cannery_web/live/ammo_type_live/show.html.heex:28
#, elixir-autogen, elixir-format, fuzzy
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"

View File

@ -65,7 +65,7 @@ msgid "Background color"
msgstr "Couleur de fond"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:82
#: lib/cannery_web/live/ammo_type_live/index.ex:120
#, elixir-autogen, elixir-format
msgid "Blank"
msgstr "Vide"
@ -76,31 +76,31 @@ msgid "Brass"
msgstr "Cuivre"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:64
#: lib/cannery_web/live/ammo_type_live/index.ex:102
#, elixir-autogen, elixir-format
msgid "Bullet core"
msgstr "Noyau de balle"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:37
#: lib/cannery_web/live/ammo_type_live/index.ex:63
#: lib/cannery_web/live/ammo_type_live/index.ex:101
#, elixir-autogen, elixir-format
msgid "Bullet type"
msgstr "Type de balle"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/index.ex:104
#, elixir-autogen, elixir-format
msgid "Caliber"
msgstr "Calibre"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
#: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#, elixir-autogen, elixir-format
msgid "Cartridge"
msgstr "Cartouche"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/index.ex:105
#, elixir-autogen, elixir-format
msgid "Case material"
msgstr "Matériau de la caisse"
@ -121,7 +121,7 @@ msgid "Containers"
msgstr "Conteneurs"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:83
#: lib/cannery_web/live/ammo_type_live/index.ex:121
#, elixir-autogen, elixir-format
msgid "Corrosive"
msgstr "Corrosive"
@ -156,11 +156,6 @@ msgstr "Description:"
msgid "Easy to Use:"
msgstr "Simple à utiliser:"
#: lib/cannery_web/live/ammo_type_live/index.ex:23
#, elixir-autogen, elixir-format
msgid "Edit Ammo type"
msgstr "Éditer le type de munition"
#: lib/cannery_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "Edit Invite"
@ -182,13 +177,13 @@ msgid "FMJ"
msgstr "FMJ"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:76
#: lib/cannery_web/live/ammo_type_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "Grains"
msgstr "Graines"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:81
#: lib/cannery_web/live/ammo_type_live/index.ex:119
#, elixir-autogen, elixir-format
msgid "Incendiary"
msgstr "Incendiaire"
@ -239,7 +234,7 @@ msgid "Magazine, Clip, Ammo Box, etc"
msgstr "Chargeur, lame-chargeur, boite de munition, etc."
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:84
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#, elixir-autogen, elixir-format
msgid "Manufacturer"
msgstr "Fabricant"
@ -255,7 +250,7 @@ msgid "My cool ammo can"
msgstr "Ma superbe boite de munition"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:20
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.ex:100
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/container_live/index.ex:121
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
@ -264,8 +259,8 @@ msgstr "Ma superbe boite de munition"
msgid "Name"
msgstr "Nom"
#: lib/cannery_web/live/ammo_type_live/index.ex:29
#: lib/cannery_web/live/ammo_type_live/index.ex:35
#: 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"
@ -334,7 +329,7 @@ msgid "On the bookshelf"
msgstr "Sur létagère"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:77
#: lib/cannery_web/live/ammo_type_live/index.ex:115
#, elixir-autogen, elixir-format
msgid "Pressure"
msgstr "Pression"
@ -351,7 +346,7 @@ msgid "Price paid:"
msgstr "Prix payé:"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:78
#: lib/cannery_web/live/ammo_type_live/index.ex:116
#, elixir-autogen, elixir-format
msgid "Primer type"
msgstr "Type damorce"
@ -420,7 +415,7 @@ msgid "The self-hosted firearm tracker website"
msgstr "Le site web de suivi darme à feux auto-hébergé"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:80
#: lib/cannery_web/live/ammo_type_live/index.ex:118
#, elixir-autogen, elixir-format
msgid "Tracer"
msgstr "Traceuse"
@ -559,7 +554,7 @@ msgstr "Évènements de tir"
#: lib/cannery_web/components/ammo_group_table_component.ex:224
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:179
#: lib/cannery_web/live/ammo_type_live/index.ex:217
#: lib/cannery_web/live/ammo_type_live/show.html.heex:136
#, elixir-autogen, elixir-format
msgid "$%{amount}"
@ -571,31 +566,31 @@ msgid "Bimetal"
msgstr "Bi-métal"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/index.ex:106
#, elixir-autogen, elixir-format
msgid "Jacket type"
msgstr "Type de douille"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/index.ex:107
#, elixir-autogen, elixir-format
msgid "Muzzle velocity"
msgstr "Vélocité du canon"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:110
#, elixir-autogen, elixir-format
msgid "Powder grains per charge"
msgstr "Graines de poudre par charge"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
#: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#, elixir-autogen, elixir-format
msgid "Powder type"
msgstr "Type de poudre"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:85
#: lib/cannery_web/live/ammo_type_live/index.ex:123
#, elixir-autogen, elixir-format
msgid "UPC"
msgstr "UPC"
@ -627,7 +622,7 @@ msgid "Unstage"
msgstr "Désélectionner"
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#, elixir-autogen, elixir-format
msgid "Firing type"
msgstr "Type dallumage"
@ -662,7 +657,7 @@ msgid "Rounds:"
msgstr "Cartouches:"
#: lib/cannery_web/components/ammo_group_table_component.ex:221
#: lib/cannery_web/live/ammo_type_live/index.ex:178
#: lib/cannery_web/live/ammo_type_live/index.ex:216
#: lib/cannery_web/live/ammo_type_live/show.html.heex:142
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -734,11 +729,6 @@ msgstr "Enregistrer des tirs"
msgid "Copies"
msgstr "Exemplaires"
#: lib/cannery_web/live/ammo_type_live/index.ex:40
#, elixir-autogen, elixir-format
msgid "Ammo types"
msgstr "Types de munition"
#: lib/cannery_web/live/ammo_type_live/show.html.heex:123
#, elixir-autogen, elixir-format
msgid "Added on:"
@ -793,6 +783,8 @@ msgid "View the source code"
msgstr "Voir le code source"
#: lib/cannery_web/components/topbar.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:52
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Catalog"
@ -853,7 +845,7 @@ msgid "Container:"
msgstr "Conteneur"
#: lib/cannery_web/live/ammo_group_live/index.html.heex:48
#: lib/cannery_web/live/ammo_type_live/index.html.heex:23
#: lib/cannery_web/live/ammo_type_live/index.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
#: lib/cannery_web/live/container_live/show.html.heex:105
#, elixir-autogen, elixir-format
@ -871,13 +863,13 @@ msgstr ""
msgid "Rounds shot: %{count}"
msgstr "Cartouches tirées"
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#: lib/cannery_web/live/ammo_type_live/index.ex:155
#: lib/cannery_web/live/container_live/index.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Packs"
msgstr "Packages:"
#: lib/cannery_web/live/ammo_type_live/index.ex:97
#: lib/cannery_web/live/ammo_type_live/index.ex:135
#: lib/cannery_web/live/container_live/index.ex:126
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds"
@ -890,7 +882,7 @@ msgstr "Cartouches:"
msgid "View as table"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:127
#: lib/cannery_web/live/ammo_type_live/index.ex:165
#, elixir-autogen, elixir-format
msgid "Total ever packs"
msgstr ""
@ -900,7 +892,7 @@ msgstr ""
msgid "Total ever packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#: lib/cannery_web/live/ammo_type_live/index.ex:146
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds"
msgstr "Quantité de cartouches"
@ -910,7 +902,7 @@ msgstr "Quantité de cartouches"
msgid "Total ever rounds:"
msgstr "Nombre totale de cartouches tirées:"
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#: lib/cannery_web/live/ammo_type_live/index.ex:160
#, elixir-autogen, elixir-format
msgid "Used packs"
msgstr ""
@ -920,7 +912,7 @@ msgstr ""
msgid "Used packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:141
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds"
msgstr ""
@ -1035,12 +1027,13 @@ msgstr "Traceuse"
msgid "UPC:"
msgstr "UPC"
#: lib/cannery_web/live/ammo_type_live/index.ex:137
#: lib/cannery_web/live/ammo_type_live/index.ex:175
#: lib/cannery_web/live/ammo_type_live/show.html.heex:132
#, 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:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit %{ammo_type_name}"
@ -1123,3 +1116,8 @@ msgstr "Éditer le type de munition"
#, elixir-autogen, elixir-format, fuzzy
msgid "No Ammo types"
msgstr "Aucun type de munition"
#: lib/cannery_web/live/ammo_type_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Search catalog"
msgstr ""

View File

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

View File

@ -31,7 +31,7 @@ msgstr ""
msgid "%{name} created successfully"
msgstr "%{name} créé· avec succès"
#: lib/cannery_web/live/ammo_type_live/index.ex:47
#: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.ex:55
#: lib/cannery_web/live/invite_live/index.ex:53
#: lib/cannery_web/live/invite_live/index.ex:133
@ -290,7 +290,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.ex:232
#: lib/cannery_web/live/ammo_type_live/index.ex:270
#: lib/cannery_web/live/ammo_type_live/show.html.heex:28
#, elixir-autogen, elixir-format, fuzzy
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"

View File

@ -61,7 +61,7 @@ msgid "Background color"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:82
#: lib/cannery_web/live/ammo_type_live/index.ex:120
#, elixir-autogen, elixir-format
msgid "Blank"
msgstr ""
@ -72,31 +72,31 @@ msgid "Brass"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:64
#: lib/cannery_web/live/ammo_type_live/index.ex:102
#, elixir-autogen, elixir-format
msgid "Bullet core"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:37
#: lib/cannery_web/live/ammo_type_live/index.ex:63
#: lib/cannery_web/live/ammo_type_live/index.ex:101
#, elixir-autogen, elixir-format
msgid "Bullet type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
#: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/index.ex:104
#, elixir-autogen, elixir-format
msgid "Caliber"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
#: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#, elixir-autogen, elixir-format
msgid "Cartridge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/index.ex:105
#, elixir-autogen, elixir-format
msgid "Case material"
msgstr ""
@ -117,7 +117,7 @@ msgid "Containers"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:83
#: lib/cannery_web/live/ammo_type_live/index.ex:121
#, elixir-autogen, elixir-format
msgid "Corrosive"
msgstr ""
@ -152,11 +152,6 @@ msgstr ""
msgid "Easy to Use:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:23
#, elixir-autogen, elixir-format
msgid "Edit Ammo type"
msgstr ""
#: lib/cannery_web/live/invite_live/index.ex:33
#, elixir-autogen, elixir-format
msgid "Edit Invite"
@ -178,13 +173,13 @@ msgid "FMJ"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:76
#: lib/cannery_web/live/ammo_type_live/index.ex:114
#, elixir-autogen, elixir-format
msgid "Grains"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:81
#: lib/cannery_web/live/ammo_type_live/index.ex:119
#, elixir-autogen, elixir-format
msgid "Incendiary"
msgstr ""
@ -235,7 +230,7 @@ msgid "Magazine, Clip, Ammo Box, etc"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:84
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#, elixir-autogen, elixir-format
msgid "Manufacturer"
msgstr ""
@ -251,7 +246,7 @@ msgid "My cool ammo can"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:20
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.ex:100
#: lib/cannery_web/live/container_live/form_component.html.heex:20
#: lib/cannery_web/live/container_live/index.ex:121
#: lib/cannery_web/live/invite_live/form_component.html.heex:20
@ -260,8 +255,8 @@ msgstr ""
msgid "Name"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:29
#: lib/cannery_web/live/ammo_type_live/index.ex:35
#: 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 ""
@ -330,7 +325,7 @@ msgid "On the bookshelf"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:77
#: lib/cannery_web/live/ammo_type_live/index.ex:115
#, elixir-autogen, elixir-format
msgid "Pressure"
msgstr ""
@ -347,7 +342,7 @@ msgid "Price paid:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:78
#: lib/cannery_web/live/ammo_type_live/index.ex:116
#, elixir-autogen, elixir-format
msgid "Primer type"
msgstr ""
@ -412,7 +407,7 @@ msgid "The self-hosted firearm tracker website"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:80
#: lib/cannery_web/live/ammo_type_live/index.ex:118
#, elixir-autogen, elixir-format
msgid "Tracer"
msgstr ""
@ -551,7 +546,7 @@ msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:224
#: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:179
#: lib/cannery_web/live/ammo_type_live/index.ex:217
#: lib/cannery_web/live/ammo_type_live/show.html.heex:136
#, elixir-autogen, elixir-format
msgid "$%{amount}"
@ -563,31 +558,31 @@ msgid "Bimetal"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/index.ex:106
#, elixir-autogen, elixir-format
msgid "Jacket type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/index.ex:107
#, elixir-autogen, elixir-format
msgid "Muzzle velocity"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/index.ex:110
#, elixir-autogen, elixir-format
msgid "Powder grains per charge"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
#: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#, elixir-autogen, elixir-format
msgid "Powder type"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:85
#: lib/cannery_web/live/ammo_type_live/index.ex:123
#, elixir-autogen, elixir-format
msgid "UPC"
msgstr ""
@ -619,7 +614,7 @@ msgid "Unstage"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:79
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#, elixir-autogen, elixir-format
msgid "Firing type"
msgstr ""
@ -654,7 +649,7 @@ msgid "Rounds:"
msgstr ""
#: lib/cannery_web/components/ammo_group_table_component.ex:221
#: lib/cannery_web/live/ammo_type_live/index.ex:178
#: lib/cannery_web/live/ammo_type_live/index.ex:216
#: lib/cannery_web/live/ammo_type_live/show.html.heex:142
#, elixir-autogen, elixir-format
msgid "No cost information"
@ -726,11 +721,6 @@ msgstr ""
msgid "Copies"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:40
#, elixir-autogen, elixir-format
msgid "Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/show.html.heex:123
#, elixir-autogen, elixir-format
msgid "Added on:"
@ -785,6 +775,8 @@ msgid "View the source code"
msgstr ""
#: lib/cannery_web/components/topbar.ex:65
#: lib/cannery_web/live/ammo_type_live/index.ex:52
#: lib/cannery_web/live/ammo_type_live/index.ex:62
#: lib/cannery_web/live/ammo_type_live/index.html.heex:3
#, elixir-autogen, elixir-format
msgid "Catalog"
@ -844,7 +836,7 @@ msgid "Container:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:48
#: lib/cannery_web/live/ammo_type_live/index.html.heex:23
#: lib/cannery_web/live/ammo_type_live/index.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:152
#: lib/cannery_web/live/container_live/show.html.heex:105
#, elixir-autogen, elixir-format
@ -862,13 +854,13 @@ msgstr ""
msgid "Rounds shot: %{count}"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:117
#: lib/cannery_web/live/ammo_type_live/index.ex:155
#: lib/cannery_web/live/container_live/index.ex:125
#, elixir-autogen, elixir-format, fuzzy
msgid "Packs"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:97
#: lib/cannery_web/live/ammo_type_live/index.ex:135
#: lib/cannery_web/live/container_live/index.ex:126
#, elixir-autogen, elixir-format, fuzzy
msgid "Rounds"
@ -881,7 +873,7 @@ msgstr ""
msgid "View as table"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:127
#: lib/cannery_web/live/ammo_type_live/index.ex:165
#, elixir-autogen, elixir-format
msgid "Total ever packs"
msgstr ""
@ -891,7 +883,7 @@ msgstr ""
msgid "Total ever packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:108
#: lib/cannery_web/live/ammo_type_live/index.ex:146
#, elixir-autogen, elixir-format, fuzzy
msgid "Total ever rounds"
msgstr ""
@ -901,7 +893,7 @@ msgstr ""
msgid "Total ever rounds:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:122
#: lib/cannery_web/live/ammo_type_live/index.ex:160
#, elixir-autogen, elixir-format
msgid "Used packs"
msgstr ""
@ -911,7 +903,7 @@ msgstr ""
msgid "Used packs:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:141
#, elixir-autogen, elixir-format, fuzzy
msgid "Used rounds"
msgstr ""
@ -1026,12 +1018,13 @@ msgstr ""
msgid "UPC:"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:137
#: lib/cannery_web/live/ammo_type_live/index.ex:175
#: lib/cannery_web/live/ammo_type_live/show.html.heex:132
#, 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:120
#, elixir-autogen, elixir-format, fuzzy
msgid "Edit %{ammo_type_name}"
@ -1114,3 +1107,8 @@ msgstr ""
#, elixir-autogen, elixir-format, fuzzy
msgid "No Ammo types"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.html.heex:33
#, elixir-autogen, elixir-format
msgid "Search catalog"
msgstr ""

View File

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

View File

@ -29,7 +29,7 @@ msgstr ""
msgid "%{name} created successfully"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:47
#: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.ex:55
#: lib/cannery_web/live/invite_live/index.ex:53
#: lib/cannery_web/live/invite_live/index.ex:133
@ -279,7 +279,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
#: lib/cannery_web/live/ammo_type_live/index.ex:232
#: lib/cannery_web/live/ammo_type_live/index.ex:270
#: lib/cannery_web/live/ammo_type_live/show.html.heex:28
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"

View File

@ -18,7 +18,7 @@ msgstr ""
msgid "%{name} created successfully"
msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:47
#: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.ex:55
#: lib/cannery_web/live/invite_live/index.ex:53
#: lib/cannery_web/live/invite_live/index.ex:133
@ -268,7 +268,7 @@ msgid_plural "Ammo added successfully"
msgstr[0] ""
msgstr[1] ""
#: lib/cannery_web/live/ammo_type_live/index.ex:232
#: lib/cannery_web/live/ammo_type_live/index.ex:270
#: lib/cannery_web/live/ammo_type_live/show.html.heex:28
#, elixir-autogen, elixir-format
msgid "Are you sure you want to delete %{name}? This will delete all %{name} type ammo as well!"

View File

@ -0,0 +1,119 @@
defmodule Cannery.Repo.Migrations.AddSearch do
use Ecto.Migration
def up do
execute """
CREATE FUNCTION immutable_to_string(integer, text)
RETURNS text LANGUAGE sql IMMUTABLE as
$$SELECT coalesce(($1)::TEXT, $2)::TEXT$$
"""
execute """
CREATE FUNCTION immutable_to_string(double precision, text)
RETURNS text LANGUAGE sql IMMUTABLE as
$$SELECT coalesce(($1)::TEXT, $2)::TEXT$$
"""
execute """
CREATE FUNCTION immutable_to_string(date, text)
RETURNS text LANGUAGE sql IMMUTABLE as
$$SELECT coalesce(($1)::TEXT, $2)::TEXT$$
"""
execute """
CREATE FUNCTION boolean_to_string(boolean, text, text)
RETURNS text LANGUAGE sql IMMUTABLE as
$$SELECT (CASE $1 WHEN true THEN $2 ELSE $3 END)::TEXT$$
"""
execute """
ALTER TABLE ammo_groups
ADD COLUMN search tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('english', coalesce("notes", '')), 'A') ||
setweight(to_tsvector('english', immutable_to_string("price_paid", '')), 'B') ||
setweight(to_tsvector('english', immutable_to_string("purchased_on", '')), 'B') ||
setweight(to_tsvector('english', immutable_to_string("count", '')), 'C')
) STORED
"""
execute("CREATE INDEX ammo_groups_trgm_idx ON ammo_groups USING GIN (search)")
execute """
ALTER TABLE containers
ADD COLUMN search tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('english', coalesce("name", '')), 'A') ||
setweight(to_tsvector('english', coalesce("desc", '')), 'B') ||
setweight(to_tsvector('english', coalesce("location", '')), 'B') ||
setweight(to_tsvector('english', coalesce("type", '')), 'C')
) STORED
"""
execute("CREATE INDEX containers_trgm_idx ON containers USING GIN (search)")
execute """
ALTER TABLE tags
ADD COLUMN search tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('english', coalesce("name", '')), 'A')
) STORED
"""
execute("CREATE INDEX tags_trgm_idx ON tags USING GIN (search)")
execute """
ALTER TABLE ammo_types
ADD COLUMN search tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('english', coalesce("name", '')), 'A') ||
setweight(to_tsvector('english', coalesce("desc", '')), 'B') ||
setweight(to_tsvector('english', coalesce("bullet_type", '')), 'C') ||
setweight(to_tsvector('english', coalesce("bullet_core", '')), 'C') ||
setweight(to_tsvector('english', coalesce("cartridge", '')), 'C') ||
setweight(to_tsvector('english', coalesce("caliber", '')), 'C') ||
setweight(to_tsvector('english', coalesce("case_material", '')), 'C') ||
setweight(to_tsvector('english', coalesce("jacket_type", '')), 'C') ||
setweight(to_tsvector('english', immutable_to_string("muzzle_velocity", '')), 'C') ||
setweight(to_tsvector('english', coalesce("powder_type", '')), 'C') ||
setweight(to_tsvector('english', immutable_to_string("powder_grains_per_charge", '')), 'C') ||
setweight(to_tsvector('english', immutable_to_string("grains", '')), 'C') ||
setweight(to_tsvector('english', coalesce("pressure", '')), 'C') ||
setweight(to_tsvector('english', coalesce("primer_type", '')), 'C') ||
setweight(to_tsvector('english', coalesce("firing_type", '')), 'C') ||
setweight(to_tsvector('english', boolean_to_string("tracer", 'tracer', '')), 'C') ||
setweight(to_tsvector('english', boolean_to_string("incendiary", 'incendiary', '')), 'C') ||
setweight(to_tsvector('english', boolean_to_string("blank", 'blank', '')), 'C') ||
setweight(to_tsvector('english', boolean_to_string("corrosive", 'corrosive', '')), 'C') ||
setweight(to_tsvector('english', coalesce("manufacturer", '')), 'D') ||
setweight(to_tsvector('english', coalesce("upc", '')), 'D')
) STORED
"""
execute("CREATE INDEX ammo_types_trgm_idx ON ammo_types USING GIN (search)")
execute """
ALTER TABLE shot_groups
ADD COLUMN search tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('english', coalesce(notes, '')), 'A') ||
setweight(to_tsvector('english', immutable_to_string(count, '')), 'B') ||
setweight(to_tsvector('english', immutable_to_string(date, '')), 'C')
) STORED
"""
execute("CREATE INDEX shot_groups_trgm_idx ON shot_groups USING GIN (search)")
end
def down do
alter table(:ammo_groups), do: remove(:search)
alter table(:containers), do: remove(:search)
alter table(:tags), do: remove(:search)
alter table(:ammo_types), do: remove(:search)
alter table(:shot_groups), do: remove(:search)
execute("DROP FUNCTION immutable_to_string(double precision, text)")
execute("DROP FUNCTION immutable_to_string(integer, text)")
execute("DROP FUNCTION immutable_to_string(date, text)")
execute("DROP FUNCTION boolean_to_string(boolean, text, text)")
end
end

View File

@ -40,11 +40,55 @@ defmodule Cannery.AmmoTest do
[ammo_type: ammo_type_fixture(current_user), current_user: current_user]
end
test "list_ammo_types/0 returns all ammo_types",
test "list_ammo_types/1 returns all ammo_types",
%{ammo_type: ammo_type, current_user: current_user} do
assert Ammo.list_ammo_types(current_user) == [ammo_type]
end
test "list_ammo_types/1 returns relevant ammo_types for a user",
%{current_user: current_user} do
ammo_type_a =
%{"name" => "bullets", "desc" => "has some pews in it", "grains" => 5}
|> ammo_type_fixture(current_user)
ammo_type_b =
%{"name" => "hollows", "grains" => 3}
|> ammo_type_fixture(current_user)
ammo_type_c =
%{
"name" => "jackets",
"desc" => "brass shell",
"tracer" => true
}
|> ammo_type_fixture(current_user)
_shouldnt_return =
%{
"name" => "bullet",
"desc" => "pews brass shell"
}
|> ammo_type_fixture(user_fixture())
# name
assert Ammo.list_ammo_types("bullet", current_user) == [ammo_type_a]
assert Ammo.list_ammo_types("bullets", current_user) == [ammo_type_a]
assert Ammo.list_ammo_types("hollow", current_user) == [ammo_type_b]
assert Ammo.list_ammo_types("jacket", current_user) == [ammo_type_c]
# desc
assert Ammo.list_ammo_types("pew", current_user) == [ammo_type_a]
assert Ammo.list_ammo_types("brass", current_user) == [ammo_type_c]
assert Ammo.list_ammo_types("shell", current_user) == [ammo_type_c]
# grains (integer)
assert Ammo.list_ammo_types("5", current_user) == [ammo_type_a]
assert Ammo.list_ammo_types("3", current_user) == [ammo_type_b]
# tracer (boolean)
assert Ammo.list_ammo_types("tracer", current_user) == [ammo_type_c]
end
test "get_ammo_type!/1 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

View File

@ -70,10 +70,30 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
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))
assert html =~ gettext("Ammo types")
assert html =~ gettext("Catalog")
assert html =~ ammo_type.bullet_type
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))
assert html =~ ammo_type.bullet_type
assert index_live
|> form("[data-qa=\"ammo_type_search\"]",
search: %{search_term: ammo_type.bullet_type}
)
|> render_change() =~ ammo_type.bullet_type
assert_patch(index_live, Routes.ammo_type_index_path(conn, :search, ammo_type.bullet_type))
refute index_live
|> form("[data-qa=\"ammo_type_search\"]", search: %{search_term: "something_else"})
|> render_change() =~ ammo_type.bullet_type
assert_patch(index_live, Routes.ammo_type_index_path(conn, :search, "something_else"))
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))
@ -102,7 +122,7 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
{:ok, index_live, _html} = live(conn, Routes.ammo_type_index_path(conn, :index))
assert index_live |> element("[data-qa=\"edit-#{ammo_type.id}\"]") |> render_click() =~
gettext("Edit Ammo type")
gettext("Edit %{ammo_type_name}", ammo_type_name: ammo_type.name)
assert_patch(index_live, Routes.ammo_type_index_path(conn, :edit, ammo_type))