Compare commits

...

20 Commits

Author SHA1 Message Date
f9b08222e1 bump version
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-04 23:19:11 -05:00
c0179f48bd mix format
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-03-04 23:17:53 -05:00
8bb4aab49c Fix ammo group create form error bug 2022-03-04 23:16:37 -05:00
9f2cc54738 fix maintain attrs hook 2022-03-04 22:56:52 -05:00
0309e9d714 fix credo 2022-03-04 22:28:05 -05:00
af4af84515 use table component for shot group table 2022-03-04 22:06:01 -05:00
ec6946068e fix view helpers display bug 2022-03-04 22:05:08 -05:00
f120e54c3e use table component for ammo group show table 2022-03-04 21:57:22 -05:00
3d115c6383 fixup! use table component for move ammo group component 2022-03-04 21:56:48 -05:00
1d4622a285 fixup! use table component for ammo group table 2022-03-04 21:09:05 -05:00
d9e7948bb0 fixup! use new table component for ammo type index table 2022-03-04 21:07:32 -05:00
da8c788992 use table component for move ammo group component 2022-03-04 20:53:18 -05:00
bd20820361 use table component for ammo group table 2022-03-04 20:00:09 -05:00
d0ee81093a use new table component for ammo type index table 2022-03-04 18:28:10 -05:00
6080fdbe64 add table component 2022-03-04 18:26:57 -05:00
f42aaf9099 fix bug with move ammo group component 2022-03-04 00:06:08 -05:00
a6aa6f3386 fix elements flashing black 2022-02-26 00:16:36 -05:00
8405513337 add link to changelog 2022-02-24 20:42:27 -05:00
d0857eccc1 remove "listing" from titles
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-24 00:52:46 -05:00
4c9e707181 merge translations
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-24 00:30:23 -05:00
31 changed files with 775 additions and 576 deletions

View File

@ -1,3 +1,10 @@
# v0.4.0
- Make tables sortable
- Add link to changelog from version number
- Fix some elements flashing with black background
- Fix bug with moving ammo group to new container
- Fix bug with no error showing up for create ammo group form
# v0.3.0 # v0.3.0
- Fix ammo type counts not showing when count is 0 - Fix ammo type counts not showing when count is 0
- Add prompt to create first container before first ammo group - Add prompt to create first container before first ammo group

View File

@ -2,7 +2,10 @@
// update. https://github.com/phoenixframework/phoenix_live_view/issues/1011 // update. https://github.com/phoenixframework/phoenix_live_view/issues/1011
export default { export default {
attrs () { return this.el.getAttribute('data-attrs').split(', ') }, attrs () {
const attrs = this.el.getAttribute('data-attrs')
if (attrs) { return attrs.split(', ') } else { return [] }
},
beforeUpdate () { this.prevAttrs = this.attrs().map(name => [name, this.el.getAttribute(name)]) }, beforeUpdate () { this.prevAttrs = this.attrs().map(name => [name, this.el.getAttribute(name)]) },
updated () { this.prevAttrs.forEach(([name, val]) => this.el.setAttribute(name, val)) } updated () { this.prevAttrs.forEach(([name, val]) => this.el.setAttribute(name, val)) }
} }

View File

@ -6,7 +6,7 @@ defmodule Cannery.Ammo do
import Ecto.Query, warn: false import Ecto.Query, warn: false
alias Cannery.{Accounts.User, Containers, Repo} alias Cannery.{Accounts.User, Containers, Repo}
alias Cannery.Ammo.{AmmoGroup, AmmoType} alias Cannery.Ammo.{AmmoGroup, AmmoType}
alias Ecto.{Changeset, Multi} alias Ecto.Changeset
@ammo_group_create_limit 10_000 @ammo_group_create_limit 10_000
@ -342,7 +342,7 @@ defmodule Cannery.Ammo do
""" """
@spec create_ammo_groups(attrs :: map(), multiplier :: non_neg_integer(), User.t()) :: @spec create_ammo_groups(attrs :: map(), multiplier :: non_neg_integer(), User.t()) ::
{:ok, {count :: non_neg_integer(), [AmmoGroup.t()] | nil}} {:ok, {count :: non_neg_integer(), [AmmoGroup.t()] | nil}}
| {:error, Changeset.t(AmmoGroup.new_ammo_group()) | nil} | {:error, Changeset.t(AmmoGroup.new_ammo_group())}
def create_ammo_groups( def create_ammo_groups(
%{"ammo_type_id" => ammo_type_id, "container_id" => container_id} = attrs, %{"ammo_type_id" => ammo_type_id, "container_id" => container_id} = attrs,
multiplier, multiplier,
@ -361,9 +361,8 @@ defmodule Cannery.Ammo do
end) end)
if changesets |> Enum.all?(fn %{valid?: valid} -> valid end) do if changesets |> Enum.all?(fn %{valid?: valid} -> valid end) do
Multi.new() {count, inserted_ammo_groups} =
|> Multi.insert_all( Repo.insert_all(
:create_ammo_groups,
AmmoGroup, AmmoGroup,
changesets changesets
|> Enum.map(fn changeset -> |> Enum.map(fn changeset ->
@ -373,14 +372,13 @@ defmodule Cannery.Ammo do
end), end),
returning: true returning: true
) )
|> Repo.transaction()
|> case do {:ok, {count, inserted_ammo_groups}}
{:ok, %{create_ammo_groups: {count, ammo_groups}}} -> {:ok, {count, ammo_groups}}
{:error, :create_ammo_groups, changeset, _changes_so_far} -> {:error, changeset}
{:error, _other_transaction, _value, _changes_so_far} -> {:error, nil}
end
else else
{:error, changesets |> List.first()} changesets
|> Enum.reject(fn %{valid?: valid} -> valid end)
|> List.first()
|> Changeset.apply_action(:insert)
end end
end end

View File

@ -4,7 +4,8 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do
""" """
use CanneryWeb, :live_component use CanneryWeb, :live_component
alias Cannery.{Accounts.User, Ammo, Ammo.AmmoGroup, Containers} alias Cannery.{Accounts.User, Ammo, Ammo.AmmoGroup, Containers, Containers.Container}
alias CanneryWeb.Endpoint
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
@impl true @impl true
@ -27,7 +28,12 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do
Containers.list_containers(current_user) Containers.list_containers(current_user)
|> Enum.reject(fn %{id: id} -> id == container_id end) |> Enum.reject(fn %{id: id} -> id == container_id end)
{:ok, socket |> assign(assigns) |> assign(changeset: changeset, containers: containers)} socket =
socket
|> assign(assigns)
|> assign(changeset: changeset, containers: containers)
{:ok, socket}
end end
@impl true @impl true
@ -54,4 +60,76 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do
{:noreply, socket} {:noreply, socket}
end end
@impl true
def render(%{containers: containers} = assigns) do
columns = [
%{label: gettext("Container"), key: "name"},
%{label: gettext("Type"), key: "type"},
%{label: gettext("Location"), key: "location"},
%{label: nil, key: "actions", sortable: false}
]
rows = containers |> get_rows_for_containers(assigns, columns)
assigns = assigns |> Map.merge(%{columns: columns, rows: rows})
~H"""
<div class="w-full flex flex-col space-y-8 justify-center items-center">
<h2 class="mb-8 text-center title text-xl text-primary-600">
<%= gettext("Move ammo") %>
</h2>
<%= if @containers |> Enum.empty?() do %>
<h2 class="title text-xl text-primary-600">
<%= gettext("No other containers") %>
<%= display_emoji("😔") %>
</h2>
<%= live_patch(dgettext("actions", "Add another container!"),
to: Routes.container_index_path(Endpoint, :new),
class: "btn btn-primary"
) %>
<% else %>
<.live_component
module={CanneryWeb.Components.TableComponent}
id="move_ammo_group_table"
columns={@columns}
rows={@rows}
/>
<% end %>
</div>
"""
end
@spec get_rows_for_containers([Container.t()], map(), [map()]) :: [map()]
defp get_rows_for_containers(containers, assigns, columns) do
containers
|> Enum.map(fn container ->
columns
|> Enum.into(%{}, fn %{key: key} -> {key, get_row_value_by_key(key, container, assigns)} end)
end)
end
@spec get_row_value_by_key(String.t(), Container.t(), map()) :: any()
defp get_row_value_by_key("actions", container, assigns) do
assigns = assigns |> Map.put(:container, container)
~H"""
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<button
type="button"
class="btn btn-primary"
phx-click="move"
phx-target={@myself}
phx-value-container_id={container.id}
>
<%= dgettext("actions", "Select") %>
</button>
</div>
"""
end
defp get_row_value_by_key(key, container, _assigns),
do: container |> Map.get(key |> String.to_existing_atom())
end end

