forked from shibao/cannery
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
e6a4fbcfb5 | |||
a6b2c6181e | |||
d79d0fa179 | |||
46387e8d7a | |||
dccea1b9de | |||
5ca21c64fd | |||
9773ccc6ff | |||
9cd2bc574b | |||
ee28de1178 | |||
91cf9d0eb5 | |||
3ce8eda712 | |||
1a78e88b34 | |||
968abd04ee | |||
dc209fa192 | |||
a80df49fdd | |||
92d1d21d00 | |||
917f627933 | |||
4946a6b119 | |||
9f784c3190 | |||
aa08e212ee | |||
80ad939aab | |||
08c9cddc78 | |||
e6285c282b | |||
61829fc042 | |||
e2f8fd3ee5 |
18
.drone.yml
18
.drone.yml
@ -27,19 +27,33 @@ steps:
|
||||
- npm install --prefix assets
|
||||
- mix test
|
||||
|
||||
- name: build and publish
|
||||
- name: build and publish stable
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: shibaobun/cannery
|
||||
tags: latest
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
tags: latest
|
||||
when:
|
||||
branch:
|
||||
- stable
|
||||
|
||||
- name: build and publish tagged version
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: shibaobun/cannery
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
tags:
|
||||
- ${DRONE_TAG}
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: rebuild-cache
|
||||
image: drillster/drone-volume-cache
|
||||
volumes:
|
||||
|
27
CHANGELOG.md
27
CHANGELOG.md
@ -1,7 +1,26 @@
|
||||
# 0.3.0
|
||||
-
|
||||
# v0.3.0
|
||||
- Fix ammo type counts not showing when count is 0
|
||||
- Add prompt to create first container before first ammo group
|
||||
- Edit and delete shot groups from ammo group show page
|
||||
- Use today's date when adding new shot groups
|
||||
- Create multiple ammo groups at one time
|
||||
|
||||
# 0.2.0
|
||||
# v0.2.3
|
||||
- Fix modals with overflowing forms
|
||||
- Fix grids having uneven margins in phone mode
|
||||
- Add page titles to registration and setting pages
|
||||
|
||||
# v0.2.2
|
||||
- Fix loading and reconnecting pages not being fixed
|
||||
- Fix closing modal in some cases not triggering a page reload
|
||||
- Fix error when display container and tag edit routes from a fresh reload
|
||||
|
||||
# v0.2.1
|
||||
- Fix checkbox spacing for mobile view
|
||||
- Fix spacing with form elements in mobile view
|
||||
- Fix user card spacing
|
||||
|
||||
# v0.2.0
|
||||
- Add or remove tags from containers list and details page
|
||||
- Show tags on containers
|
||||
- Add "Cannery" to page titles
|
||||
@ -11,5 +30,5 @@
|
||||
- Show shot history for an ammo group
|
||||
- Show ammo round totals and total shot for ammo types
|
||||
|
||||
# 0.1.0
|
||||
# v0.1.0
|
||||
- Initial release!
|
||||
|
@ -17,8 +17,7 @@
|
||||
-o-transform: scale(1.5);
|
||||
transform: scale(1.5);
|
||||
padding: 10px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin: 1em auto;
|
||||
}
|
||||
|
||||
.title {
|
||||
|
@ -6,7 +6,9 @@ defmodule Cannery.Ammo do
|
||||
import Ecto.Query, warn: false
|
||||
alias Cannery.{Accounts.User, Containers, Repo}
|
||||
alias Cannery.Ammo.{AmmoGroup, AmmoType}
|
||||
alias Ecto.Changeset
|
||||
alias Ecto.{Changeset, Multi}
|
||||
|
||||
@ammo_group_create_limit 10_000
|
||||
|
||||
@doc """
|
||||
Returns the list of ammo_types.
|
||||
@ -90,7 +92,7 @@ defmodule Cannery.Ammo do
|
||||
from ag in AmmoGroup,
|
||||
where: ag.ammo_type_id == ^ammo_type_id,
|
||||
select: sum(ag.count)
|
||||
)
|
||||
) || 0
|
||||
end
|
||||
|
||||
@doc """
|
||||
@ -117,7 +119,7 @@ defmodule Cannery.Ammo do
|
||||
left_join: sg in assoc(ag, :shot_groups),
|
||||
where: ag.ammo_type_id == ^ammo_type_id,
|
||||
select: sum(sg.count)
|
||||
)
|
||||
) || 0
|
||||
end
|
||||
|
||||
@doc """
|
||||
@ -327,36 +329,63 @@ defmodule Cannery.Ammo do
|
||||
end
|
||||
|
||||
@doc """
|
||||
Creates a ammo_group.
|
||||
Creates multiple ammo_groups at once.
|
||||
|
||||
## Examples
|
||||
|
||||
iex> create_ammo_group(%{field: value}, %User{id: 123})
|
||||
{:ok, %AmmoGroup{}}
|
||||
iex> create_ammo_groups(%{field: value}, 3, %User{id: 123})
|
||||
{:ok, {3, [%AmmoGroup{}]}}
|
||||
|
||||
iex> create_ammo_group(%{field: bad_value}, %User{id: 123})
|
||||
iex> create_ammo_groups(%{field: bad_value}, 3, %User{id: 123})
|
||||
{:error, %Changeset{}}
|
||||
|
||||
"""
|
||||
@spec create_ammo_group(attrs :: map(), User.t()) ::
|
||||
{:ok, AmmoGroup.t()} | {:error, Changeset.t(AmmoGroup.new_ammo_group())}
|
||||
def create_ammo_group(
|
||||
@spec create_ammo_groups(attrs :: map(), multiplier :: non_neg_integer(), User.t()) ::
|
||||
{:ok, {count :: non_neg_integer(), [AmmoGroup.t()] | nil}}
|
||||
| {:error, Changeset.t(AmmoGroup.new_ammo_group()) | nil}
|
||||
def create_ammo_groups(
|
||||
%{"ammo_type_id" => ammo_type_id, "container_id" => container_id} = attrs,
|
||||
multiplier,
|
||||
%User{id: user_id} = user
|
||||
) do
|
||||
)
|
||||
when multiplier >= 1 and multiplier <= @ammo_group_create_limit do
|
||||
# validate ammo type and container ids belong to user
|
||||
_valid_ammo_type = get_ammo_type!(ammo_type_id, user)
|
||||
_valid_container = Containers.get_container!(container_id, user)
|
||||
|
||||
%AmmoGroup{}
|
||||
|> AmmoGroup.create_changeset(attrs |> Map.put("user_id", user_id))
|
||||
|> Repo.insert()
|
||||
now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)
|
||||
|
||||
changesets =
|
||||
Enum.map(1..multiplier, fn _count ->
|
||||
%AmmoGroup{} |> AmmoGroup.create_changeset(attrs |> Map.put("user_id", user_id))
|
||||
end)
|
||||
|
||||
if changesets |> Enum.all?(fn %{valid?: valid} -> valid end) do
|
||||
Multi.new()
|
||||
|> Multi.insert_all(
|
||||
:create_ammo_groups,
|
||||
AmmoGroup,
|
||||
changesets
|
||||
|> Enum.map(fn changeset ->
|
||||
changeset
|
||||
|> Map.get(:changes)
|
||||
|> Map.merge(%{inserted_at: now, updated_at: now})
|
||||
end),
|
||||
returning: true
|
||||
)
|
||||
|> Repo.transaction()
|
||||
|> case do
|
||||
{: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
|
||||
{:error, changesets |> List.first()}
|
||||
end
|
||||
end
|
||||
|
||||
def create_ammo_group(invalid_attrs, _user) do
|
||||
%AmmoGroup{}
|
||||
|> AmmoGroup.create_changeset(invalid_attrs |> Map.put("user_id", "-1"))
|
||||
|> Repo.insert()
|
||||
def create_ammo_groups(invalid_attrs, _multiplier, _user) do
|
||||
{:error, %AmmoGroup{} |> AmmoGroup.create_changeset(invalid_attrs)}
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
@ -7,7 +7,7 @@
|
||||
let={f}
|
||||
for={@changeset}
|
||||
id="shot-group-form"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
phx-target={@myself}
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
@ -36,7 +36,11 @@
|
||||
<%= error_tag(f, :notes, "col-span-3") %>
|
||||
|
||||
<%= label(f, :date, gettext("Date (UTC)"), class: "title text-lg text-primary-600") %>
|
||||
<%= date_input(f, :date, class: "input input-primary col-span-2") %>
|
||||
<%= date_input(f, :date,
|
||||
class: "input input-primary col-span-2",
|
||||
phx_update: "ignore",
|
||||
value: Date.utc_today()
|
||||
) %>
|
||||
<%= error_tag(f, :notes, "col-span-3") %>
|
||||
|
||||
<%= submit(dgettext("actions", "Save"),
|
||||
|
@ -9,7 +9,7 @@ defmodule CanneryWeb.Components.UserCard do
|
||||
~H"""
|
||||
<div
|
||||
id={"user-#{@user.id}"}
|
||||
class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center
|
||||
class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center text-center
|
||||
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
|
||||
transition-all duration-300 ease-in-out"
|
||||
>
|
||||
@ -21,7 +21,8 @@ defmodule CanneryWeb.Components.UserCard do
|
||||
<%= if @user.confirmed_at |> is_nil() do %>
|
||||
Email unconfirmed
|
||||
<% else %>
|
||||
User was confirmed at<%= @user.confirmed_at |> display_datetime() %>
|
||||
<p>User was confirmed at</p>
|
||||
<%= @user.confirmed_at |> display_datetime() %>
|
||||
<% end %>
|
||||
</h3>
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
defmodule CanneryWeb.UserConfirmationController do
|
||||
use CanneryWeb, :controller
|
||||
|
||||
import CanneryWeb.Gettext
|
||||
alias Cannery.Accounts
|
||||
|
||||
def new(conn, _params) do
|
||||
render(conn, "new.html")
|
||||
render(conn, "new.html", page_title: gettext("Confirm your account"))
|
||||
end
|
||||
|
||||
def create(conn, %{"user" => %{"email" => email}}) do
|
||||
|
@ -29,8 +29,11 @@ defmodule CanneryWeb.UserRegistrationController do
|
||||
|
||||
# renders new user registration page
|
||||
defp render_new(conn, invite \\ nil) do
|
||||
changeset = Accounts.change_user_registration(%User{})
|
||||
conn |> render("new.html", changeset: changeset, invite: invite)
|
||||
render(conn, "new.html",
|
||||
changeset: Accounts.change_user_registration(%User{}),
|
||||
invite: invite,
|
||||
page_title: gettext("Register")
|
||||
)
|
||||
end
|
||||
|
||||
def create(conn, %{"user" => %{"invite_token" => invite_token}} = attrs) do
|
||||
|
@ -6,7 +6,7 @@ defmodule CanneryWeb.UserResetPasswordController do
|
||||
plug :get_user_by_reset_password_token when action in [:edit, :update]
|
||||
|
||||
def new(conn, _params) do
|
||||
render(conn, "new.html")
|
||||
render(conn, "new.html", page_title: gettext("Forgot your password?"))
|
||||
end
|
||||
|
||||
def create(conn, %{"user" => %{"email" => email}}) do
|
||||
@ -31,7 +31,10 @@ defmodule CanneryWeb.UserResetPasswordController do
|
||||
end
|
||||
|
||||
def edit(conn, _params) do
|
||||
render(conn, "edit.html", changeset: Accounts.change_user_password(conn.assigns.user))
|
||||
render(conn, "edit.html",
|
||||
changeset: Accounts.change_user_password(conn.assigns.user),
|
||||
page_title: gettext("Reset your password")
|
||||
)
|
||||
end
|
||||
|
||||
# Do not log in the user after reset password to avoid a
|
||||
|
@ -5,7 +5,7 @@ defmodule CanneryWeb.UserSessionController do
|
||||
alias CanneryWeb.UserAuth
|
||||
|
||||
def new(conn, _params) do
|
||||
render(conn, "new.html", error_message: nil)
|
||||
render(conn, "new.html", error_message: nil, page_title: gettext("Log in"))
|
||||
end
|
||||
|
||||
def create(conn, %{"user" => user_params}) do
|
||||
|
@ -1,13 +1,13 @@
|
||||
defmodule CanneryWeb.UserSettingsController do
|
||||
use CanneryWeb, :controller
|
||||
|
||||
import CanneryWeb.Gettext
|
||||
alias Cannery.Accounts
|
||||
alias CanneryWeb.{HomeLive, UserAuth}
|
||||
|
||||
plug :assign_email_and_password_changesets
|
||||
|
||||
def edit(conn, _params) do
|
||||
render(conn, "edit.html")
|
||||
render(conn, "edit.html", page_title: gettext("Settings"))
|
||||
end
|
||||
|
||||
def update(conn, %{"action" => "update_email"} = params) do
|
||||
|
@ -9,6 +9,8 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
|
||||
alias Ecto.Changeset
|
||||
alias Phoenix.LiveView.Socket
|
||||
|
||||
@ammo_group_create_limit 10_000
|
||||
|
||||
@impl true
|
||||
@spec update(
|
||||
%{:ammo_group => AmmoGroup.t(), :current_user => User.t(), optional(any) => any},
|
||||
@ -20,10 +22,14 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
|
||||
|
||||
@spec update(Socket.t()) :: {:ok, Socket.t()}
|
||||
def update(%{assigns: %{ammo_group: ammo_group, current_user: current_user}} = socket) do
|
||||
changeset = Ammo.change_ammo_group(ammo_group)
|
||||
containers = Containers.list_containers(current_user)
|
||||
ammo_types = Ammo.list_ammo_types(current_user)
|
||||
{:ok, socket |> assign(changeset: changeset, containers: containers, ammo_types: ammo_types)}
|
||||
socket =
|
||||
socket
|
||||
|> assign(:ammo_group_create_limit, @ammo_group_create_limit)
|
||||
|> assign(:changeset, Ammo.change_ammo_group(ammo_group))
|
||||
|> assign(:ammo_types, Ammo.list_ammo_types(current_user))
|
||||
|> assign_new(:containers, fn -> Containers.list_containers(current_user) end)
|
||||
|
||||
{:ok, socket}
|
||||
end
|
||||
|
||||
@impl true
|
||||
@ -77,20 +83,68 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
|
||||
end
|
||||
|
||||
defp save_ammo_group(
|
||||
%{assigns: %{current_user: current_user, return_to: return_to}} = socket,
|
||||
%{assigns: %{changeset: changeset}} = socket,
|
||||
:new,
|
||||
ammo_group_params
|
||||
%{"multiplier" => multiplier_str} = ammo_group_params
|
||||
) do
|
||||
socket =
|
||||
case Ammo.create_ammo_group(ammo_group_params, current_user) do
|
||||
{:ok, _ammo_group} ->
|
||||
prompt = dgettext("prompts", "Ammo group created successfully")
|
||||
socket |> put_flash(:info, prompt) |> push_redirect(to: return_to)
|
||||
case multiplier_str |> Integer.parse() do
|
||||
{multiplier, _remainder}
|
||||
when multiplier >= 1 and multiplier <= @ammo_group_create_limit ->
|
||||
socket |> create_multiple(ammo_group_params, multiplier)
|
||||
|
||||
{:error, %Changeset{} = changeset} ->
|
||||
socket |> assign(changeset: changeset)
|
||||
{multiplier, _remainder} ->
|
||||
error_msg =
|
||||
dgettext(
|
||||
"errors",
|
||||
"Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}",
|
||||
max: @ammo_group_create_limit,
|
||||
multiplier: multiplier
|
||||
)
|
||||
|
||||
{:error, changeset} =
|
||||
changeset
|
||||
|> Changeset.add_error(:multiplier, error_msg)
|
||||
|> Changeset.apply_action(:insert)
|
||||
|
||||
socket |> assign(:changeset, changeset)
|
||||
|
||||
:error ->
|
||||
error_msg = dgettext("errors", "Could not parse number of copies")
|
||||
|
||||
{:error, changeset} =
|
||||
changeset
|
||||
|> Changeset.add_error(:multiplier, error_msg)
|
||||
|> Changeset.apply_action(:insert)
|
||||
|
||||
socket |> assign(:changeset, changeset)
|
||||
end
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
||||
defp create_multiple(
|
||||
%{assigns: %{current_user: current_user, return_to: return_to}} = socket,
|
||||
ammo_group_params,
|
||||
multiplier
|
||||
) do
|
||||
case Ammo.create_ammo_groups(ammo_group_params, multiplier, current_user) do
|
||||
{:ok, {count, _ammo_groups}} ->
|
||||
prompt =
|
||||
dngettext(
|
||||
"prompts",
|
||||
"Ammo group created successfully",
|
||||
"Ammo groups created successfully",
|
||||
count
|
||||
)
|
||||
|
||||
socket |> put_flash(:info, prompt) |> push_redirect(to: return_to)
|
||||
|
||||
{:error, %Changeset{} = changeset} ->
|
||||
socket |> assign(changeset: changeset)
|
||||
|
||||
{:error, nil} ->
|
||||
socket
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -10,7 +10,7 @@
|
||||
phx-target={@myself}
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
>
|
||||
<%= if @changeset.action && not @changeset.valid? do %>
|
||||
<div class="invalid-feedback col-span-3 text-center">
|
||||
@ -18,42 +18,62 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label(f, :ammo_type_id, gettext("Ammo type"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :ammo_type_id, gettext("Ammo type"), class: "title text-lg text-primary-600") %>
|
||||
<%= select(f, :ammo_type_id, ammo_type_options(@ammo_types),
|
||||
class: "text-center col-span-2 input input-primary"
|
||||
) %>
|
||||
<%= error_tag(f, :ammo_type_id, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :count, gettext("Count"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :count, gettext("Count"), class: "title text-lg text-primary-600") %>
|
||||
<%= number_input(f, :count,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
min: 1
|
||||
) %>
|
||||
<%= error_tag(f, :count, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :price_paid, gettext("Price paid"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :price_paid, gettext("Price paid"), class: "title text-lg text-primary-600") %>
|
||||
<%= number_input(f, :price_paid,
|
||||
step: "0.01",
|
||||
step: 0.01,
|
||||
class: "text-center col-span-2 input input-primary"
|
||||
) %>
|
||||
<%= error_tag(f, :price_paid, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :notes, gettext("Notes"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :notes, gettext("Notes"), class: "title text-lg text-primary-600") %>
|
||||
<%= textarea(f, :notes,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
phx_hook: "MaintainAttrs"
|
||||
) %>
|
||||
<%= error_tag(f, :notes, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :container, gettext("Container"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :container, gettext("Container"), class: "title text-lg text-primary-600") %>
|
||||
<%= select(f, :container_id, container_options(@containers),
|
||||
class: "text-center col-span-2 input input-primary"
|
||||
) %>
|
||||
<%= error_tag(f, :container_id, "col-span-3 text-center") %>
|
||||
|
||||
<%= case @action do %>
|
||||
<% :new -> %>
|
||||
<hr class="hr col-span-3" />
|
||||
|
||||
<%= label(f, :multiplier, gettext("Copies"), class: "title text-lg text-primary-600") %>
|
||||
<%= number_input(f, :multiplier,
|
||||
max: @ammo_group_create_limit,
|
||||
class: "text-center input input-primary",
|
||||
value: 1,
|
||||
phx_update: "ignore"
|
||||
) %>
|
||||
|
||||
<%= submit(dgettext("actions", "Create"),
|
||||
phx_disable_with: dgettext("prompts", "Creating..."),
|
||||
class: "mx-auto btn btn-primary"
|
||||
) %>
|
||||
|
||||
<%= error_tag(f, :multiplier, "col-span-3 text-center") %>
|
||||
<% :edit -> %>
|
||||
<%= submit(dgettext("actions", "Save"),
|
||||
phx_disable_with: dgettext("prompts", "Saving..."),
|
||||
class: "mx-auto col-span-3 btn btn-primary"
|
||||
) %>
|
||||
<% end %>
|
||||
</.form>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
||||
"""
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
alias Cannery.{Ammo, Ammo.AmmoGroup, Repo}
|
||||
alias Cannery.{Ammo, Ammo.AmmoGroup, Containers, Repo}
|
||||
alias CanneryWeb.Endpoint
|
||||
|
||||
@impl true
|
||||
@ -17,9 +17,11 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
||||
{:noreply, apply_action(socket, live_action, params)}
|
||||
end
|
||||
|
||||
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :add_shot_group, %{
|
||||
"id" => id
|
||||
}) do
|
||||
defp apply_action(
|
||||
%{assigns: %{current_user: current_user}} = socket,
|
||||
:add_shot_group,
|
||||
%{"id" => id}
|
||||
) do
|
||||
socket
|
||||
|> assign(:page_title, gettext("Record shots"))
|
||||
|> assign(:ammo_group, Ammo.get_ammo_group!(id, current_user))
|
||||
@ -72,6 +74,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
||||
|
||||
defp display_ammo_groups(%{assigns: %{current_user: current_user}} = socket) do
|
||||
ammo_groups = Ammo.list_ammo_groups(current_user) |> Repo.preload([:ammo_type, :container])
|
||||
socket |> assign(:ammo_groups, ammo_groups)
|
||||
containers = Containers.list_containers(current_user)
|
||||
socket |> assign(ammo_groups: ammo_groups, containers: containers)
|
||||
end
|
||||
end
|
||||
|
@ -9,15 +9,41 @@
|
||||
<%= display_emoji("😔") %>
|
||||
</h2>
|
||||
|
||||
<%= if @containers |> Enum.empty?() do %>
|
||||
<div class="flex justify-center items-center">
|
||||
<h2 class="m-2 title text-md text-primary-600">
|
||||
<%= dgettext("prompts", "You'll need to") %>
|
||||
</h2>
|
||||
|
||||
<%= live_patch(dgettext("actions", "add a container first"),
|
||||
to: Routes.container_index_path(Endpoint, :new),
|
||||
class: "btn btn-primary"
|
||||
) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= live_patch(dgettext("actions", "Add your first box!"),
|
||||
to: Routes.ammo_group_index_path(Endpoint, :new),
|
||||
class: "btn btn-primary"
|
||||
) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= if @containers |> Enum.empty?() do %>
|
||||
<div class="flex justify-center items-center">
|
||||
<h2 class="m-2 title text-md text-primary-600">
|
||||
<%= dgettext("prompts", "You'll need to") %>
|
||||
</h2>
|
||||
|
||||
<%= live_patch(dgettext("actions", "add a container first"),
|
||||
to: Routes.container_index_path(Endpoint, :new),
|
||||
class: "btn btn-primary"
|
||||
) %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= live_patch(dgettext("actions", "New Ammo group"),
|
||||
to: Routes.ammo_group_index_path(Endpoint, :new),
|
||||
class: "btn btn-primary"
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
<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">
|
||||
@ -143,6 +169,7 @@
|
||||
ammo_group={@ammo_group}
|
||||
return_to={Routes.ammo_group_index_path(Endpoint, :index)}
|
||||
current_user={@current_user}
|
||||
containers={@containers}
|
||||
/>
|
||||
</.modal>
|
||||
<% @live_action == :add_shot_group -> %>
|
||||
|
@ -5,8 +5,9 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
|
||||
|
||||
use CanneryWeb, :live_view
|
||||
import CanneryWeb.Components.ContainerCard
|
||||
alias Cannery.{Ammo, Repo}
|
||||
alias Cannery.{ActivityLog, Ammo, Ammo.AmmoGroup, Repo}
|
||||
alias CanneryWeb.Endpoint
|
||||
alias Phoenix.LiveView.Socket
|
||||
|
||||
@impl true
|
||||
def mount(_params, session, socket) do
|
||||
@ -15,14 +16,31 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
|
||||
|
||||
@impl true
|
||||
def handle_params(
|
||||
%{"id" => id},
|
||||
%{"id" => id, "shot_group_id" => shot_group_id},
|
||||
_url,
|
||||
%{assigns: %{live_action: live_action, current_user: current_user}} = socket
|
||||
) do
|
||||
ammo_group = Ammo.get_ammo_group!(id, current_user) |> Repo.preload([:container, :ammo_type])
|
||||
{:noreply, socket |> assign(page_title: page_title(live_action), ammo_group: ammo_group)}
|
||||
shot_group = ActivityLog.get_shot_group!(shot_group_id, current_user)
|
||||
|
||||
socket =
|
||||
socket
|
||||
|> assign(page_title: page_title(live_action), shot_group: shot_group)
|
||||
|> display_ammo_group(id)
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_params(%{"id" => id}, _url, %{assigns: %{live_action: live_action}} = socket) do
|
||||
{:noreply, socket |> assign(page_title: page_title(live_action)) |> display_ammo_group(id)}
|
||||
end
|
||||
|
||||
defp page_title(:add_shot_group), do: gettext("Record Shots")
|
||||
defp page_title(:edit_shot_group), do: gettext("Edit Shot Records")
|
||||
defp page_title(:move), do: gettext("Move Ammo group")
|
||||
defp page_title(:show), do: gettext("Show Ammo group")
|
||||
defp page_title(:edit), do: gettext("Edit Ammo group")
|
||||
|
||||
@impl true
|
||||
def handle_event(
|
||||
"delete",
|
||||
@ -46,11 +64,29 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
|
||||
{:ok, ammo_group} =
|
||||
ammo_group |> Ammo.update_ammo_group(%{"staged" => !ammo_group.staged}, current_user)
|
||||
|
||||
{:noreply, socket |> assign(ammo_group: ammo_group)}
|
||||
{:noreply, socket |> display_ammo_group(ammo_group)}
|
||||
end
|
||||
|
||||
defp page_title(:add_shot_group), do: gettext("Add Shot group")
|
||||
defp page_title(:move), do: gettext("Move Ammo group")
|
||||
defp page_title(:show), do: gettext("Show Ammo group")
|
||||
defp page_title(:edit), do: gettext("Edit Ammo group")
|
||||
@impl true
|
||||
def handle_event(
|
||||
"delete_shot_group",
|
||||
%{"id" => id},
|
||||
%{assigns: %{ammo_group: ammo_group, current_user: current_user}} = socket
|
||||
) do
|
||||
{:ok, _} =
|
||||
ActivityLog.get_shot_group!(id, current_user)
|
||||
|> ActivityLog.delete_shot_group(current_user)
|
||||
|
||||
prompt = dgettext("prompts", "Shot records deleted succesfully")
|
||||
{:noreply, socket |> put_flash(:info, prompt) |> display_ammo_group(ammo_group)}
|
||||
end
|
||||
|
||||
@spec display_ammo_group(Socket.t(), AmmoGroup.t() | AmmoGroup.id()) :: Socket.t()
|
||||
defp display_ammo_group(socket, %AmmoGroup{} = ammo_group) do
|
||||
ammo_group = ammo_group |> Repo.preload([:container, :ammo_type, :shot_groups], force: true)
|
||||
socket |> assign(:ammo_group, ammo_group)
|
||||
end
|
||||
|
||||
defp display_ammo_group(%{assigns: %{current_user: current_user}} = socket, id),
|
||||
do: display_ammo_group(socket, Ammo.get_ammo_group!(id, current_user))
|
||||
end
|
||||
|
@ -124,6 +124,8 @@
|
||||
<th class="p-2">
|
||||
<%= gettext("Date") %>
|
||||
</th>
|
||||
|
||||
<th class="p-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="shot_groups">
|
||||
@ -132,12 +134,35 @@
|
||||
<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>
|
||||
@ -159,6 +184,18 @@
|
||||
current_user={@current_user}
|
||||
/>
|
||||
</.modal>
|
||||
<% :edit_shot_group -> %>
|
||||
<.modal return_to={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)}>
|
||||
<.live_component
|
||||
module={CanneryWeb.RangeLive.FormComponent}
|
||||
id={@shot_group.id}
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
shot_group={@shot_group}
|
||||
return_to={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)}
|
||||
current_user={@current_user}
|
||||
/>
|
||||
</.modal>
|
||||
<% :add_shot_group -> %>
|
||||
<.modal return_to={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)}>
|
||||
<.live_component
|
||||
|
@ -9,7 +9,7 @@
|
||||
phx-target={@myself}
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
>
|
||||
<%= if @changeset.action && not @changeset.valid? do %>
|
||||
<div class="invalid-feedback col-span-3 text-center">
|
||||
@ -17,11 +17,11 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label(f, :name, gettext("Name"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :name, gettext("Name"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :name, class: "text-center col-span-2 input input-primary") %>
|
||||
<%= error_tag(f, :name, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :desc, gettext("Description"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :desc, gettext("Description"), class: "title text-lg text-primary-600") %>
|
||||
<%= textarea(f, :desc,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
phx_hook: "MaintainAttrs"
|
||||
@ -34,50 +34,42 @@
|
||||
>
|
||||
<%= gettext("Example bullet type abbreviations") %>
|
||||
</a>
|
||||
<%= label(f, :bullet_type, gettext("Bullet type"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :bullet_type, gettext("Bullet type"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :bullet_type,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: gettext("FMJ")
|
||||
) %>
|
||||
<%= error_tag(f, :bullet_type, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :bullet_core, gettext("Bullet core"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :bullet_core, gettext("Bullet core"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :bullet_core,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: gettext("Steel")
|
||||
) %>
|
||||
<%= error_tag(f, :bullet_core, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :cartridge, gettext("Cartridge"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :cartridge, gettext("Cartridge"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :cartridge,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: "5.56x46mm NATO"
|
||||
) %>
|
||||
<%= error_tag(f, :cartridge, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :caliber, gettext("Caliber"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :caliber, gettext("Caliber"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :caliber,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: ".223"
|
||||
) %>
|
||||
<%= error_tag(f, :caliber, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :case_material, gettext("Case material"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :case_material, gettext("Case material"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :case_material,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: gettext("Brass")
|
||||
) %>
|
||||
<%= error_tag(f, :case_material, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :jacket_type, gettext("Jacket type"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :jacket_type, gettext("Jacket type"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :jacket_type,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: gettext("Bimetal")
|
||||
@ -85,7 +77,7 @@
|
||||
<%= error_tag(f, :case_material, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :muzzle_velocity, gettext("Muzzle velocity"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
class: "title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= number_input(f, :muzzle_velocity,
|
||||
step: "1",
|
||||
@ -94,14 +86,12 @@
|
||||
) %>
|
||||
<%= error_tag(f, :muzzle_velocity, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :powder_type, gettext("Powder type"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :powder_type, gettext("Powder type"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :powder_type, class: "text-center col-span-2 input input-primary") %>
|
||||
<%= error_tag(f, :powder_type, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :powder_grains_per_charge, gettext("Powder grains per charge"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
class: "title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= number_input(f, :powder_grains_per_charge,
|
||||
step: "1",
|
||||
@ -110,7 +100,7 @@
|
||||
) %>
|
||||
<%= error_tag(f, :powder_grains_per_charge, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :grains, gettext("Grains"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :grains, gettext("Grains"), class: "title text-lg text-primary-600") %>
|
||||
<%= number_input(f, :grains,
|
||||
step: "1",
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
@ -118,54 +108,48 @@
|
||||
) %>
|
||||
<%= error_tag(f, :grains, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :pressure, gettext("Pressure"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :pressure, gettext("Pressure"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :pressure,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: "+P"
|
||||
) %>
|
||||
<%= error_tag(f, :pressure, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :primer_type, gettext("Primer type"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :primer_type, gettext("Primer type"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :primer_type,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: "Boxer"
|
||||
) %>
|
||||
<%= error_tag(f, :primer_type, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :firing_type, gettext("Firing type"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :firing_type, gettext("Firing type"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :firing_type,
|
||||
class: "text-center col-span-2 input input-primary",
|
||||
placeholder: "Centerfire"
|
||||
) %>
|
||||
<%= error_tag(f, :firing_type, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :tracer, gettext("Tracer"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :tracer, gettext("Tracer"), class: "title text-lg text-primary-600") %>
|
||||
<%= checkbox(f, :tracer, class: "text-center col-span-2 checkbox") %>
|
||||
<%= error_tag(f, :tracer, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :incendiary, gettext("Incendiary"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :incendiary, gettext("Incendiary"), class: "title text-lg text-primary-600") %>
|
||||
<%= checkbox(f, :incendiary, class: "text-center col-span-2 checkbox") %>
|
||||
<%= error_tag(f, :incendiary, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :blank, gettext("Blank"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :blank, gettext("Blank"), class: "title text-lg text-primary-600") %>
|
||||
<%= checkbox(f, :blank, class: "text-center col-span-2 checkbox") %>
|
||||
<%= error_tag(f, :blank, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :corrosive, gettext("Corrosive"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :corrosive, gettext("Corrosive"), class: "title text-lg text-primary-600") %>
|
||||
<%= checkbox(f, :corrosive, class: "text-center col-span-2 checkbox") %>
|
||||
<%= error_tag(f, :corrosive, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :manufacturer, gettext("Manufacturer"),
|
||||
class: "mr-4 title text-lg text-primary-600"
|
||||
) %>
|
||||
<%= label(f, :manufacturer, gettext("Manufacturer"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :manufacturer, class: "text-center col-span-2 input input-primary") %>
|
||||
<%= error_tag(f, :manufacturer, "col-span-3 text-center") %>
|
||||
|
||||
<%= label(f, :upc, gettext("UPC"), class: "mr-4 title text-lg text-primary-600") %>
|
||||
<%= label(f, :upc, gettext("UPC"), class: "title text-lg text-primary-600") %>
|
||||
<%= text_input(f, :upc, class: "text-center col-span-2 input input-primary") %>
|
||||
<%= error_tag(f, :upc, "col-span-3 text-center") %>
|
||||
|
||||
|
@ -100,9 +100,8 @@
|
||||
) %>
|
||||
</span>
|
||||
<% else %>
|
||||
<h3 class="title text-lg col-span-2">
|
||||
<h3 class="mx-8 my-4 title text-lg text-primary-600 col-span-2">
|
||||
<%= gettext("No cost information") %>
|
||||
<%= display_emoji("😔") %>
|
||||
</h3>
|
||||
<% end %>
|
||||
</div>
|
||||
@ -111,8 +110,10 @@
|
||||
|
||||
<div>
|
||||
<%= if @ammo_groups |> Enum.empty?() do %>
|
||||
<h2 class="mx-8 my-4 title text-lg text-primary-600">
|
||||
<%= gettext("No ammo for this type") %>
|
||||
<%= display_emoji("😔") %>
|
||||
</h2>
|
||||
<% else %>
|
||||
<div class="flex flex-wrap justify-center items-center">
|
||||
<%= for ammo_group <- @ammo_groups do %>
|
||||
|
@ -40,7 +40,7 @@
|
||||
let={f}
|
||||
for={:tag}
|
||||
id="add-tag-to-container-form"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
phx-target={@myself}
|
||||
phx-submit="save"
|
||||
>
|
||||
|
@ -6,7 +6,7 @@
|
||||
let={f}
|
||||
for={@changeset}
|
||||
id="container-form"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
phx-target={@myself}
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
|
@ -16,7 +16,7 @@ defmodule CanneryWeb.ContainerLive.Index do
|
||||
|
||||
@impl true
|
||||
def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do
|
||||
{:noreply, apply_action(socket, live_action, params)}
|
||||
{:noreply, apply_action(socket, live_action, params) |> display_containers()}
|
||||
end
|
||||
|
||||
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
|
||||
|
@ -72,9 +72,11 @@
|
||||
|
||||
<hr class="mb-4 hr" />
|
||||
|
||||
<p>
|
||||
<div>
|
||||
<%= if @container.ammo_groups |> Enum.empty?() do %>
|
||||
<h2 class="mx-8 my-4 title text-lg text-primary-600">
|
||||
<%= gettext("No ammo groups in this container") %>
|
||||
</h2>
|
||||
<% else %>
|
||||
<div class="flex flex-wrap justify-center items-center">
|
||||
<%= for ammo_group <- @container.ammo_groups do %>
|
||||
@ -82,7 +84,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= if @live_action in [:edit] do %>
|
||||
|
@ -130,7 +130,7 @@ defmodule CanneryWeb.HomeLive do
|
||||
<li class="flex flex-row justify-center space-x-2">
|
||||
<b>Version:</b>
|
||||
<p>
|
||||
0.2.0
|
||||
0.3.0
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -6,7 +6,7 @@
|
||||
let={f}
|
||||
for={@changeset}
|
||||
id="invite-form"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
phx-target={@myself}
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
|
@ -38,32 +38,45 @@ defmodule CanneryWeb.LiveHelpers do
|
||||
"""
|
||||
def modal(assigns) do
|
||||
~H"""
|
||||
<%= live_patch to: @return_to,
|
||||
id: "modal-bg",
|
||||
class:
|
||||
"fade-in fixed z-10 left-0 top-0
|
||||
w-full h-full overflow-hidden
|
||||
p-8 flex flex-col justify-center items-center cursor-auto",
|
||||
style: "background-color: rgba(0,0,0,0.4);",
|
||||
phx_remove: hide_modal()
|
||||
do %>
|
||||
<span class="hidden"></span>
|
||||
<% end %>
|
||||
|
||||
<div
|
||||
id="modal"
|
||||
class="fade-in fixed z-10 left-0 top-0
|
||||
class="fixed z-10 left-0 top-0 pointer-events-none
|
||||
w-full h-full overflow-hidden
|
||||
p-8 flex flex-col justify-center items-center"
|
||||
style="opacity: 1 !important; background-color: rgba(0,0,0,0.4);"
|
||||
phx-remove={hide_modal()}
|
||||
p-4 sm:p-8 flex flex-col justify-center items-center"
|
||||
>
|
||||
<div
|
||||
id="modal-content"
|
||||
class="fade-in-scale w-full max-w-3xl max-h-128 relative overflow-y-auto
|
||||
class="fade-in-scale w-full max-w-3xl relative
|
||||
pointer-events-auto overflow-hidden
|
||||
px-8 py-4 sm:py-8 flex flex-col justify-center items-center
|
||||
flex flex-col justify-start items-center
|
||||
bg-white border-2 rounded-lg"
|
||||
phx-click-away={hide_modal()}
|
||||
phx-window-keydown={hide_modal()}
|
||||
phx-key="escape"
|
||||
>
|
||||
<%= live_patch to: @return_to,
|
||||
id: "close",
|
||||
class:
|
||||
"absolute top-8 right-10 text-gray-500 hover:text-gray-800 transition-all duration-500 ease-in-out",
|
||||
phx_click: hide_modal() do %>
|
||||
"absolute top-8 right-10
|
||||
text-gray-500 hover:text-gray-800
|
||||
transition-all duration-500 ease-in-out",
|
||||
phx_remove: hide_modal() do %>
|
||||
<i class="fa-fw fa-lg fas fa-times"></i>
|
||||
<% end %>
|
||||
|
||||
<div class="w-full p-8 flex flex-col space-y-4 justify-start items-center">
|
||||
<div
|
||||
class="overflow-x-hidden overflow-y-auto w-full p-8 flex flex-col space-y-4 justify-start items-center"
|
||||
>
|
||||
<%= render_slot(@inner_block) %>
|
||||
</div>
|
||||
</div>
|
||||
@ -74,6 +87,7 @@ defmodule CanneryWeb.LiveHelpers do
|
||||
def hide_modal(js \\ %JS{}) do
|
||||
js
|
||||
|> JS.hide(to: "#modal", transition: "fade-out")
|
||||
|> JS.hide(to: "#modal-bg", transition: "fade-out")
|
||||
|> JS.hide(to: "#modal-content", transition: "fade-out-scale")
|
||||
end
|
||||
end
|
||||
|
@ -7,7 +7,7 @@
|
||||
let={f}
|
||||
for={@changeset}
|
||||
id="shot-group-form"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
phx-target={@myself}
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
|
@ -25,7 +25,7 @@ defmodule CanneryWeb.RangeLive.Index do
|
||||
%{"id" => id}
|
||||
) do
|
||||
socket
|
||||
|> assign(:page_title, gettext("Record shots"))
|
||||
|> assign(:page_title, gettext("Record Shots"))
|
||||
|> assign(:ammo_group, Ammo.get_ammo_group!(id, current_user))
|
||||
end
|
||||
|
||||
|
@ -36,7 +36,7 @@ defmodule CanneryWeb.TagLive.FormComponent do
|
||||
let={f}
|
||||
for={@changeset}
|
||||
id="tag-form"
|
||||
class="flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
phx-target={@myself}
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
|
@ -15,7 +15,7 @@ defmodule CanneryWeb.TagLive.Index do
|
||||
|
||||
@impl true
|
||||
def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do
|
||||
{:noreply, apply_action(socket, live_action, params)}
|
||||
{:noreply, apply_action(socket, live_action, params) |> display_tags}
|
||||
end
|
||||
|
||||
defp apply_action(%{assigns: %{current_user: current_user}} = socket, :edit, %{"id" => id}) do
|
||||
|
@ -80,6 +80,7 @@ defmodule CanneryWeb.Router do
|
||||
live "/ammo_groups/:id/show/edit", AmmoGroupLive.Show, :edit
|
||||
live "/ammo_groups/:id/show/add_shot_group", AmmoGroupLive.Show, :add_shot_group
|
||||
live "/ammo_groups/:id/show/move", AmmoGroupLive.Show, :move
|
||||
live "/ammo_groups/:id/show/:shot_group_id/edit", AmmoGroupLive.Show, :edit_shot_group
|
||||
|
||||
live "/range", RangeLive.Index, :index
|
||||
live "/range/:id/edit", RangeLive.Index, :edit
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
<div
|
||||
id="loading"
|
||||
class="absolute opacity-0 top-0 left-0 w-screen h-screen bg-white z-50
|
||||
class="fixed opacity-0 top-0 left-0 w-screen h-screen bg-white z-50
|
||||
flex flex-col justify-center items-center space-y-4
|
||||
transition-opacity ease-in-out duration-500"
|
||||
>
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
<div
|
||||
id="disconnect"
|
||||
class="absolute opacity-0 top-0 left-0 w-screen h-screen bg-white z-50
|
||||
class="fixed opacity-0 top-0 left-0 w-screen h-screen bg-white z-50
|
||||
flex flex-col justify-center items-center space-y-4
|
||||
transition-opacity ease-in-out duration-500"
|
||||
>
|
||||
|
@ -5,11 +5,8 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<%= csrf_meta_tag() %>
|
||||
<%= if(assigns |> Map.has_key?(:page_title),
|
||||
do: "#{assigns.page_title} | Cannery",
|
||||
else: "Cannery"
|
||||
)
|
||||
|> live_title_tag(suffix: "") %>
|
||||
<%= if(assigns |> Map.has_key?(:page_title), do: @page_title, else: "Cannery")
|
||||
|> live_title_tag(suffix: " | Cannery") %>
|
||||
<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/css/app.css")} />
|
||||
<script
|
||||
defer
|
||||
|
@ -7,7 +7,7 @@
|
||||
Routes.user_confirmation_path(@conn, :create),
|
||||
[
|
||||
class:
|
||||
"flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
"flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
],
|
||||
fn f -> %>
|
||||
<%= label(f, :email, class: "title text-lg text-primary-600") %>
|
||||
|
@ -7,7 +7,7 @@
|
||||
Routes.user_registration_path(@conn, :create),
|
||||
[
|
||||
class:
|
||||
"flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
"flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
],
|
||||
fn f -> %>
|
||||
<%= if @changeset.action && not @changeset.valid? do %>
|
||||
|
@ -7,7 +7,7 @@
|
||||
Routes.user_reset_password_path(@conn, :update, @token),
|
||||
[
|
||||
class:
|
||||
"flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
"flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
],
|
||||
fn f -> %>
|
||||
<%= if @changeset.action && not @changeset.valid? do %>
|
||||
|
@ -7,7 +7,7 @@
|
||||
Routes.user_reset_password_path(@conn, :create),
|
||||
[
|
||||
class:
|
||||
"flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
"flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
],
|
||||
fn f -> %>
|
||||
<%= label(f, :email, class: "title text-lg text-primary-600") %>
|
||||
|
@ -8,7 +8,7 @@
|
||||
[
|
||||
as: :user,
|
||||
class:
|
||||
"flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
"flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
],
|
||||
fn f -> %>
|
||||
<%= if @error_message do %>
|
||||
|
@ -9,7 +9,7 @@
|
||||
Routes.user_settings_path(@conn, :update),
|
||||
[
|
||||
class:
|
||||
"pb-4 text-center flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
"flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
],
|
||||
fn f -> %>
|
||||
<h3 class="title text-primary-600 text-lg col-span-3">
|
||||
@ -53,7 +53,7 @@
|
||||
Routes.user_settings_path(@conn, :update),
|
||||
[
|
||||
class:
|
||||
"pb-4 text-center flex flex-col sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
"flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
],
|
||||
fn f -> %>
|
||||
<h3 class="title text-primary-600 text-lg col-span-3">
|
||||
|
2
mix.exs
2
mix.exs
@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
|
||||
def project do
|
||||
[
|
||||
app: :cannery,
|
||||
version: "0.2.0",
|
||||
version: "0.3.0",
|
||||
elixir: "~> 1.12",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
compilers: [:gettext] ++ Mix.compilers(),
|
||||
|
@ -11,12 +11,12 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:42
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:44
|
||||
msgid "Add Ammo"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:12
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:24
|
||||
msgid "Add your first box!"
|
||||
msgstr ""
|
||||
|
||||
@ -81,7 +81,7 @@ msgid "Make your first tag!"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:17
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:42
|
||||
msgid "New Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -124,9 +124,9 @@ msgid "Reset password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:42
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:54
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:172
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:46
|
||||
#: 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/container_live/form_component.html.heex:50
|
||||
#: lib/cannery_web/live/invite_live/form_component.html.heex:28
|
||||
#: lib/cannery_web/live/range_live/form_component.html.heex:40
|
||||
@ -160,7 +160,7 @@ msgid "Why not get some ready to shoot?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:111
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
|
||||
#: lib/cannery_web/live/range_live/index.html.heex:36
|
||||
msgid "Record shots"
|
||||
@ -190,3 +190,14 @@ msgstr ""
|
||||
#: lib/cannery_web/live/invite_live/index.html.heex:33
|
||||
msgid "Copy to clipboard"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:18
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
|
||||
msgid "add a container first"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:66
|
||||
msgid "Create"
|
||||
msgstr ""
|
||||
|
@ -39,7 +39,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:27
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:53
|
||||
msgid "Ammo type"
|
||||
msgstr ""
|
||||
|
||||
@ -54,19 +54,19 @@ msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:154
|
||||
#: 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/show.html.heex:55
|
||||
msgid "Blank"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:74
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:68
|
||||
msgid "Brass"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:46
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:53
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:41
|
||||
msgid "Bullet core"
|
||||
@ -80,21 +80,21 @@ msgid "Bullet type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:62
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:55
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:43
|
||||
msgid "Caliber"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:55
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:54
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:42
|
||||
msgid "Cartridge"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:69
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:56
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:44
|
||||
msgid "Case material"
|
||||
@ -103,7 +103,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/move_ammo_group_component.html.heex:22
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:42
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:68
|
||||
msgid "Container"
|
||||
msgstr ""
|
||||
|
||||
@ -114,7 +114,7 @@ msgid "Containers"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:158
|
||||
#: 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/show.html.heex:56
|
||||
msgid "Corrosive"
|
||||
@ -122,7 +122,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:30
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
|
||||
msgid "Count"
|
||||
msgstr ""
|
||||
|
||||
@ -155,8 +155,8 @@ msgid "Easy to Use:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:36
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:55
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:38
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:42
|
||||
msgid "Edit Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -187,19 +187,19 @@ msgid "Example bullet type abbreviations"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:42
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:40
|
||||
msgid "FMJ"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:113
|
||||
#: 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/show.html.heex:49
|
||||
msgid "Grains"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:150
|
||||
#: 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/show.html.heex:54
|
||||
msgid "Incendiary"
|
||||
@ -274,7 +274,7 @@ msgid "Manage"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:162
|
||||
#: 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/show.html.heex:57
|
||||
msgid "Manufacturer"
|
||||
@ -335,7 +335,7 @@ msgid "No ammo for this type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:77
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:78
|
||||
msgid "No ammo groups in this container"
|
||||
msgstr ""
|
||||
|
||||
@ -376,7 +376,7 @@ msgid "On the bookshelf"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:121
|
||||
#: 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/show.html.heex:50
|
||||
msgid "Pressure"
|
||||
@ -384,7 +384,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
|
||||
msgid "Price paid"
|
||||
msgstr ""
|
||||
|
||||
@ -394,7 +394,7 @@ msgid "Price paid:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:128
|
||||
#: 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/show.html.heex:51
|
||||
msgid "Primer type"
|
||||
@ -421,12 +421,13 @@ msgid "Set Unlimited"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_settings_controller.ex:10
|
||||
#: lib/cannery_web/templates/user_settings/edit.html.heex:3
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:54
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:41
|
||||
msgid "Show Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -441,7 +442,7 @@ msgid "Simple:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:47
|
||||
msgid "Steel"
|
||||
msgstr ""
|
||||
|
||||
@ -477,7 +478,7 @@ msgid "This ammo group is not in a container"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:146
|
||||
#: 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/show.html.heex:53
|
||||
msgid "Tracer"
|
||||
@ -527,7 +528,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/topbar.ex:64
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:39
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:65
|
||||
msgid "Range"
|
||||
msgstr ""
|
||||
|
||||
@ -564,15 +565,9 @@ msgstr ""
|
||||
msgid "Unstage from range"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:52
|
||||
msgid "Add Shot group"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:24
|
||||
#: lib/cannery_web/live/range_live/index.ex:28
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:26
|
||||
msgid "Record shots"
|
||||
msgstr ""
|
||||
|
||||
@ -582,7 +577,7 @@ msgid "Ammo Types"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:47
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:49
|
||||
msgid "Ammo groups"
|
||||
msgstr ""
|
||||
|
||||
@ -593,6 +588,7 @@ msgid "Date (UTC)"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:39
|
||||
#: lib/cannery_web/live/range_live/index.ex:34
|
||||
msgid "Edit Shot Records"
|
||||
msgstr ""
|
||||
@ -624,8 +620,8 @@ msgid "Shot Records"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:30
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:53
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:32
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:40
|
||||
msgid "Move Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -646,7 +642,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/ammo_group_card.ex:43
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:64
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:90
|
||||
#: 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_type_live/show.html.heex:98
|
||||
@ -654,40 +650,40 @@ msgid "$%{amount}"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:83
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:75
|
||||
msgid "Bimetal"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:78
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:57
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:45
|
||||
msgid "Jacket type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:87
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:58
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
|
||||
msgid "Muzzle velocity"
|
||||
msgstr ""
|
||||
|
||||
#, 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:93
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:60
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
|
||||
msgid "Powder grains per charge"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:97
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:59
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:47
|
||||
msgid "Powder type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:168
|
||||
#: 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/show.html.heex:58
|
||||
msgid "UPC"
|
||||
@ -710,17 +706,17 @@ msgid "New password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:82
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108
|
||||
msgid "Stage"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:82
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108
|
||||
msgid "Unstage"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:137
|
||||
#: 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/show.html.heex:52
|
||||
msgid "Firing type"
|
||||
@ -764,7 +760,7 @@ msgid "No cost information"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:62
|
||||
msgid "% left"
|
||||
msgstr ""
|
||||
|
||||
@ -807,3 +803,39 @@ msgstr ""
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
|
||||
msgid "Total rounds shot:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:8
|
||||
msgid "Confirm your account"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:9
|
||||
msgid "Forgot your password?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_session_controller.ex:8
|
||||
msgid "Log in"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:35
|
||||
msgid "Register"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:36
|
||||
msgid "Reset your password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:38
|
||||
#: lib/cannery_web/live/range_live/index.ex:28
|
||||
msgid "Record Shots"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:58
|
||||
msgid "Copies"
|
||||
msgstr ""
|
||||
|
@ -12,12 +12,12 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2\n"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:42
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:44
|
||||
msgid "Add Ammo"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:12
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:24
|
||||
msgid "Add your first box!"
|
||||
msgstr ""
|
||||
|
||||
@ -82,7 +82,7 @@ msgid "Make your first tag!"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:17
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:42
|
||||
msgid "New Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -127,7 +127,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:42
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:54
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:172
|
||||
#: 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/invite_live/form_component.html.heex:28
|
||||
#: lib/cannery_web/live/range_live/form_component.html.heex:40
|
||||
@ -161,7 +161,7 @@ msgid "Why not get some ready to shoot?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:85
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:111
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:86
|
||||
#: lib/cannery_web/live/range_live/index.html.heex:36
|
||||
msgid "Record shots"
|
||||
@ -191,3 +191,9 @@ msgstr ""
|
||||
#: lib/cannery_web/live/invite_live/index.html.heex:33
|
||||
msgid "Copy to clipboard"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:18
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
|
||||
msgid "add a container first"
|
||||
msgstr ""
|
||||
|
@ -40,7 +40,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:21
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:27
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:53
|
||||
msgid "Ammo type"
|
||||
msgstr ""
|
||||
|
||||
@ -55,19 +55,19 @@ msgid "Background color"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:154
|
||||
#: 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/show.html.heex:55
|
||||
msgid "Blank"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:74
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:68
|
||||
msgid "Brass"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:46
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:44
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:53
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:41
|
||||
msgid "Bullet core"
|
||||
@ -81,21 +81,21 @@ msgid "Bullet type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:62
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:58
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:55
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:43
|
||||
msgid "Caliber"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:55
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:54
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:42
|
||||
msgid "Cartridge"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:69
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:65
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:56
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:44
|
||||
msgid "Case material"
|
||||
@ -104,7 +104,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/move_ammo_group_component.html.heex:22
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:48
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:42
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:68
|
||||
msgid "Container"
|
||||
msgstr ""
|
||||
|
||||
@ -115,7 +115,7 @@ msgid "Containers"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:158
|
||||
#: 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/show.html.heex:56
|
||||
msgid "Corrosive"
|
||||
@ -123,7 +123,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:27
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:30
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
|
||||
msgid "Count"
|
||||
msgstr ""
|
||||
|
||||
@ -156,8 +156,8 @@ msgid "Easy to Use:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:36
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:55
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:38
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:42
|
||||
msgid "Edit Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -188,19 +188,19 @@ msgid "Example bullet type abbreviations"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:42
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:40
|
||||
msgid "FMJ"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:113
|
||||
#: 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/show.html.heex:49
|
||||
msgid "Grains"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:150
|
||||
#: 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/show.html.heex:54
|
||||
msgid "Incendiary"
|
||||
@ -275,7 +275,7 @@ msgid "Manage"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:162
|
||||
#: 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/show.html.heex:57
|
||||
msgid "Manufacturer"
|
||||
@ -336,7 +336,7 @@ msgid "No ammo for this type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:77
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:78
|
||||
msgid "No ammo groups in this container"
|
||||
msgstr ""
|
||||
|
||||
@ -377,7 +377,7 @@ msgid "On the bookshelf"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:121
|
||||
#: 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/show.html.heex:50
|
||||
msgid "Pressure"
|
||||
@ -385,7 +385,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:34
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:59
|
||||
msgid "Price paid"
|
||||
msgstr ""
|
||||
|
||||
@ -395,7 +395,7 @@ msgid "Price paid:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:128
|
||||
#: 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/show.html.heex:51
|
||||
msgid "Primer type"
|
||||
@ -422,12 +422,13 @@ msgid "Set Unlimited"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_settings_controller.ex:10
|
||||
#: lib/cannery_web/templates/user_settings/edit.html.heex:3
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:54
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:41
|
||||
msgid "Show Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -442,7 +443,7 @@ msgid "Simple:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:51
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:47
|
||||
msgid "Steel"
|
||||
msgstr ""
|
||||
|
||||
@ -478,7 +479,7 @@ msgid "This ammo group is not in a container"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:146
|
||||
#: 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/show.html.heex:53
|
||||
msgid "Tracer"
|
||||
@ -528,7 +529,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/topbar.ex:64
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:39
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:65
|
||||
msgid "Range"
|
||||
msgstr ""
|
||||
|
||||
@ -565,15 +566,9 @@ msgstr ""
|
||||
msgid "Unstage from range"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:52
|
||||
msgid "Add Shot group"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:3
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:24
|
||||
#: lib/cannery_web/live/range_live/index.ex:28
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:26
|
||||
msgid "Record shots"
|
||||
msgstr ""
|
||||
|
||||
@ -583,7 +578,7 @@ msgid "Ammo Types"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:47
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:49
|
||||
msgid "Ammo groups"
|
||||
msgstr ""
|
||||
|
||||
@ -594,6 +589,7 @@ msgid "Date (UTC)"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:39
|
||||
#: lib/cannery_web/live/range_live/index.ex:34
|
||||
msgid "Edit Shot Records"
|
||||
msgstr ""
|
||||
@ -625,8 +621,8 @@ msgid "Shot Records"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:30
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:53
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:32
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:40
|
||||
msgid "Move Ammo group"
|
||||
msgstr ""
|
||||
|
||||
@ -647,7 +643,7 @@ msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/ammo_group_card.ex:43
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:64
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:90
|
||||
#: 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_type_live/show.html.heex:98
|
||||
@ -655,40 +651,40 @@ msgid "$%{amount}"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:83
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:75
|
||||
msgid "Bimetal"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:78
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:72
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:57
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:45
|
||||
msgid "Jacket type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:87
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:79
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:58
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:46
|
||||
msgid "Muzzle velocity"
|
||||
msgstr ""
|
||||
|
||||
#, 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:93
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:60
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:48
|
||||
msgid "Powder grains per charge"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:97
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:89
|
||||
#: lib/cannery_web/live/ammo_type_live/index.ex:59
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:47
|
||||
msgid "Powder type"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:168
|
||||
#: 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/show.html.heex:58
|
||||
msgid "UPC"
|
||||
@ -711,17 +707,17 @@ msgid "New password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:82
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108
|
||||
msgid "Stage"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:82
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:108
|
||||
msgid "Unstage"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:137
|
||||
#: 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/show.html.heex:52
|
||||
msgid "Firing type"
|
||||
@ -765,7 +761,7 @@ msgid "No cost information"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:36
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:62
|
||||
msgid "% left"
|
||||
msgstr ""
|
||||
|
||||
@ -808,3 +804,34 @@ msgstr ""
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:85
|
||||
msgid "Total rounds shot:"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:8
|
||||
msgid "Confirm your account"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:9
|
||||
msgid "Forgot your password?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_session_controller.ex:8
|
||||
msgid "Log in"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:35
|
||||
msgid "Register"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:36
|
||||
msgid "Reset your password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:38
|
||||
#: lib/cannery_web/live/range_live/index.ex:28
|
||||
msgid "Record Shots"
|
||||
msgstr ""
|
||||
|
@ -65,19 +65,19 @@ msgid "Oops, something went wrong! Please check the errors below."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:60
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:63
|
||||
msgid "Reset password link is invalid or it has expired."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:25
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:53
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:56
|
||||
msgid "Sorry, public registration is disabled"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:15
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:43
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:46
|
||||
msgid "Sorry, this invite was not found or expired"
|
||||
msgstr ""
|
||||
|
||||
@ -92,7 +92,7 @@ msgid "Unauthorized"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:53
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:54
|
||||
msgid "User confirmation link is invalid or it has expired."
|
||||
msgstr ""
|
||||
|
||||
|
@ -63,18 +63,18 @@ msgid "A link to confirm your email change has been sent to the new address."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.ex:87
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.ex:90
|
||||
msgid "Ammo group created successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:54
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:34
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:56
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:52
|
||||
msgid "Ammo group deleted succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.ex:69
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.ex:72
|
||||
msgid "Ammo group updated successfully"
|
||||
msgstr ""
|
||||
|
||||
@ -98,7 +98,7 @@ msgid "Are you sure you want to delete the invite for %{name}?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:146
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:66
|
||||
#: lib/cannery_web/live/ammo_type_live/index.html.heex:75
|
||||
msgid "Are you sure you want to delete this ammo?"
|
||||
@ -125,7 +125,7 @@ msgid "Email changed successfully."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:22
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:23
|
||||
msgid "If your email is in our system and it has not been confirmed yet, you will receive an email with instructions shortly."
|
||||
msgstr ""
|
||||
|
||||
@ -140,7 +140,7 @@ msgid "Logged out successfully."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:43
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:46
|
||||
msgid "Password reset successfully."
|
||||
msgstr ""
|
||||
|
||||
@ -150,7 +150,7 @@ msgid "Password updated successfully."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:71
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:74
|
||||
msgid "Please check your email to verify your account"
|
||||
msgstr ""
|
||||
|
||||
@ -162,7 +162,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:44
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:55
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:173
|
||||
#: 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/invite_live/form_component.html.heex:30
|
||||
#: lib/cannery_web/live/range_live/form_component.html.heex:42
|
||||
@ -211,11 +211,13 @@ msgid "Ammo group unstaged succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:159
|
||||
#: lib/cannery_web/live/range_live/index.html.heex:108
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:80
|
||||
#: lib/cannery_web/live/range_live/index.ex:56
|
||||
msgid "Shot records deleted succesfully"
|
||||
msgstr ""
|
||||
@ -226,7 +228,7 @@ msgid "Shot records updated successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:37
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:38
|
||||
msgid "%{email} confirmed successfully."
|
||||
msgstr ""
|
||||
|
||||
@ -244,3 +246,9 @@ msgstr ""
|
||||
#: lib/cannery_web/live/container_live/edit_tags_component.ex:58
|
||||
msgid "%{name} removed successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:15
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
|
||||
msgid "You'll need to"
|
||||
msgstr ""
|
||||
|
@ -65,19 +65,19 @@ msgid "Oops, something went wrong! Please check the errors below."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:60
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:63
|
||||
msgid "Reset password link is invalid or it has expired."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:25
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:53
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:56
|
||||
msgid "Sorry, public registration is disabled"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:15
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:43
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:46
|
||||
msgid "Sorry, this invite was not found or expired"
|
||||
msgstr ""
|
||||
|
||||
@ -92,7 +92,7 @@ msgid "Unauthorized"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:53
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:54
|
||||
msgid "User confirmation link is invalid or it has expired."
|
||||
msgstr ""
|
||||
|
||||
@ -157,3 +157,13 @@ msgstr ""
|
||||
#: lib/cannery_web/live/container_live/edit_tags_component.ex:52
|
||||
msgid "Tag could not be removed"
|
||||
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 ""
|
||||
|
@ -62,18 +62,13 @@ msgid "A link to confirm your email change has been sent to the new address."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.ex:87
|
||||
msgid "Ammo group created successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:54
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:34
|
||||
#: lib/cannery_web/live/ammo_group_live/index.ex:56
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:52
|
||||
msgid "Ammo group deleted succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.ex:69
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.ex:75
|
||||
msgid "Ammo group updated successfully"
|
||||
msgstr ""
|
||||
|
||||
@ -97,7 +92,7 @@ msgid "Are you sure you want to delete the invite for %{name}?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:120
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:146
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:66
|
||||
#: lib/cannery_web/live/ammo_type_live/index.html.heex:75
|
||||
msgid "Are you sure you want to delete this ammo?"
|
||||
@ -124,7 +119,7 @@ msgid "Email changed successfully."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:22
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:23
|
||||
msgid "If your email is in our system and it has not been confirmed yet, you will receive an email with instructions shortly."
|
||||
msgstr ""
|
||||
|
||||
@ -139,7 +134,7 @@ msgid "Logged out successfully."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:43
|
||||
#: lib/cannery_web/controllers/user_reset_password_controller.ex:46
|
||||
msgid "Password reset successfully."
|
||||
msgstr ""
|
||||
|
||||
@ -149,7 +144,7 @@ msgid "Password updated successfully."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:71
|
||||
#: lib/cannery_web/controllers/user_registration_controller.ex:74
|
||||
msgid "Please check your email to verify your account"
|
||||
msgstr ""
|
||||
|
||||
@ -159,9 +154,9 @@ msgid "Register to setup %{name}"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:44
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:55
|
||||
#: lib/cannery_web/live/ammo_type_live/form_component.html.heex:173
|
||||
#: lib/cannery_web/components/add_shot_group_component.html.heex:48
|
||||
#: 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/container_live/form_component.html.heex:52
|
||||
#: lib/cannery_web/live/invite_live/form_component.html.heex:30
|
||||
#: lib/cannery_web/live/range_live/form_component.html.heex:42
|
||||
@ -210,11 +205,13 @@ msgid "Ammo group unstaged succesfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:159
|
||||
#: lib/cannery_web/live/range_live/index.html.heex:108
|
||||
msgid "Are you sure you want to delete this shot record?"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/show.ex:80
|
||||
#: lib/cannery_web/live/range_live/index.ex:56
|
||||
msgid "Shot records deleted succesfully"
|
||||
msgstr ""
|
||||
@ -225,7 +222,7 @@ msgid "Shot records updated successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:37
|
||||
#: lib/cannery_web/controllers/user_confirmation_controller.ex:38
|
||||
msgid "%{email} confirmed successfully."
|
||||
msgstr ""
|
||||
|
||||
@ -243,3 +240,21 @@ msgstr ""
|
||||
#: lib/cannery_web/live/container_live/edit_tags_component.ex:58
|
||||
msgid "%{name} removed successfully"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:15
|
||||
#: lib/cannery_web/live/ammo_group_live/index.html.heex:33
|
||||
msgid "You'll need to"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:67
|
||||
msgid "Creating..."
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: 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] ""
|
||||
|
@ -20,8 +20,8 @@ defmodule Cannery.ActivityLogTest do
|
||||
container = container_fixture(current_user)
|
||||
ammo_type = ammo_type_fixture(current_user)
|
||||
|
||||
%{id: ammo_group_id} =
|
||||
ammo_group = ammo_group_fixture(%{"count" => 25}, ammo_type, container, current_user)
|
||||
{1, [%{id: ammo_group_id} = ammo_group]} =
|
||||
ammo_group_fixture(%{"count" => 25}, ammo_type, container, current_user)
|
||||
|
||||
shot_group =
|
||||
%{"count" => 5, "date" => ~N[2022-02-13 03:17:00], "notes" => "some notes"}
|
||||
|
@ -108,7 +108,7 @@ defmodule Cannery.AmmoTest do
|
||||
current_user = user_fixture()
|
||||
ammo_type = ammo_type_fixture(current_user)
|
||||
container = container_fixture(current_user)
|
||||
ammo_group = ammo_group_fixture(ammo_type, container, current_user)
|
||||
{1, [ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
|
||||
|
||||
[
|
||||
ammo_type: ammo_type,
|
||||
@ -129,28 +129,28 @@ defmodule Cannery.AmmoTest do
|
||||
ammo_group |> Repo.preload(:shot_groups)
|
||||
end
|
||||
|
||||
test "create_ammo_group/1 with valid data creates a ammo_group",
|
||||
test "create_ammo_groups/3 with valid data creates a ammo_group",
|
||||
%{
|
||||
ammo_type: ammo_type,
|
||||
container: container,
|
||||
current_user: current_user
|
||||
} do
|
||||
assert {:ok, %AmmoGroup{} = ammo_group} =
|
||||
assert {:ok, {1, [%AmmoGroup{} = ammo_group]}} =
|
||||
@valid_attrs
|
||||
|> Map.merge(%{"ammo_type_id" => ammo_type.id, "container_id" => container.id})
|
||||
|> Ammo.create_ammo_group(current_user)
|
||||
|> Ammo.create_ammo_groups(1, current_user)
|
||||
|
||||
assert ammo_group.count == 42
|
||||
assert ammo_group.notes == "some notes"
|
||||
assert ammo_group.price_paid == 120.5
|
||||
end
|
||||
|
||||
test "create_ammo_group/1 with invalid data returns error changeset",
|
||||
test "create_ammo_groups/3 with invalid data returns error changeset",
|
||||
%{ammo_type: ammo_type, container: container, current_user: current_user} do
|
||||
assert {:error, %Changeset{}} =
|
||||
@invalid_attrs
|
||||
|> Map.merge(%{"ammo_type_id" => ammo_type.id, "container_id" => container.id})
|
||||
|> Ammo.create_ammo_group(current_user)
|
||||
|> Ammo.create_ammo_groups(1, current_user)
|
||||
end
|
||||
|
||||
test "update_ammo_group/2 with valid data updates the ammo_group",
|
||||
|
@ -6,18 +6,26 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
|
||||
use CanneryWeb.ConnCase
|
||||
import Phoenix.LiveViewTest
|
||||
import CanneryWeb.Gettext
|
||||
alias Cannery.Repo
|
||||
alias Cannery.{Ammo, Repo}
|
||||
|
||||
@moduletag :ammo_group_live_test
|
||||
@shot_group_create_attrs %{"ammo_left" => 5, "notes" => "some notes"}
|
||||
@create_attrs %{count: 42, notes: "some notes", price_paid: 120.5}
|
||||
@update_attrs %{count: 43, notes: "some updated notes", price_paid: 456.7}
|
||||
@shot_group_update_attrs %{"count" => 5, "notes" => "some updated notes"}
|
||||
@create_attrs %{"count" => 42, "notes" => "some notes", "price_paid" => 120.5}
|
||||
@update_attrs %{"count" => 43, "notes" => "some updated notes", "price_paid" => 456.7}
|
||||
@ammo_group_create_limit 10_000
|
||||
# @invalid_attrs %{count: -1, notes: nil, price_paid: nil}
|
||||
|
||||
defp create_ammo_group(%{current_user: current_user}) do
|
||||
ammo_type = ammo_type_fixture(current_user)
|
||||
container = container_fixture(current_user)
|
||||
%{ammo_group: ammo_group_fixture(ammo_type, container, current_user)}
|
||||
{1, [ammo_group]} = ammo_group_fixture(ammo_type, container, current_user)
|
||||
|
||||
shot_group =
|
||||
%{"count" => 5, "date" => ~N[2022-02-13 03:17:00], "notes" => "some notes"}
|
||||
|> shot_group_fixture(current_user, ammo_group)
|
||||
|
||||
%{ammo_group: ammo_group, shot_group: shot_group}
|
||||
end
|
||||
|
||||
describe "Index" do
|
||||
@ -31,7 +39,7 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
|
||||
assert html =~ ammo_group.ammo_type.name
|
||||
end
|
||||
|
||||
test "saves new ammo_group", %{conn: conn} do
|
||||
test "saves a single new ammo_group", %{conn: conn} do
|
||||
{:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
|
||||
|
||||
assert index_live |> element("a", dgettext("actions", "New Ammo group")) |> render_click() =~
|
||||
@ -53,6 +61,68 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
|
||||
assert html =~ "42"
|
||||
end
|
||||
|
||||
test "saves multiple new ammo_groups", %{conn: conn, current_user: current_user} do
|
||||
multiplier = 25
|
||||
|
||||
{:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
|
||||
|
||||
assert index_live |> element("a", dgettext("actions", "New Ammo group")) |> render_click() =~
|
||||
gettext("New Ammo group")
|
||||
|
||||
assert_patch(index_live, Routes.ammo_group_index_path(conn, :new))
|
||||
|
||||
# assert index_live
|
||||
# |> form("#ammo_group-form", ammo_group: @invalid_attrs)
|
||||
# |> render_change() =~ dgettext("errors", "can't be blank")
|
||||
|
||||
{:ok, _, html} =
|
||||
index_live
|
||||
|> form("#ammo_group-form",
|
||||
ammo_group: @create_attrs |> Map.put("multiplier", to_string(multiplier))
|
||||
)
|
||||
|> render_submit()
|
||||
|> follow_redirect(conn, Routes.ammo_group_index_path(conn, :index))
|
||||
|
||||
assert html =~ dgettext("prompts", "Ammo groups created successfully")
|
||||
assert Ammo.list_ammo_groups(current_user) |> Enum.count() == multiplier + 1
|
||||
end
|
||||
|
||||
test "does not save invalid number of new ammo_groups", %{conn: conn} do
|
||||
{:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
|
||||
|
||||
assert index_live |> element("a", dgettext("actions", "New Ammo group")) |> render_click() =~
|
||||
gettext("New Ammo group")
|
||||
|
||||
assert_patch(index_live, Routes.ammo_group_index_path(conn, :new))
|
||||
|
||||
# assert index_live
|
||||
# |> form("#ammo_group-form", ammo_group: @invalid_attrs)
|
||||
# |> render_change() =~ dgettext("errors", "can't be blank")
|
||||
|
||||
assert index_live
|
||||
|> form("#ammo_group-form", ammo_group: @create_attrs |> Map.put("multiplier", "0"))
|
||||
|> render_submit() =~
|
||||
dgettext(
|
||||
"errors",
|
||||
"Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}",
|
||||
multiplier: 0,
|
||||
max: @ammo_group_create_limit
|
||||
)
|
||||
|
||||
assert index_live
|
||||
|> form("#ammo_group-form",
|
||||
ammo_group:
|
||||
@create_attrs |> Map.put("multiplier", to_string(@ammo_group_create_limit + 1))
|
||||
)
|
||||
|> render_submit() =~
|
||||
dgettext(
|
||||
"errors",
|
||||
"Invalid number of copies, must be between 1 and %{max}. Was %{multiplier}",
|
||||
multiplier: @ammo_group_create_limit + 1,
|
||||
max: @ammo_group_create_limit
|
||||
)
|
||||
end
|
||||
|
||||
test "saves new shot_group", %{conn: conn, ammo_group: ammo_group} do
|
||||
{:ok, index_live, _html} = live(conn, Routes.ammo_group_index_path(conn, :index))
|
||||
|
||||
@ -164,5 +234,40 @@ defmodule CanneryWeb.AmmoGroupLiveTest do
|
||||
|
||||
assert html =~ dgettext("prompts", "Shots recorded successfully")
|
||||
end
|
||||
|
||||
test "updates shot_group in listing",
|
||||
%{conn: conn, ammo_group: ammo_group, shot_group: shot_group} do
|
||||
{:ok, index_live, _html} = live(conn, Routes.ammo_group_show_path(conn, :edit, ammo_group))
|
||||
|
||||
assert index_live |> element("[data-qa=\"edit-#{shot_group.id}\"]") |> render_click() =~
|
||||
gettext("Edit Shot Records")
|
||||
|
||||
assert_patch(
|
||||
index_live,
|
||||
Routes.ammo_group_show_path(conn, :edit_shot_group, ammo_group, shot_group)
|
||||
)
|
||||
|
||||
# assert index_live
|
||||
# |> form("#shot_group-form", shot_group: @invalid_attrs)
|
||||
# |> render_change() =~ dgettext("errors", "is invalid")
|
||||
|
||||
{:ok, _, html} =
|
||||
index_live
|
||||
|> form("#shot-group-form", shot_group: @shot_group_update_attrs)
|
||||
|> render_submit()
|
||||
|> follow_redirect(conn, Routes.ammo_group_show_path(conn, :show, ammo_group))
|
||||
|
||||
assert html =~ dgettext("actions", "Shot records updated successfully")
|
||||
assert html =~ "some updated notes"
|
||||
end
|
||||
|
||||
test "deletes shot_group in listing",
|
||||
%{conn: conn, ammo_group: ammo_group, shot_group: shot_group} do
|
||||
{:ok, index_live, _html} =
|
||||
live(conn, Routes.ammo_group_show_path(conn, :edit_shot_group, ammo_group, shot_group))
|
||||
|
||||
assert index_live |> element("[data-qa=\"delete-#{shot_group.id}\"]") |> render_click()
|
||||
refute has_element?(index_live, "#shot_group-#{shot_group.id}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -16,7 +16,9 @@ defmodule CanneryWeb.RangeLiveTest do
|
||||
defp create_shot_group(%{current_user: current_user}) do
|
||||
container = container_fixture(%{"staged" => true}, current_user)
|
||||
ammo_type = ammo_type_fixture(current_user)
|
||||
ammo_group = ammo_group_fixture(%{"staged" => true}, ammo_type, container, current_user)
|
||||
|
||||
{1, [ammo_group]} =
|
||||
ammo_group_fixture(%{"staged" => true}, ammo_type, container, current_user)
|
||||
|
||||
shot_group =
|
||||
%{"count" => 5, "date" => ~N[2022-02-13 03:17:00], "notes" => "some notes"}
|
||||
|
@ -111,10 +111,20 @@ defmodule Cannery.Fixtures do
|
||||
@doc """
|
||||
Generate a AmmoGroup
|
||||
"""
|
||||
@spec ammo_group_fixture(AmmoType.t(), Container.t(), User.t()) :: AmmoGroup.t()
|
||||
@spec ammo_group_fixture(attrs :: map(), AmmoType.t(), Container.t(), User.t()) :: AmmoGroup.t()
|
||||
@spec ammo_group_fixture(AmmoType.t(), Container.t(), User.t()) ::
|
||||
{count :: non_neg_integer(), [AmmoGroup.t()]}
|
||||
@spec ammo_group_fixture(attrs :: map(), AmmoType.t(), Container.t(), User.t()) ::
|
||||
{count :: non_neg_integer(), [AmmoGroup.t()]}
|
||||
@spec ammo_group_fixture(
|
||||
attrs :: map(),
|
||||
multiplier :: non_neg_integer(),
|
||||
AmmoType.t(),
|
||||
Container.t(),
|
||||
User.t()
|
||||
) :: {count :: non_neg_integer(), [AmmoGroup.t()]}
|
||||
def ammo_group_fixture(
|
||||
attrs \\ %{},
|
||||
multiplier \\ 1,
|
||||
%AmmoType{id: ammo_type_id},
|
||||
%Container{id: container_id},
|
||||
%User{} = user
|
||||
@ -125,7 +135,7 @@ defmodule Cannery.Fixtures do
|
||||
"container_id" => container_id,
|
||||
"count" => 20
|
||||
})
|
||||
|> Ammo.create_ammo_group(user)
|
||||
|> Ammo.create_ammo_groups(multiplier, user)
|
||||
|> unwrap_ok_tuple()
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user