View File

@ -1,70 +0,0 @@
<div class="w-full flex flex-col space-y-8 justify-center items-center">
<h2 class="mb-8 text-center title text-xl text-primary-600">
<%= gettext("Move ammo") %>
</h2>
<%= if @containers |> Enum.empty?() do %>
<h2 class="title text-xl text-primary-600">
<%= gettext("No other containers") %>
<%= display_emoji("😔") %>
</h2>
<%= live_patch(dgettext("actions", "Add another container!"),
to: Routes.container_index_path(Endpoint, :new),
class: "btn btn-primary"
) %>
<% else %>
<div class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black">
<table class="min-w-full table-auto text-center bg-white">
<thead class="border-b border-primary-600">
<tr>
<th class="p-2">
<%= gettext("Container") %>
</th>
<th class="p-2">
<%= gettext("Type") %>
</th>
<th class="p-2">
<%= gettext("Location") %>
</th>
<th class="p-2"></th>
</tr>
</thead>
<tbody id="containers">
<%= for container <- @containers do %>
<tr id={"container-#{container.id}"}>
<td class="p-2">
<%= container.name %>
</td>
<td class="p-2">
<%= container.type %>
</td>
<td class="p-2">
<%= container.location %>
</td>
<td class="p-2">
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<button
type="button"
class="btn btn-primary"
phx-click="move"
phx-target={@myself}
phx-value-container_id={container.id}
>
<%= dgettext("actions", "Select") %>
</button>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
</div>

View File

@ -0,0 +1,87 @@
defmodule CanneryWeb.Components.TableComponent do
@moduledoc """
Livecomponent that presents a resortable table
It takes the following required assigns:
- `:columns`: An array of maps containing the following keys
- `:label`: A gettext'd or otherwise user-facing string label for the
column. Can be nil
- `:key`: A string key used for sorting
- `:class`: Extra classes to be applied to the column element, if desired.
Optional
- `:sortable`: If false, will prevent the user from sorting with it.
Optional
- `:values`: An array of maps containing data for each row. Each map is
string-keyed with the associated column key to the following values:
- A single element, like string, integer or Phoenix.LiveView.Rendered
object, like returned from the ~H sigil
- A tuple, containing a custom value used for sorting, and the displayed
content.
"""
use CanneryWeb, :live_component
alias Phoenix.LiveView.Socket
@impl true
@spec update(
%{
required(:columns) =>
list(%{
required(:label) => String.t() | nil,
required(:key) => String.t() | nil,
optional(:class) => String.t(),
optional(:sortable) => false
}),
required(:rows) =>
list(%{
(key :: String.t()) => any() | {custom_sort_value :: String.t(), value :: any()}
}),
optional(any()) => any()
},
Socket.t()
) :: {:ok, Socket.t()}
def update(%{columns: columns, rows: rows} = assigns, socket) do
initial_key = columns |> List.first() |> Map.get(:key)
rows = rows |> Enum.sort_by(fn row -> row |> Map.get(initial_key) end, :asc)
socket =
socket
|> assign(assigns)
|> assign(columns: columns, rows: rows, last_sort_key: initial_key, sort_mode: :asc)
{:ok, socket}
end
@impl true
def handle_event(
"sort_by",
%{"sort-key" => key},
%{assigns: %{rows: rows, last_sort_key: key, sort_mode: sort_mode}} = socket
) do
sort_mode = if sort_mode == :asc, do: :desc, else: :asc
rows = rows |> sort_by_custom_sort_value_or_value(key, sort_mode)
{:noreply, socket |> assign(sort_mode: sort_mode, rows: rows)}
end
def handle_event(
"sort_by",
%{"sort-key" => key},
%{assigns: %{rows: rows}} = socket
) do
rows = rows |> sort_by_custom_sort_value_or_value(key, :asc)
{:noreply, socket |> assign(last_sort_key: key, sort_mode: :asc, rows: rows)}
end
defp sort_by_custom_sort_value_or_value(rows, key, sort_mode) do
rows
|> Enum.sort_by(
fn row ->
case row |> Map.get(key) do
{custom_sort_key, _value} -> custom_sort_key
value -> value
end
end,
sort_mode
)
end
end

View File

@ -0,0 +1,52 @@
<div class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black">
<table class="min-w-full table-auto text-center bg-white">
<thead class="border-b border-primary-600">
<tr>
<%= for %{key: key, label: label} = column <- @columns do %>
<%= if column |> Map.get(:sortable, true) do %>
<th class={"p-2 #{column[:class]}"}>
<span
class="cursor-pointer"
phx-click="sort_by"
phx-value-sort-key={key}
phx-target={@myself}
>
<span class="underline"><%= label %></span>
<%= if @last_sort_key == key do %>
<%= case @sort_mode do %>
<% :asc -> %>
<i class="fas fa-sm fa-chevron-down"></i>
<% :desc -> %>
<i class="fas fa-sm fa-chevron-up"></i>
<% end %>
<% else %>
<i class="fas fa-sm fa-chevron-up opacity-0"></i>
<% end %>
</span>
</th>
<% else %>
<th class={"p-2 #{column[:class]}"}>
<%= label %>
</th>
<% end %>
<% end %>
</tr>
</thead>
<tbody>
<%= for values <- @rows do %>
<tr>
<%= for %{key: key} = value <- @columns do %>
<td class={"p-2 #{value[:class]}"}>
<%= case values |> Map.get(key) do %>
<% {_custom_sort_value, value} -> %>
<%= value %>
<% value -> %>
<%= value %>
<% end %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@ -36,10 +36,23 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
def handle_event( def handle_event(
"validate", "validate",
%{"ammo_group" => ammo_group_params}, %{"ammo_group" => ammo_group_params},
%{assigns: %{ammo_group: ammo_group}} = socket %{assigns: %{action: action, ammo_group: ammo_group}} = socket
) do ) do
socket = socket |> assign(:changeset, ammo_group |> Ammo.change_ammo_group(ammo_group_params)) changeset_action =
{:noreply, socket} case action do
:new -> :insert
:edit -> :update
end
changeset = ammo_group |> Ammo.change_ammo_group(ammo_group_params)
changeset =
case changeset |> Changeset.apply_action(changeset_action) do
{:ok, _data} -> changeset
{:error, changeset} -> changeset
end
{:noreply, socket |> assign(:changeset, changeset)}
end end
def handle_event( def handle_event(
@ -142,9 +155,6 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
{:error, %Changeset{} = changeset} -> {:error, %Changeset{} = changeset} ->
socket |> assign(changeset: changeset) socket |> assign(changeset: changeset)
{:error, nil} ->
socket
end end
end end
end end

View File

@ -75,6 +75,112 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
defp display_ammo_groups(%{assigns: %{current_user: current_user}} = socket) do defp display_ammo_groups(%{assigns: %{current_user: current_user}} = socket) do
ammo_groups = Ammo.list_ammo_groups(current_user) |> Repo.preload([:ammo_type, :container]) ammo_groups = Ammo.list_ammo_groups(current_user) |> Repo.preload([:ammo_type, :container])
containers = Containers.list_containers(current_user) containers = Containers.list_containers(current_user)
socket |> assign(ammo_groups: ammo_groups, containers: containers)
columns = [
%{label: gettext("Ammo type"), key: "ammo_type"},
%{label: gettext("Count"), key: "count"},
%{label: gettext("Price paid"), key: "price_paid"},
%{label: gettext("% left"), key: "remaining"},
%{label: gettext("Range"), key: "range"},
%{label: gettext("Container"), key: "container"},
%{label: nil, key: "actions", sortable: false}
]
rows =
ammo_groups
|> Enum.map(fn ammo_group -> ammo_group |> get_row_data_for_ammo_group(columns) end)
socket
|> assign(ammo_groups: ammo_groups, containers: containers, columns: columns, rows: rows)
end end
@spec get_row_data_for_ammo_group(AmmoGroup.t(), [map()]) :: [map()]
defp get_row_data_for_ammo_group(ammo_group, columns) do
ammo_group = ammo_group |> Repo.preload([:ammo_type, :container])
columns
|> Enum.into(%{}, fn %{key: key} -> {key, get_value_for_key(key, ammo_group)} end)
end
@spec get_value_for_key(String.t(), AmmoGroup.t()) :: any()
defp get_value_for_key("ammo_type", %{ammo_type: ammo_type}) do
{ammo_type.name,
live_patch(ammo_type.name,
to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type),
class: "link"
)}
end
defp get_value_for_key("price_paid", %{price_paid: nil}), do: {"a", nil}
defp get_value_for_key("price_paid", %{price_paid: price_paid}),
do: gettext("$%{amount}", amount: price_paid |> :erlang.float_to_binary(decimals: 2))
defp get_value_for_key("range", %{staged: staged} = ammo_group) do
assigns = %{ammo_group: ammo_group}
{staged,
~H"""
<button
type="button"
class="btn btn-primary"
phx-click="toggle_staged"
phx-value-ammo_group_id={ammo_group.id}
>
<%= if ammo_group.staged, do: gettext("Unstage"), else: gettext("Stage") %>
</button>
<%= live_patch(dgettext("actions", "Record shots"),
to: Routes.ammo_group_index_path(Endpoint, :add_shot_group, ammo_group),
class: "btn btn-primary"
) %>
"""}
end
defp get_value_for_key("remaining", ammo_group),
do: "#{ammo_group |> Ammo.get_percentage_remaining()}%"
defp get_value_for_key("actions", ammo_group) do
assigns = %{ammo_group: ammo_group}
~H"""
<div class="py-2 px-4 h-full space-x-4 flex justify-center items-center">
<%= live_redirect to: Routes.ammo_group_show_path(Endpoint, :show, ammo_group),
class: "text-primary-600 link",
data: [qa: "view-#{ammo_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-eye"></i>
<% end %>
<%= live_patch to: Routes.ammo_group_index_path(Endpoint, :edit, ammo_group),
class: "text-primary-600 link",
data: [qa: "edit-#{ammo_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete",
phx_value_id: ammo_group.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"),
qa: "delete-#{ammo_group.id}"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>
<% end %>
</div>
"""
end
defp get_value_for_key("container", %{container: nil}), do: {nil, nil}
defp get_value_for_key("container", %{container: %{name: container_name}} = ammo_group) do
{container_name,
live_patch(container_name,
to: Routes.ammo_group_index_path(Endpoint, :move, ammo_group),
class: "btn btn-primary"
)}
end
defp get_value_for_key(key, ammo_group),
do: ammo_group |> Map.get(key |> String.to_existing_atom())
end end

View File

@ -45,116 +45,13 @@
) %> ) %>
<% end %> <% end %>
<div class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black"> <.live_component
<table class="min-w-full table-auto text-center bg-white"> module={CanneryWeb.Components.TableComponent}
<thead class="border-b border-primary-600"> id="ammo_groups_index_table"
<tr> action={@live_action}
<th class="p-2"> columns={@columns}
<%= gettext("Ammo type") %> rows={@rows}
</th> />
<th class="p-2">
<%= gettext("Count") %>
</th>
<th class="p-2">
<%= gettext("Price paid") %>
</th>
<th class="p-2">
<%= gettext("% left") %>
</th>
<th class="p-2">
<%= gettext("Range") %>
</th>
<th class="p-2">
<%= gettext("Container") %>
</th>
<th class="p-2"></th>
</tr>
</thead>
<tbody id="ammo_groups">
<%= for ammo_group <- @ammo_groups do %>
<tr id={"ammo_group-#{ammo_group.id}"}>
<td class="p-2">
<%= live_patch(ammo_group.ammo_type.name,
to: Routes.ammo_type_show_path(Endpoint, :show, ammo_group.ammo_type),
class: "link"
) %>
</td>
<td class="p-2">
<%= ammo_group.count %>
</td>
<td class="p-2">
<%= if ammo_group.price_paid do %>
<%= gettext("$%{amount}",
amount: ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)
) %>
<% end %>
</td>
<td class="p-2">
<%= "#{ammo_group |> Ammo.get_percentage_remaining()}%" %>
</td>
<td class="p-2">
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<button
type="button"
class="btn btn-primary"
phx-click="toggle_staged"
phx-value-ammo_group_id={ammo_group.id}
>
<%= if ammo_group.staged, do: gettext("Unstage"), else: gettext("Stage") %>
</button>
<%= live_patch(dgettext("actions", "Record shots"),
to: Routes.ammo_group_index_path(Endpoint, :add_shot_group, ammo_group),
class: "btn btn-primary"
) %>
</div>
</td>
<td class="p-2">
<%= if ammo_group.container do %>
<%= live_patch(ammo_group.container.name,
to: Routes.ammo_group_index_path(Endpoint, :move, ammo_group),
class: "btn btn-primary"
) %>
<% end %>
</td>
<td class="p-2">
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_redirect to: Routes.ammo_group_show_path(Endpoint, :show, ammo_group),
class: "text-primary-600 link",
data: [qa: "view-#{ammo_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-eye"></i>
<% end %>
<%= live_patch to: Routes.ammo_group_index_path(Endpoint, :edit, ammo_group),
class: "text-primary-600 link",
data: [qa: "edit-#{ammo_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete",
phx_value_id: ammo_group.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"),
qa: "delete-#{ammo_group.id}"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>
<% end %>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %> <% end %>
</div> </div>
@ -197,4 +94,5 @@
/> />
</.modal> </.modal>
<% true -> %> <% true -> %>
<% end %> <%= nil %>
<% end %>

View File

@ -5,7 +5,7 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
use CanneryWeb, :live_view use CanneryWeb, :live_view
import CanneryWeb.Components.ContainerCard import CanneryWeb.Components.ContainerCard
alias Cannery.{ActivityLog, Ammo, Ammo.AmmoGroup, Repo} alias Cannery.{ActivityLog, ActivityLog.ShotGroup, Ammo, Ammo.AmmoGroup, Repo}
alias CanneryWeb.Endpoint alias CanneryWeb.Endpoint
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
@ -84,9 +84,64 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
@spec display_ammo_group(Socket.t(), AmmoGroup.t() | AmmoGroup.id()) :: Socket.t() @spec display_ammo_group(Socket.t(), AmmoGroup.t() | AmmoGroup.id()) :: Socket.t()
defp display_ammo_group(socket, %AmmoGroup{} = ammo_group) do defp display_ammo_group(socket, %AmmoGroup{} = ammo_group) do
ammo_group = ammo_group |> Repo.preload([:container, :ammo_type, :shot_groups], force: true) ammo_group = ammo_group |> Repo.preload([:container, :ammo_type, :shot_groups], force: true)
socket |> assign(:ammo_group, ammo_group)
columns = [
%{label: gettext("Rounds shot"), key: "count"},
%{label: gettext("Notes"), key: "notes"},
%{label: gettext("Date"), key: "date"},
%{label: nil, key: "actions", sortable: false}
]
rows =
ammo_group.shot_groups
|> Enum.map(fn shot_group ->
ammo_group |> get_table_row_for_shot_group(shot_group, columns)
end)
socket |> assign(ammo_group: ammo_group, columns: columns, rows: rows)
end end
defp display_ammo_group(%{assigns: %{current_user: current_user}} = socket, id), defp display_ammo_group(%{assigns: %{current_user: current_user}} = socket, id),
do: display_ammo_group(socket, Ammo.get_ammo_group!(id, current_user)) do: display_ammo_group(socket, Ammo.get_ammo_group!(id, current_user))
@spec get_table_row_for_shot_group(AmmoGroup.t(), ShotGroup.t(), [map()]) :: [map()]
defp get_table_row_for_shot_group(ammo_group, %{date: date} = shot_group, columns) do
assigns = %{ammo_group: ammo_group, shot_group: shot_group}
columns
|> Enum.into(%{}, fn %{key: key} ->
value =
case key do
"date" ->
{date, date |> display_date()}
"actions" ->
~H"""
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_patch to: Routes.ammo_group_show_path(Endpoint, :edit_shot_group, @ammo_group, shot_group),
class: "text-primary-600 link",
data: [qa: "edit-#{shot_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete_shot_group",
phx_value_id: shot_group.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this shot record?"),
qa: "delete-#{shot_group.id}"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>
<% end %>
</div>
"""
key ->
shot_group |> Map.get(key |> String.to_existing_atom())
end
{key, value}
end)
end
end end

View File

@ -111,63 +111,12 @@
<%= gettext("Rounds used") %> <%= gettext("Rounds used") %>
</h1> </h1>
<div class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black"> <.live_component
<table class="min-w-full table-auto text-center bg-white"> module={CanneryWeb.Components.TableComponent}
<thead class="border-b border-primary-600"> id="ammo_group_shot_groups_table"
<tr> columns={@columns}
<th class="p-2"> rows={@rows}
<%= gettext("Rounds shot") %> />
</th>
<th class="p-2">
<%= gettext("Notes") %>
</th>
<th class="p-2">
<%= gettext("Date") %>
</th>
<th class="p-2"></th>
</tr>
</thead>
<tbody id="shot_groups">
<%= for shot_group <- @ammo_group.shot_groups do %>
<tr id={"shot_group-#{shot_group.id}"}>
<td class="p-2">
<%= shot_group.count %>
</td>
<td class="p-2">
<%= shot_group.notes %>
</td>
<td class="p-2">
<%= shot_group.date |> display_date() %>
</td>
<td class="p-2 w-full h-full space-x-2 flex justify-center items-center">
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_patch to: Routes.ammo_group_show_path(Endpoint, :edit_shot_group, @ammo_group, shot_group),
class: "text-primary-600 link",
data: [qa: "edit-#{shot_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete_shot_group",
phx_value_id: shot_group.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this shot record?"),
qa: "delete-#{shot_group.id}"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>
<% end %>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %> <% end %>
</div> </div>

View File

@ -31,7 +31,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
end end
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket |> assign(:page_title, gettext("Listing Ammo types")) |> assign(:ammo_type, nil) socket |> assign(:page_title, gettext("Ammo types")) |> assign(:ammo_type, nil)
end end
@impl true @impl true
@ -46,37 +46,103 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
defp list_ammo_types(%{assigns: %{current_user: current_user}} = socket) do defp list_ammo_types(%{assigns: %{current_user: current_user}} = socket) do
ammo_types = Ammo.list_ammo_types(current_user) ammo_types = Ammo.list_ammo_types(current_user)
columns_to_display = columns =
[ [
{gettext("Name"), :name, :string}, %{label: gettext("Name"), key: "name", type: :string},
{gettext("Bullet type"), :bullet_type, :string}, %{label: gettext("Bullet type"), key: "bullet_type", type: :string},
{gettext("Bullet core"), :bullet_core, :string}, %{label: gettext("Bullet core"), key: "bullet_core", type: :string},
{gettext("Cartridge"), :cartridge, :string}, %{label: gettext("Cartridge"), key: "cartridge", type: :string},
{gettext("Caliber"), :caliber, :string}, %{label: gettext("Caliber"), key: "caliber", type: :string},
{gettext("Case material"), :case_material, :string}, %{label: gettext("Case material"), key: "case_material", type: :string},
{gettext("Jacket type"), :jacket_type, :string}, %{label: gettext("Jacket type"), key: "jacket_type", type: :string},
{gettext("Muzzle velocity"), :muzzle_velocity, :string}, %{label: gettext("Muzzle velocity"), key: "muzzle_velocity", type: :string},
{gettext("Powder type"), :powder_type, :string}, %{label: gettext("Powder type"), key: "powder_type", type: :string},
{gettext("Powder grains per charge"), :powder_grains_per_charge, :string}, %{
{gettext("Grains"), :grains, :string}, label: gettext("Powder grains per charge"),
{gettext("Pressure"), :pressure, :string}, key: "powder_grains_per_charge",
{gettext("Primer type"), :primer_type, :string}, type: :string
{gettext("Firing type"), :firing_type, :string}, },
{gettext("Tracer"), :tracer, :boolean}, %{label: gettext("Grains"), key: "grains", type: :string},
{gettext("Incendiary"), :incendiary, :boolean}, %{label: gettext("Pressure"), key: "pressure", type: :string},
{gettext("Blank"), :blank, :boolean}, %{label: gettext("Primer type"), key: "primer_type", type: :string},
{gettext("Corrosive"), :corrosive, :boolean}, %{label: gettext("Firing type"), key: "firing_type", type: :string},
{gettext("Manufacturer"), :manufacturer, :string}, %{label: gettext("Tracer"), key: "tracer", type: :boolean},
{gettext("UPC"), :upc, :string} %{label: gettext("Incendiary"), key: "incendiary", type: :boolean},
%{label: gettext("Blank"), key: "blank", type: :boolean},
%{label: gettext("Corrosive"), key: "corrosive", type: :boolean},
%{label: gettext("Manufacturer"), key: "manufacturer", type: :string},
%{label: gettext("UPC"), key: "upc", type: :string}
] ]
|> Enum.filter(fn {_label, field, type} -> |> Enum.filter(fn %{key: key, type: type} ->
# remove columns if all values match defaults # remove columns if all values match defaults
default_value = if type == :boolean, do: false, else: nil default_value = if type == :boolean, do: false, else: nil
ammo_types ammo_types
|> Enum.any?(fn ammo_type -> not (ammo_type |> Map.get(field) == default_value) end) |> Enum.any?(fn ammo_type ->
not (ammo_type |> Map.get(key |> String.to_existing_atom()) == default_value)
end) end)
end)
|> Kernel.++([
%{label: gettext("Total # of rounds"), key: "round_count", type: :round_count},
%{label: nil, key: "actions", type: :actions, sortable: false}
])
socket |> assign(ammo_types: ammo_types, columns_to_display: columns_to_display) rows =
ammo_types
|> Enum.map(fn ammo_type -> ammo_type |> get_ammo_type_values(columns, current_user) end)
socket |> assign(columns: columns, rows: rows)
end
defp get_ammo_type_values(ammo_type, columns, current_user) do
assigns = %{ammo_type: ammo_type}
columns
|> Enum.into(%{}, fn %{key: key, type: type} ->
value =
case type do
:boolean ->
ammo_type |> Map.get(key |> String.to_existing_atom()) |> humanize()
:round_count ->
ammo_type |> Ammo.get_round_count_for_ammo_type(current_user)
:actions ->
~H"""
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_redirect to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type),
class: "text-primary-600 link",
data: [qa: "view-#{ammo_type.id}"] do %>
<i class="fa-fw fa-lg fas fa-eye"></i>
<% end %>
<%= live_patch to: Routes.ammo_type_index_path(Endpoint, :edit, ammo_type),
class: "text-primary-600 link",
data: [qa: "edit-#{ammo_type.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete",
phx_value_id: ammo_type.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"),
qa: "delete-#{ammo_type.id}"
] do %>
<i class="fa-lg fas fa-trash"></i>
<% end %>
</div>
"""
nil ->
nil
_other ->
ammo_type |> Map.get(key |> String.to_existing_atom())
end
{key, value}
end)
end end
end end

View File

@ -3,7 +3,7 @@
<%= gettext("Ammo Types") %> <%= gettext("Ammo Types") %>
</h1> </h1>
<%= if @ammo_types |> Enum.empty?() do %> <%= if @rows |> Enum.empty?() do %>
<h2 class="title text-xl text-primary-600"> <h2 class="title text-xl text-primary-600">
<%= gettext("No Ammo Types") %> <%= gettext("No Ammo Types") %>
<%= display_emoji("😔") %> <%= display_emoji("😔") %>
@ -19,71 +19,13 @@
class: "btn btn-primary" class: "btn btn-primary"
) %> ) %>
<div class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black"> <.live_component
<table class="min-w-full table-auto text-center bg-white"> module={CanneryWeb.Components.TableComponent}
<thead class="border-b border-primary-600"> id="ammo_types_index_table"
<tr> action={@live_action}
<%= for {field_name, _field, _type} <- @columns_to_display do %> columns={@columns}
<th class="p-2"> rows={@rows}
<%= field_name %> />
</th>
<% end %>
<th class="p-2">
<%= gettext("Total # of rounds") %>
</th>
<th class="p-2"></th>
</tr>
</thead>
<tbody>
<%= for ammo_type <- @ammo_types do %>
<tr id={"ammo_type-#{ammo_type.id}"}>
<%= for {_label, field, type} <- @columns_to_display do %>
<td class="p-2">
<%= case type do %>
<% :boolean -> %>
<%= ammo_type |> Map.get(field) |> humanize() %>
<% _other -> %>
<%= ammo_type |> Map.get(field) %>
<% end %>
</td>
<% end %>
<td class="p-2">
<%= ammo_type |> Ammo.get_round_count_for_ammo_type(@current_user) %>
</td>
<td class="p-2">
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_redirect to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type),
class: "text-primary-600 link",
data: [qa: "view-#{ammo_type.id}"] do %>
<i class="fa-fw fa-lg fas fa-eye"></i>
<% end %>
<%= live_patch to: Routes.ammo_type_index_path(Endpoint, :edit, ammo_type),
class: "text-primary-600 link",
data: [qa: "edit-#{ammo_type.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete",
phx_value_id: ammo_type.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"),
qa: "delete-#{ammo_type.id}"
] do %>
<i class="fa-lg fas fa-trash"></i>
<% end %>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %> <% end %>
</div> </div>

View File

@ -35,7 +35,7 @@ defmodule CanneryWeb.ContainerLive.Index do
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket socket
|> assign(:page_title, gettext("Listing Containers")) |> assign(:page_title, gettext("Containers"))
|> assign(:container, nil) |> assign(:container, nil)
|> display_containers() |> display_containers()
end end

View File

@ -127,11 +127,15 @@ defmodule CanneryWeb.HomeLive do
</p> </p>
</li> </li>
<li class="flex flex-row justify-center space-x-2"> <li class="flex flex-row justify-center items-center space-x-2">
<b>Version:</b> <b>Version:</b>
<p> <%= link class: "flex flex-row justify-center items-center space-x-2 hover:underline",
0.3.0 to: "https://gitea.bubbletea.dev/shibao/cannery/src/branch/stable/CHANGELOG.md",
</p> target: "_blank",
rel: "noopener noreferrer" do %>
<p>0.4.0</p>
<i class="fas fa-md fa-info-circle"></i>
<% end %>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -40,7 +40,7 @@ defmodule CanneryWeb.InviteLive.Index do
end end
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket |> assign(page_title: gettext("Listing Invites"), invite: nil) socket |> assign(page_title: gettext("Invites"), invite: nil)
end end
@impl true @impl true

View File

@ -77,6 +77,69 @@ defmodule CanneryWeb.RangeLive.Index do
ActivityLog.list_shot_groups(current_user) |> Repo.preload(ammo_group: :ammo_type) ActivityLog.list_shot_groups(current_user) |> Repo.preload(ammo_group: :ammo_type)
ammo_groups = Ammo.list_staged_ammo_groups(current_user) ammo_groups = Ammo.list_staged_ammo_groups(current_user)
socket |> assign(shot_groups: shot_groups, ammo_groups: ammo_groups)
columns = [
%{label: gettext("Ammo"), key: "name"},
%{label: gettext("Rounds shot"), key: "count"},
%{label: gettext("Notes"), key: "notes"},
%{label: gettext("Date"), key: "date"},
%{label: nil, key: "actions", sortable: false}
]
rows =
shot_groups
|> Enum.map(fn shot_group -> shot_group |> get_row_data_for_shot_group(columns) end)
socket
|> assign(ammo_groups: ammo_groups, columns: columns, rows: rows, shot_groups: shot_groups)
end
@spec get_row_data_for_shot_group(ShotGroup.t(), [map()]) :: [map()]
defp get_row_data_for_shot_group(%{date: date} = shot_group, columns) do
shot_group = shot_group |> Repo.preload(ammo_group: :ammo_type)
assigns = %{shot_group: shot_group}
columns
|> Enum.into(%{}, fn %{key: key} ->
value =
case key do
"name" ->
{shot_group.ammo_group.ammo_type.name,
live_patch(shot_group.ammo_group.ammo_type.name,
to: Routes.ammo_group_show_path(Endpoint, :show, shot_group.ammo_group),
class: "link"
)}
"date" ->
date |> display_date()
"actions" ->
~H"""
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_patch to: Routes.range_index_path(Endpoint, :edit, shot_group),
class: "text-primary-600 link",
data: [qa: "edit-#{shot_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete",
phx_value_id: shot_group.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this shot record?"),
qa: "delete-#{shot_group.id}"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>
<% end %>
</div>
"""
key ->
shot_group |> Map.get(key |> String.to_existing_atom())
end
{key, value}
end)
end end
end end

View File

@ -53,70 +53,12 @@
<%= gettext("Shot log") %> <%= gettext("Shot log") %>
</h1> </h1>
<div class="w-full overflow-x-auto border border-gray-600 rounded-lg shadow-lg bg-black"> <.live_component
<table class="min-w-full table-auto text-center bg-white"> module={CanneryWeb.Components.TableComponent}
<thead class="border-b border-primary-600"> id="shot_groups_index_table"
<tr> columns={@columns}
<th class="p-2"> rows={@rows}
<%= gettext("Ammo") %> />
</th>
<th class="p-2">
<%= gettext("Rounds shot") %>
</th>
<th class="p-2">
<%= gettext("Notes") %>
</th>
<th class="p-2">
<%= gettext("Date") %>
</th>
<th class="p-2"></th>
</tr>
</thead>
<tbody id="shot_groups">
<%= for shot_group <- @shot_groups do %>
<tr id={"shot_group-#{shot_group.id}"}>
<td class="p-2">
<%= live_patch(shot_group.ammo_group.ammo_type.name,
to: Routes.ammo_group_show_path(Endpoint, :show, shot_group.ammo_group),
class: "link"
) %>
</td>
<td class="p-2">
<%= shot_group.count %>
</td>
<td class="p-2">
<%= shot_group.notes %>
</td>
<td class="p-2">
<%= shot_group.date |> display_date() %>
</td>
<td class="p-2 w-full h-full space-x-2 flex justify-center items-center">
<div class="px-4 py-2 space-x-4 flex justify-center items-center">
<%= live_patch to: Routes.range_index_path(Endpoint, :edit, shot_group),
class: "text-primary-600 link",
data: [qa: "edit-#{shot_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-edit"></i>
<% end %>
<%= link to: "#",
class: "text-primary-600 link",
phx_click: "delete",
phx_value_id: shot_group.id,
data: [
confirm: dgettext("prompts", "Are you sure you want to delete this shot record?"),
qa: "delete-#{shot_group.id}"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>
<% end %>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %> <% end %>
</div> </div>

View File

@ -31,7 +31,7 @@ defmodule CanneryWeb.TagLive.Index do
end end
defp apply_action(socket, :index, _params) do defp apply_action(socket, :index, _params) do
socket |> assign(:page_title, gettext("Listing Tags")) |> assign(:tag, nil) socket |> assign(:page_title, gettext("Tags")) |> assign(:tag, nil)
end end
@impl true @impl true

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" class="m-0 p-0 w-full h-full"> <html lang="en" class="m-0 p-0 w-full h-full bg-white">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
@ -17,7 +17,7 @@
</script> </script>
</head> </head>
<body class="m-0 p-0 w-full h-full"> <body class="m-0 p-0 w-full h-full bg-white">
<%= @inner_content %> <%= @inner_content %>
</body> </body>
</html> </html>

View File

@ -7,6 +7,8 @@ defmodule CanneryWeb.ViewHelpers do
import Phoenix.LiveView.Helpers import Phoenix.LiveView.Helpers
@id_length 16
@doc """ @doc """
Returns a <time> element that renders the naivedatetime in the user's local Returns a <time> element that renders the naivedatetime in the user's local
timezone with Alpine.js timezone with Alpine.js
@ -16,11 +18,12 @@ defmodule CanneryWeb.ViewHelpers do
def display_datetime(datetime) do def display_datetime(datetime) do
assigns = %{ assigns = %{
id: :crypto.strong_rand_bytes(@id_length) |> Base.url_encode64(),
datetime: datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended) datetime: datetime |> DateTime.from_naive!("Etc/UTC") |> DateTime.to_iso8601(:extended)
} }
~H""" ~H"""
<time datetime={@datetime} x-data={"{ <time id={@id} datetime={@datetime} x-data={"{
date: date:
Intl.DateTimeFormat([], {dateStyle: 'short', timeStyle: 'long'}) Intl.DateTimeFormat([], {dateStyle: 'short', timeStyle: 'long'})
.format(new Date(\"#{@datetime}\")) .format(new Date(\"#{@datetime}\"))
@ -38,10 +41,13 @@ defmodule CanneryWeb.ViewHelpers do
def display_date(nil), do: "" def display_date(nil), do: ""
def display_date(date) do def display_date(date) do
assigns = %{date: date |> Date.to_iso8601(:extended)} assigns = %{
id: :crypto.strong_rand_bytes(@id_length) |> Base.url_encode64(),
date: date |> Date.to_iso8601(:extended)
}
~H""" ~H"""
<time datetime={@date} x-data={"{ <time id={@id} datetime={@date} x-data={"{
date: date:
Intl.DateTimeFormat([], {timeZone: 'Etc/UTC', dateStyle: 'short'}).format(new Date(\"#{@date}\")) Intl.DateTimeFormat([], {timeZone: 'Etc/UTC', dateStyle: 'short'}).format(new Date(\"#{@date}\"))
}"} x-text="date"> }"} x-text="date">

View File

@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
def project do def project do
[ [
app: :cannery, app: :cannery,
version: "0.3.0", version: "0.4.0",
elixir: "~> 1.12", elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()), elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:gettext] ++ Mix.compilers(), compilers: [:gettext] ++ Mix.compilers(),

View File

@ -160,7 +160,7 @@ msgid "Why not get some ready to shoot?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:111 #: lib/cannery_web/live/ammo_group_live/index.ex:133
#: lib/cannery_web/live/ammo_group_live/show.html.heex:86 #: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:36 #: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots" msgid "Record shots"
@ -172,7 +172,7 @@ msgid "Ammo Details"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:12 #: lib/cannery_web/components/move_ammo_group_component.ex:89
msgid "Add another container!" msgid "Add another container!"
msgstr "" msgstr ""
@ -182,7 +182,7 @@ msgid "Move containers"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:60 #: lib/cannery_web/components/move_ammo_group_component.ex:127
msgid "Select" msgid "Select"
msgstr "" msgstr ""

View File

@ -33,13 +33,13 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:52 #: lib/cannery_web/components/topbar.ex:52
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3 #: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#: lib/cannery_web/live/range_live/index.html.heex:61 #: lib/cannery_web/live/range_live/index.ex:82
msgid "Ammo" msgid "Ammo"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_group_live/index.html.heex:53 #: lib/cannery_web/live/ammo_group_live/index.ex:80
msgid "Ammo type" msgid "Ammo type"
msgstr "" msgstr ""
@ -55,7 +55,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:67 #: lib/cannery_web/live/ammo_type_live/index.ex:71
#: lib/cannery_web/live/ammo_type_live/show.html.heex:55 #: lib/cannery_web/live/ammo_type_live/show.html.heex:55
msgid "Blank" msgid "Blank"
msgstr "" msgstr ""
@ -101,28 +101,29 @@ msgid "Case material"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:22 #: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/index.html.heex:68 #: lib/cannery_web/live/ammo_group_live/index.ex:85
msgid "Container" msgid "Container"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:46 #: lib/cannery_web/components/topbar.ex:46
#: lib/cannery_web/live/container_live/index.ex:38
#: lib/cannery_web/live/container_live/index.html.heex:3 #: lib/cannery_web/live/container_live/index.html.heex:3
msgid "Containers" msgid "Containers"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:68 #: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56 #: lib/cannery_web/live/ammo_type_live/show.html.heex:56
msgid "Corrosive" msgid "Corrosive"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56 #: lib/cannery_web/live/ammo_group_live/index.ex:81
msgid "Count" msgid "Count"
msgstr "" msgstr ""
@ -193,14 +194,14 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:61 #: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/show.html.heex:49 #: lib/cannery_web/live/ammo_type_live/show.html.heex:49
msgid "Grains" msgid "Grains"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:66 #: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54 #: lib/cannery_web/live/ammo_type_live/show.html.heex:54
msgid "Incendiary" msgid "Incendiary"
msgstr "" msgstr ""
@ -222,6 +223,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:71 #: lib/cannery_web/components/topbar.ex:71
#: lib/cannery_web/live/invite_live/index.ex:43
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
msgid "Invites" msgid "Invites"
msgstr "" msgstr ""
@ -232,27 +234,7 @@ msgid "Keep me logged in for 60 days"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:34 #: lib/cannery_web/components/move_ammo_group_component.ex:69
msgid "Listing Ammo types"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:38
msgid "Listing Containers"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:43
msgid "Listing Invites"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/index.ex:34
msgid "Listing Tags"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:30
#: lib/cannery_web/live/container_live/form_component.html.heex:42 #: lib/cannery_web/live/container_live/form_component.html.heex:42
msgid "Location" msgid "Location"
msgstr "" msgstr ""
@ -275,7 +257,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:69 #: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.html.heex:57 #: lib/cannery_web/live/ammo_type_live/show.html.heex:57
msgid "Manufacturer" msgid "Manufacturer"
msgstr "" msgstr ""
@ -358,9 +340,9 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/add_shot_group_component.html.heex:30 #: lib/cannery_web/components/add_shot_group_component.html.heex:30
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41
#: lib/cannery_web/live/ammo_group_live/show.html.heex:122 #: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/form_component.html.heex:29 #: lib/cannery_web/live/range_live/form_component.html.heex:29
#: lib/cannery_web/live/range_live/index.html.heex:67 #: lib/cannery_web/live/range_live/index.ex:84
msgid "Notes" msgid "Notes"
msgstr "" msgstr ""
@ -377,14 +359,14 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:62 #: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/show.html.heex:50 #: lib/cannery_web/live/ammo_type_live/show.html.heex:50
msgid "Pressure" msgid "Pressure"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59 #: lib/cannery_web/live/ammo_group_live/index.ex:82
msgid "Price paid" msgid "Price paid"
msgstr "" msgstr ""
@ -395,7 +377,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:63 #: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/show.html.heex:51 #: lib/cannery_web/live/ammo_type_live/show.html.heex:51
msgid "Primer type" msgid "Primer type"
msgstr "" msgstr ""
@ -453,6 +435,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:40 #: lib/cannery_web/components/topbar.ex:40
#: lib/cannery_web/live/tag_live/index.ex:34
#: lib/cannery_web/live/tag_live/index.html.heex:3 #: lib/cannery_web/live/tag_live/index.html.heex:3
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
@ -479,13 +462,13 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:65 #: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/show.html.heex:53 #: lib/cannery_web/live/ammo_type_live/show.html.heex:53
msgid "Tracer" msgid "Tracer"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:26 #: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/container_live/form_component.html.heex:35 #: lib/cannery_web/live/container_live/form_component.html.heex:35
msgid "Type" msgid "Type"
msgstr "" msgstr ""
@ -528,7 +511,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:64 #: lib/cannery_web/components/topbar.ex:64
#: lib/cannery_web/live/ammo_group_live/index.html.heex:65 #: lib/cannery_web/live/ammo_group_live/index.ex:84
msgid "Range" msgid "Range"
msgstr "" msgstr ""
@ -538,8 +521,8 @@ msgid "Range day"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:125 #: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/index.html.heex:70 #: lib/cannery_web/live/range_live/index.ex:85
msgid "Date" msgid "Date"
msgstr "" msgstr ""
@ -609,8 +592,8 @@ msgid "Rounds left"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:119 #: lib/cannery_web/live/ammo_group_live/show.ex:89
#: lib/cannery_web/live/range_live/index.html.heex:64 #: lib/cannery_web/live/range_live/index.ex:83
msgid "Rounds shot" msgid "Rounds shot"
msgstr "" msgstr ""
@ -626,12 +609,12 @@ msgid "Move Ammo group"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:3 #: lib/cannery_web/components/move_ammo_group_component.ex:80
msgid "Move ammo" msgid "Move ammo"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:8 #: lib/cannery_web/components/move_ammo_group_component.ex:85
msgid "No other containers" msgid "No other containers"
msgstr "" msgstr ""
@ -642,7 +625,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:43 #: lib/cannery_web/components/ammo_group_card.ex:43
#: lib/cannery_web/live/ammo_group_live/index.html.heex:90 #: lib/cannery_web/live/ammo_group_live/index.ex:117
#: lib/cannery_web/live/ammo_group_live/show.html.heex:32 #: lib/cannery_web/live/ammo_group_live/show.html.heex:32
#: lib/cannery_web/live/ammo_group_live/show.html.heex:39 #: lib/cannery_web/live/ammo_group_live/show.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:98 #: lib/cannery_web/live/ammo_type_live/show.html.heex:98
@ -670,7 +653,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:60 #: lib/cannery_web/live/ammo_type_live/index.ex:61
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48 #: lib/cannery_web/live/ammo_type_live/show.html.heex:48
msgid "Powder grains per charge" msgid "Powder grains per charge"
msgstr "" msgstr ""
@ -684,7 +667,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:70 #: lib/cannery_web/live/ammo_type_live/index.ex:74
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58 #: lib/cannery_web/live/ammo_type_live/show.html.heex:58
msgid "UPC" msgid "UPC"
msgstr "" msgstr ""
@ -706,18 +689,18 @@ msgid "New password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108 #: lib/cannery_web/live/ammo_group_live/index.ex:130
msgid "Stage" msgid "Stage"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108 #: lib/cannery_web/live/ammo_group_live/index.ex:130
msgid "Unstage" msgid "Unstage"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:64 #: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/show.html.heex:52 #: lib/cannery_web/live/ammo_type_live/show.html.heex:52
msgid "Firing type" msgid "Firing type"
msgstr "" msgstr ""
@ -760,7 +743,7 @@ msgid "No cost information"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:62 #: lib/cannery_web/live/ammo_group_live/index.ex:83
msgid "% left" msgid "% left"
msgstr "" msgstr ""
@ -795,7 +778,7 @@ msgid "Current # of rounds:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.html.heex:32 #: lib/cannery_web/live/ammo_type_live/index.ex:86
msgid "Total # of rounds" msgid "Total # of rounds"
msgstr "" msgstr ""
@ -839,3 +822,8 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:58 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:58
msgid "Copies" msgid "Copies"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:34
msgid "Ammo types"
msgstr ""

View File

@ -125,8 +125,8 @@ msgid "Reset password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/add_shot_group_component.html.heex:42 #: lib/cannery_web/components/add_shot_group_component.html.heex:46
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:54 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:73
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:156 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:156
#: lib/cannery_web/live/container_live/form_component.html.heex:50 #: lib/cannery_web/live/container_live/form_component.html.heex:50
#: lib/cannery_web/live/invite_live/form_component.html.heex:28 #: lib/cannery_web/live/invite_live/form_component.html.heex:28
@ -161,7 +161,7 @@ msgid "Why not get some ready to shoot?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:111 #: lib/cannery_web/live/ammo_group_live/index.ex:133
#: lib/cannery_web/live/ammo_group_live/show.html.heex:86 #: lib/cannery_web/live/ammo_group_live/show.html.heex:86
#: lib/cannery_web/live/range_live/index.html.heex:36 #: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots" msgid "Record shots"
@ -173,7 +173,7 @@ msgid "Ammo Details"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:12 #: lib/cannery_web/components/move_ammo_group_component.ex:89
msgid "Add another container!" msgid "Add another container!"
msgstr "" msgstr ""
@ -183,7 +183,7 @@ msgid "Move containers"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:60 #: lib/cannery_web/components/move_ammo_group_component.ex:127
msgid "Select" msgid "Select"
msgstr "" msgstr ""
@ -197,3 +197,8 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36 #: lib/cannery_web/live/ammo_group_live/index.html.heex:36
msgid "add a container first" msgid "add a container first"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:66
msgid "Create"
msgstr ""

View File

@ -34,13 +34,13 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:52 #: lib/cannery_web/components/topbar.ex:52
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3 #: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#: lib/cannery_web/live/range_live/index.html.heex:61 #: lib/cannery_web/live/range_live/index.ex:82
msgid "Ammo" msgid "Ammo"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
#: lib/cannery_web/live/ammo_group_live/index.html.heex:53 #: lib/cannery_web/live/ammo_group_live/index.ex:80
msgid "Ammo type" msgid "Ammo type"
msgstr "" msgstr ""
@ -56,7 +56,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:140
#: lib/cannery_web/live/ammo_type_live/index.ex:67 #: lib/cannery_web/live/ammo_type_live/index.ex:71
#: lib/cannery_web/live/ammo_type_live/show.html.heex:55 #: lib/cannery_web/live/ammo_type_live/show.html.heex:55
msgid "Blank" msgid "Blank"
msgstr "" msgstr ""
@ -102,28 +102,29 @@ msgid "Case material"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:22 #: lib/cannery_web/components/move_ammo_group_component.ex:67
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/index.html.heex:68 #: lib/cannery_web/live/ammo_group_live/index.ex:85
msgid "Container" msgid "Container"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:46 #: lib/cannery_web/components/topbar.ex:46
#: lib/cannery_web/live/container_live/index.ex:38
#: lib/cannery_web/live/container_live/index.html.heex:3 #: lib/cannery_web/live/container_live/index.html.heex:3
msgid "Containers" msgid "Containers"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:144
#: lib/cannery_web/live/ammo_type_live/index.ex:68 #: lib/cannery_web/live/ammo_type_live/index.ex:72
#: lib/cannery_web/live/ammo_type_live/show.html.heex:56 #: lib/cannery_web/live/ammo_type_live/show.html.heex:56
msgid "Corrosive" msgid "Corrosive"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56 #: lib/cannery_web/live/ammo_group_live/index.ex:81
msgid "Count" msgid "Count"
msgstr "" msgstr ""
@ -194,14 +195,14 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:103
#: lib/cannery_web/live/ammo_type_live/index.ex:61 #: lib/cannery_web/live/ammo_type_live/index.ex:65
#: lib/cannery_web/live/ammo_type_live/show.html.heex:49 #: lib/cannery_web/live/ammo_type_live/show.html.heex:49
msgid "Grains" msgid "Grains"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:136
#: lib/cannery_web/live/ammo_type_live/index.ex:66 #: lib/cannery_web/live/ammo_type_live/index.ex:70
#: lib/cannery_web/live/ammo_type_live/show.html.heex:54 #: lib/cannery_web/live/ammo_type_live/show.html.heex:54
msgid "Incendiary" msgid "Incendiary"
msgstr "" msgstr ""
@ -223,6 +224,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:71 #: lib/cannery_web/components/topbar.ex:71
#: lib/cannery_web/live/invite_live/index.ex:43
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
msgid "Invites" msgid "Invites"
msgstr "" msgstr ""
@ -233,27 +235,7 @@ msgid "Keep me logged in for 60 days"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:34 #: lib/cannery_web/components/move_ammo_group_component.ex:69
msgid "Listing Ammo types"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:38
msgid "Listing Containers"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:43
msgid "Listing Invites"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/index.ex:34
msgid "Listing Tags"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:30
#: lib/cannery_web/live/container_live/form_component.html.heex:42 #: lib/cannery_web/live/container_live/form_component.html.heex:42
msgid "Location" msgid "Location"
msgstr "" msgstr ""
@ -276,7 +258,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:148
#: lib/cannery_web/live/ammo_type_live/index.ex:69 #: lib/cannery_web/live/ammo_type_live/index.ex:73
#: lib/cannery_web/live/ammo_type_live/show.html.heex:57 #: lib/cannery_web/live/ammo_type_live/show.html.heex:57
msgid "Manufacturer" msgid "Manufacturer"
msgstr "" msgstr ""
@ -359,9 +341,9 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/add_shot_group_component.html.heex:30 #: lib/cannery_web/components/add_shot_group_component.html.heex:30
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41
#: lib/cannery_web/live/ammo_group_live/show.html.heex:122 #: lib/cannery_web/live/ammo_group_live/show.ex:90
#: lib/cannery_web/live/range_live/form_component.html.heex:29 #: lib/cannery_web/live/range_live/form_component.html.heex:29
#: lib/cannery_web/live/range_live/index.html.heex:67 #: lib/cannery_web/live/range_live/index.ex:84
msgid "Notes" msgid "Notes"
msgstr "" msgstr ""
@ -378,14 +360,14 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:111
#: lib/cannery_web/live/ammo_type_live/index.ex:62 #: lib/cannery_web/live/ammo_type_live/index.ex:66
#: lib/cannery_web/live/ammo_type_live/show.html.heex:50 #: lib/cannery_web/live/ammo_type_live/show.html.heex:50
msgid "Pressure" msgid "Pressure"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59 #: lib/cannery_web/live/ammo_group_live/index.ex:82
msgid "Price paid" msgid "Price paid"
msgstr "" msgstr ""
@ -396,7 +378,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:118
#: lib/cannery_web/live/ammo_type_live/index.ex:63 #: lib/cannery_web/live/ammo_type_live/index.ex:67
#: lib/cannery_web/live/ammo_type_live/show.html.heex:51 #: lib/cannery_web/live/ammo_type_live/show.html.heex:51
msgid "Primer type" msgid "Primer type"
msgstr "" msgstr ""
@ -454,6 +436,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:40 #: lib/cannery_web/components/topbar.ex:40
#: lib/cannery_web/live/tag_live/index.ex:34
#: lib/cannery_web/live/tag_live/index.html.heex:3 #: lib/cannery_web/live/tag_live/index.html.heex:3
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
@ -480,13 +463,13 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:132
#: lib/cannery_web/live/ammo_type_live/index.ex:65 #: lib/cannery_web/live/ammo_type_live/index.ex:69
#: lib/cannery_web/live/ammo_type_live/show.html.heex:53 #: lib/cannery_web/live/ammo_type_live/show.html.heex:53
msgid "Tracer" msgid "Tracer"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:26 #: lib/cannery_web/components/move_ammo_group_component.ex:68
#: lib/cannery_web/live/container_live/form_component.html.heex:35 #: lib/cannery_web/live/container_live/form_component.html.heex:35
msgid "Type" msgid "Type"
msgstr "" msgstr ""
@ -529,7 +512,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:64 #: lib/cannery_web/components/topbar.ex:64
#: lib/cannery_web/live/ammo_group_live/index.html.heex:65 #: lib/cannery_web/live/ammo_group_live/index.ex:84
msgid "Range" msgid "Range"
msgstr "" msgstr ""
@ -539,8 +522,8 @@ msgid "Range day"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:125 #: lib/cannery_web/live/ammo_group_live/show.ex:91
#: lib/cannery_web/live/range_live/index.html.heex:70 #: lib/cannery_web/live/range_live/index.ex:85
msgid "Date" msgid "Date"
msgstr "" msgstr ""
@ -610,8 +593,8 @@ msgid "Rounds left"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:119 #: lib/cannery_web/live/ammo_group_live/show.ex:89
#: lib/cannery_web/live/range_live/index.html.heex:64 #: lib/cannery_web/live/range_live/index.ex:83
msgid "Rounds shot" msgid "Rounds shot"
msgstr "" msgstr ""
@ -627,12 +610,12 @@ msgid "Move Ammo group"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:3 #: lib/cannery_web/components/move_ammo_group_component.ex:80
msgid "Move ammo" msgid "Move ammo"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.html.heex:8 #: lib/cannery_web/components/move_ammo_group_component.ex:85
msgid "No other containers" msgid "No other containers"
msgstr "" msgstr ""
@ -643,7 +626,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:43 #: lib/cannery_web/components/ammo_group_card.ex:43
#: lib/cannery_web/live/ammo_group_live/index.html.heex:90 #: lib/cannery_web/live/ammo_group_live/index.ex:117
#: lib/cannery_web/live/ammo_group_live/show.html.heex:32 #: lib/cannery_web/live/ammo_group_live/show.html.heex:32
#: lib/cannery_web/live/ammo_group_live/show.html.heex:39 #: lib/cannery_web/live/ammo_group_live/show.html.heex:39
#: lib/cannery_web/live/ammo_type_live/show.html.heex:98 #: lib/cannery_web/live/ammo_type_live/show.html.heex:98
@ -671,7 +654,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:93
#: lib/cannery_web/live/ammo_type_live/index.ex:60 #: lib/cannery_web/live/ammo_type_live/index.ex:61
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48 #: lib/cannery_web/live/ammo_type_live/show.html.heex:48
msgid "Powder grains per charge" msgid "Powder grains per charge"
msgstr "" msgstr ""
@ -685,7 +668,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:152
#: lib/cannery_web/live/ammo_type_live/index.ex:70 #: lib/cannery_web/live/ammo_type_live/index.ex:74
#: lib/cannery_web/live/ammo_type_live/show.html.heex:58 #: lib/cannery_web/live/ammo_type_live/show.html.heex:58
msgid "UPC" msgid "UPC"
msgstr "" msgstr ""
@ -707,18 +690,18 @@ msgid "New password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108 #: lib/cannery_web/live/ammo_group_live/index.ex:130
msgid "Stage" msgid "Stage"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108 #: lib/cannery_web/live/ammo_group_live/index.ex:130
msgid "Unstage" msgid "Unstage"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:125
#: lib/cannery_web/live/ammo_type_live/index.ex:64 #: lib/cannery_web/live/ammo_type_live/index.ex:68
#: lib/cannery_web/live/ammo_type_live/show.html.heex:52 #: lib/cannery_web/live/ammo_type_live/show.html.heex:52
msgid "Firing type" msgid "Firing type"
msgstr "" msgstr ""
@ -761,7 +744,7 @@ msgid "No cost information"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:62 #: lib/cannery_web/live/ammo_group_live/index.ex:83
msgid "% left" msgid "% left"
msgstr "" msgstr ""
@ -796,7 +779,7 @@ msgid "Current # of rounds:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.html.heex:32 #: lib/cannery_web/live/ammo_type_live/index.ex:86
msgid "Total # of rounds" msgid "Total # of rounds"
msgstr "" msgstr ""
@ -835,3 +818,13 @@ msgstr ""
#: lib/cannery_web/live/range_live/index.ex:28 #: lib/cannery_web/live/range_live/index.ex:28
msgid "Record Shots" msgid "Record Shots"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:58
msgid "Copies"
msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_type_live/index.ex:34
msgid "Ammo types"
msgstr ""

View File

@ -158,3 +158,13 @@ msgstr ""
#: lib/cannery_web/live/container_live/edit_tags_component.ex:52 #: lib/cannery_web/live/container_live/edit_tags_component.ex:52
msgid "Tag could not be removed" msgid "Tag could not be removed"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:113
msgid "Could not parse number of copies"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:98
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr ""

View File

@ -62,11 +62,6 @@ msgstr ""
msgid "A link to confirm your email change has been sent to the new address." msgid "A link to confirm your email change has been sent to the new address."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:90
msgid "Ammo group created successfully"
msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:56 #: lib/cannery_web/live/ammo_group_live/index.ex:56
#: lib/cannery_web/live/ammo_group_live/show.ex:52 #: lib/cannery_web/live/ammo_group_live/show.ex:52
@ -74,7 +69,7 @@ msgid "Ammo group deleted succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:72 #: lib/cannery_web/live/ammo_group_live/form_component.ex:75
msgid "Ammo group updated successfully" msgid "Ammo group updated successfully"
msgstr "" msgstr ""
@ -98,9 +93,9 @@ msgid "Are you sure you want to delete the invite for %{name}?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:146 #: lib/cannery_web/live/ammo_group_live/index.ex:165
#: lib/cannery_web/live/ammo_group_live/show.html.heex:66 #: lib/cannery_web/live/ammo_group_live/show.html.heex:66
#: lib/cannery_web/live/ammo_type_live/index.html.heex:75 #: lib/cannery_web/live/ammo_type_live/index.ex:130
msgid "Are you sure you want to delete this ammo?" msgid "Are you sure you want to delete this ammo?"
msgstr "" msgstr ""
@ -160,8 +155,8 @@ msgid "Register to setup %{name}"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/add_shot_group_component.html.heex:44 #: lib/cannery_web/components/add_shot_group_component.html.heex:48
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:55 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:74
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:157 #: lib/cannery_web/live/ammo_type_live/form_component.html.heex:157
#: lib/cannery_web/live/container_live/form_component.html.heex:52 #: lib/cannery_web/live/container_live/form_component.html.heex:52
#: lib/cannery_web/live/invite_live/form_component.html.heex:30 #: lib/cannery_web/live/invite_live/form_component.html.heex:30
@ -211,8 +206,8 @@ msgid "Ammo group unstaged succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:159 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.html.heex:108 #: lib/cannery_web/live/range_live/index.ex:130
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "" msgstr ""
@ -233,7 +228,7 @@ msgid "%{email} confirmed successfully."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.ex:47 #: lib/cannery_web/components/move_ammo_group_component.ex:53
msgid "Ammo moved to %{name} successfully" msgid "Ammo moved to %{name} successfully"
msgstr "" msgstr ""
@ -252,3 +247,15 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33 #: lib/cannery_web/live/ammo_group_live/index.html.heex:33
msgid "You'll need to" msgid "You'll need to"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:67
msgid "Creating..."
msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/ammo_group_live/form_component.ex:134
msgid "Ammo group created successfully"
msgid_plural "Ammo groups created successfully"
msgstr[0] ""
msgstr[1] ""

View File

@ -159,11 +159,11 @@ msgid "Tag could not be removed"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:113 #: lib/cannery_web/live/ammo_group_live/form_component.ex:126
msgid "Could not parse number of copies" msgid "Could not parse number of copies"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:98 #: lib/cannery_web/live/ammo_group_live/form_component.ex:111
msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}" msgid "Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}"
msgstr "" msgstr ""

View File

@ -68,7 +68,7 @@ msgid "Ammo group deleted succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:75 #: lib/cannery_web/live/ammo_group_live/form_component.ex:88
msgid "Ammo group updated successfully" msgid "Ammo group updated successfully"
msgstr "" msgstr ""
@ -92,9 +92,9 @@ msgid "Are you sure you want to delete the invite for %{name}?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.html.heex:146 #: lib/cannery_web/live/ammo_group_live/index.ex:165
#: lib/cannery_web/live/ammo_group_live/show.html.heex:66 #: lib/cannery_web/live/ammo_group_live/show.html.heex:66
#: lib/cannery_web/live/ammo_type_live/index.html.heex:75 #: lib/cannery_web/live/ammo_type_live/index.ex:130
msgid "Are you sure you want to delete this ammo?" msgid "Are you sure you want to delete this ammo?"
msgstr "" msgstr ""
@ -205,8 +205,8 @@ msgid "Ammo group unstaged succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:159 #: lib/cannery_web/live/ammo_group_live/show.ex:132
#: lib/cannery_web/live/range_live/index.html.heex:108 #: lib/cannery_web/live/range_live/index.ex:130
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "" msgstr ""
@ -227,7 +227,7 @@ msgid "%{email} confirmed successfully."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/move_ammo_group_component.ex:47 #: lib/cannery_web/components/move_ammo_group_component.ex:53
msgid "Ammo moved to %{name} successfully" msgid "Ammo moved to %{name} successfully"
msgstr "" msgstr ""
@ -253,7 +253,7 @@ msgid "Creating..."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/form_component.ex:134 #: lib/cannery_web/live/ammo_group_live/form_component.ex:147
msgid "Ammo group created successfully" msgid "Ammo group created successfully"
msgid_plural "Ammo groups created successfully" msgid_plural "Ammo groups created successfully"
msgstr[0] "" msgstr[0] ""