gettext ammo groups
This commit is contained in:
parent
3675d0b4f4
commit
ac62afb313
@ -25,18 +25,20 @@ defmodule CanneryWeb.AmmoGroupLive.AmmoGroupCard do
|
|||||||
|
|
||||||
<div class="flex flex-col justify-center items-center">
|
<div class="flex flex-col justify-center items-center">
|
||||||
<span class="rounded-lg title text-lg">
|
<span class="rounded-lg title text-lg">
|
||||||
Count: <%= @ammo_group.count %>
|
<%= gettext("Count:") %>
|
||||||
|
<%= @ammo_group.count %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<%= if @ammo_group.notes do %>
|
<%= if @ammo_group.notes do %>
|
||||||
<span class="rounded-lg title text-lg">
|
<span class="rounded-lg title text-lg">
|
||||||
Notes: <%= @ammo_group.notes %>
|
<%= gettext("Notes:") %>
|
||||||
|
<%= @ammo_group.notes %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= if @ammo_group.price_paid do %>
|
<%= if @ammo_group.price_paid do %>
|
||||||
<span class="rounded-lg title text-lg">
|
<span class="rounded-lg title text-lg">
|
||||||
Price paid: $ <%= @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %>
|
<%= gettext("Price paid:") %> $ <%= @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,41 +54,41 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= label(f, :ammo_type_id, class: "mr-4 title text-lg text-primary-500") %>
|
<%= label(f, :ammo_type_id, gettext("Ammo type"), class: "mr-4 title text-lg text-primary-500") %>
|
||||||
<%= select(f, :ammo_type_id, ammo_type_options(@ammo_types),
|
<%= select(f, :ammo_type_id, ammo_type_options(@ammo_types),
|
||||||
class: "text-center col-span-2 input input-primary"
|
class: "text-center col-span-2 input input-primary"
|
||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :ammo_type_id, "col-span-3 text-center") %>
|
<%= error_tag(f, :ammo_type_id, "col-span-3 text-center") %>
|
||||||
|
|
||||||
<%= label(f, :count, class: "mr-4 title text-lg text-primary-500") %>
|
<%= label(f, :count, gettext("Count"), class: "mr-4 title text-lg text-primary-500") %>
|
||||||
<%= number_input(f, :count,
|
<%= number_input(f, :count,
|
||||||
class: "text-center col-span-2 input input-primary",
|
class: "text-center col-span-2 input input-primary",
|
||||||
min: 1
|
min: 1
|
||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :count, "col-span-3 text-center") %>
|
<%= error_tag(f, :count, "col-span-3 text-center") %>
|
||||||
|
|
||||||
<%= label(f, :price_paid, class: "mr-4 title text-lg text-primary-500") %>
|
<%= label(f, :price_paid, gettext("Price paid"), class: "mr-4 title text-lg text-primary-500") %>
|
||||||
<%= number_input(f, :price_paid,
|
<%= number_input(f, :price_paid,
|
||||||
step: "0.01",
|
step: "0.01",
|
||||||
class: "text-center col-span-2 input input-primary"
|
class: "text-center col-span-2 input input-primary"
|
||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :price_paid, "col-span-3 text-center") %>
|
<%= error_tag(f, :price_paid, "col-span-3 text-center") %>
|
||||||
|
|
||||||
<%= label(f, :notes, class: "mr-4 title text-lg text-primary-500") %>
|
<%= label(f, :notes, gettext("Notes"), class: "mr-4 title text-lg text-primary-500") %>
|
||||||
<%= textarea(f, :notes,
|
<%= textarea(f, :notes,
|
||||||
class: "text-center col-span-2 input input-primary",
|
class: "text-center col-span-2 input input-primary",
|
||||||
phx_hook: "MaintainAttrs"
|
phx_hook: "MaintainAttrs"
|
||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :notes, "col-span-3 text-center") %>
|
<%= error_tag(f, :notes, "col-span-3 text-center") %>
|
||||||
|
|
||||||
<%= label(f, :container, class: "mr-4 title text-lg text-primary-500") %>
|
<%= label(f, :container, gettext("Container"), class: "mr-4 title text-lg text-primary-500") %>
|
||||||
<%= select(f, :container_id, container_options(@containers),
|
<%= select(f, :container_id, container_options(@containers),
|
||||||
class: "text-center col-span-2 input input-primary"
|
class: "text-center col-span-2 input input-primary"
|
||||||
) %>
|
) %>
|
||||||
<%= error_tag(f, :container_id, "col-span-3 text-center") %>
|
<%= error_tag(f, :container_id, "col-span-3 text-center") %>
|
||||||
|
|
||||||
<%= submit("Save",
|
<%= submit(dgettext("actions", "Save"),
|
||||||
phx_disable_with: "Saving...",
|
phx_disable_with: dgettext("prompts", "Saving..."),
|
||||||
class: "mx-auto col-span-3 btn btn-primary"
|
class: "mx-auto col-span-3 btn btn-primary"
|
||||||
) %>
|
) %>
|
||||||
</.form>
|
</.form>
|
||||||
@ -116,7 +116,7 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
|
|||||||
{:ok, _ammo_group} ->
|
{:ok, _ammo_group} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Ammo group updated successfully")
|
|> put_flash(:info, dgettext("prompts", "Ammo group updated successfully"))
|
||||||
|> push_redirect(to: socket.assigns.return_to)}
|
|> push_redirect(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Changeset{} = changeset} ->
|
{:error, %Changeset{} = changeset} ->
|
||||||
@ -129,7 +129,7 @@ defmodule CanneryWeb.AmmoGroupLive.FormComponent do
|
|||||||
{:ok, _ammo_group} ->
|
{:ok, _ammo_group} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Ammo group created successfully")
|
|> put_flash(:info, dgettext("prompts", "Ammo group created successfully"))
|
||||||
|> push_redirect(to: socket.assigns.return_to)}
|
|> push_redirect(to: socket.assigns.return_to)}
|
||||||
|
|
||||||
{:error, %Changeset{} = changeset} ->
|
{:error, %Changeset{} = changeset} ->
|
||||||
|
@ -20,19 +20,19 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
|
|||||||
|
|
||||||
defp apply_action(socket, :edit, %{"id" => id}) do
|
defp apply_action(socket, :edit, %{"id" => id}) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Edit Ammo group")
|
|> assign(:page_title, gettext("Edit Ammo group"))
|
||||||
|> assign(:ammo_group, Ammo.get_ammo_group!(id))
|
|> assign(:ammo_group, Ammo.get_ammo_group!(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :new, _params) do
|
defp apply_action(socket, :new, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Add Ammo")
|
|> assign(:page_title, dgettext("actions", "Add Ammo"))
|
||||||
|> assign(:ammo_group, %AmmoGroup{})
|
|> assign(:ammo_group, %AmmoGroup{})
|
||||||
end
|
end
|
||||||
|
|
||||||
defp apply_action(socket, :index, _params) do
|
defp apply_action(socket, :index, _params) do
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Listing Ammo groups")
|
|> assign(:page_title, gettext("Listing Ammo groups"))
|
||||||
|> assign(:ammo_group, nil)
|
|> assign(:ammo_group, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<div class="mx-8 flex flex-col space-y-8 justify-center items-center">
|
<div class="mx-8 flex flex-col space-y-8 justify-center items-center">
|
||||||
<h1 class="title text-2xl title-primary-500">
|
<h1 class="title text-2xl title-primary-500">
|
||||||
Listing Ammo
|
<%= gettext("Listing Ammo") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<%= if @ammo_groups |> Enum.empty?() do %>
|
<%= if @ammo_groups |> Enum.empty?() do %>
|
||||||
<h2 class="title text-xl text-primary-500">
|
<h2 class="title text-xl text-primary-500">
|
||||||
No Ammo 😔
|
<%= gettext("No Ammo") %> 😔
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<%= live_patch("Add your first box!",
|
<%= live_patch(dgettext("actions", "Add your first box!"),
|
||||||
to: Routes.ammo_group_index_path(@socket, :new),
|
to: Routes.ammo_group_index_path(@socket, :new),
|
||||||
class: "btn btn-primary"
|
class: "btn btn-primary"
|
||||||
) %>
|
) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= live_patch("New Ammo group",
|
<%= live_patch(dgettext("actions", "New Ammo group"),
|
||||||
to: Routes.ammo_group_index_path(@socket, :new),
|
to: Routes.ammo_group_index_path(@socket, :new),
|
||||||
class: "btn btn-primary"
|
class: "btn btn-primary"
|
||||||
) %>
|
) %>
|
||||||
@ -23,13 +23,13 @@
|
|||||||
<thead class="border-b border-primary-600">
|
<thead class="border-b border-primary-600">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="p-2">
|
<th class="p-2">
|
||||||
Count
|
<%= gettext("Count") %>
|
||||||
</th>
|
</th>
|
||||||
<th class="p-2">
|
<th class="p-2">
|
||||||
Price paid
|
<%= gettext("Price paid") %>
|
||||||
</th>
|
</th>
|
||||||
<th class="p-2">
|
<th class="p-2">
|
||||||
Notes
|
<%= gettext("Notes") %>
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
<th class="p-2"></th>
|
<th class="p-2"></th>
|
||||||
@ -53,7 +53,9 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="p-2 w-full h-full space-x-2 flex justify-center items-center">
|
<td class="p-2 w-full h-full space-x-2 flex justify-center items-center">
|
||||||
<%= live_redirect("View", to: Routes.ammo_group_show_path(@socket, :show, ammo_group)) %>
|
<%= live_redirect(dgettext("actions", "View"),
|
||||||
|
to: Routes.ammo_group_show_path(@socket, :show, ammo_group)
|
||||||
|
) %>
|
||||||
|
|
||||||
<%= live_patch to: Routes.ammo_group_index_path(@socket, :edit, ammo_group),
|
<%= live_patch to: Routes.ammo_group_index_path(@socket, :edit, ammo_group),
|
||||||
class: "text-primary-500 link" do %>
|
class: "text-primary-500 link" do %>
|
||||||
@ -64,7 +66,7 @@
|
|||||||
class: "text-primary-500 link",
|
class: "text-primary-500 link",
|
||||||
phx_click: "delete",
|
phx_click: "delete",
|
||||||
phx_value_id: ammo_group.id,
|
phx_value_id: ammo_group.id,
|
||||||
data: [confirm: "Are you sure you want to delete this ammo?"] do %>
|
data: [confirm: dgettext("prompts", "Are you sure you want to delete this ammo?")] do %>
|
||||||
<i class="fa-fw fa-lg fas fa-trash"></i>
|
<i class="fa-fw fa-lg fas fa-trash"></i>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
@ -32,6 +32,6 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
|
|||||||
{:noreply, socket |> push_redirect(to: Routes.ammo_group_index_path(socket, :index))}
|
{:noreply, socket |> push_redirect(to: Routes.ammo_group_index_path(socket, :index))}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp page_title(:show), do: "Show Ammo group"
|
defp page_title(:show), do: gettext("Show Ammo group")
|
||||||
defp page_title(:edit), do: "Edit Ammo group"
|
defp page_title(:edit), do: gettext("Edit Ammo group")
|
||||||
end
|
end
|
||||||
|
@ -5,18 +5,20 @@
|
|||||||
|
|
||||||
<div class="space-y-2 flex flex-col justify-center items-center">
|
<div class="space-y-2 flex flex-col justify-center items-center">
|
||||||
<span class="rounded-lg title text-lg">
|
<span class="rounded-lg title text-lg">
|
||||||
Count: <%= @ammo_group.count %>
|
<%= gettext("Count:") %>
|
||||||
|
<%= @ammo_group.count %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<%= if @ammo_group.notes do %>
|
<%= if @ammo_group.notes do %>
|
||||||
<span class="rounded-lg title text-lg">
|
<span class="rounded-lg title text-lg">
|
||||||
Notes: <%= @ammo_group.notes %>
|
<%= gettext("Notes:") %>
|
||||||
|
<%= @ammo_group.notes %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= if @ammo_group.price_paid do %>
|
<%= if @ammo_group.price_paid do %>
|
||||||
<span class="rounded-lg title text-lg">
|
<span class="rounded-lg title text-lg">
|
||||||
Price paid: $ <%= @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %>
|
<%= gettext("Price paid:") %> $ <%= @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
@ -30,7 +32,7 @@
|
|||||||
<%= link to: "#",
|
<%= link to: "#",
|
||||||
class: "text-primary-500 link",
|
class: "text-primary-500 link",
|
||||||
phx_click: "delete",
|
phx_click: "delete",
|
||||||
data: [confirm: "Are you sure you want to delete this ammo?"] do %>
|
data: [confirm: dgettext("prompts", "Are you sure you want to delete this ammo?")] do %>
|
||||||
<i class="fa-fw fa-lg fas fa-trash"></i>
|
<i class="fa-fw fa-lg fas fa-trash"></i>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
@ -40,12 +42,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<%= if @ammo_group.container do %>
|
<%= if @ammo_group.container do %>
|
||||||
<h1 class="mb-4 px-4 py-2 text-center rounded-lg title text-xl">
|
<h1 class="mb-4 px-4 py-2 text-center rounded-lg title text-xl">
|
||||||
Stored in
|
<%= gettext("Stored in") %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<.container_card container={@ammo_group.container} />
|
<.container_card container={@ammo_group.container} />
|
||||||
<% else %>
|
<% else %>
|
||||||
This ammo group is not in a container
|
<%= gettext("This ammo group is not in a container") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -74,3 +74,28 @@ msgstr ""
|
|||||||
#: lib/cannery_web/templates/user_reset_password/new.html.heex:16
|
#: lib/cannery_web/templates/user_reset_password/new.html.heex:16
|
||||||
msgid "Send instructions to reset password"
|
msgid "Send instructions to reset password"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:29
|
||||||
|
msgid "Add Ammo"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:11
|
||||||
|
msgid "Add your first box!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:16
|
||||||
|
msgid "New Ammo group"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/form_component.ex:90
|
||||||
|
msgid "Save"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:56
|
||||||
|
msgid "View"
|
||||||
|
msgstr ""
|
||||||
|
@ -109,3 +109,72 @@ msgstr ""
|
|||||||
#: lib/cannery_web/templates/user_settings/edit.html.heex:3
|
#: lib/cannery_web/templates/user_settings/edit.html.heex:3
|
||||||
msgid "Settings"
|
msgid "Settings"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:26
|
||||||
|
msgid "Count"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/ammo_group_card.ex:28
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:8
|
||||||
|
msgid "Count:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:23
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.ex:36
|
||||||
|
msgid "Edit Ammo group"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3
|
||||||
|
msgid "Listing Ammo"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.ex:35
|
||||||
|
msgid "Listing Ammo groups"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:8
|
||||||
|
msgid "No Ammo"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:32
|
||||||
|
msgid "Notes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/ammo_group_card.ex:34
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:14
|
||||||
|
msgid "Notes:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:29
|
||||||
|
msgid "Price paid"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/ammo_group_card.ex:41
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:21
|
||||||
|
msgid "Price paid:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.ex:35
|
||||||
|
msgid "Show Ammo group"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:45
|
||||||
|
msgid "Stored in"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:50
|
||||||
|
msgid "This ammo group is not in a container"
|
||||||
|
msgstr ""
|
||||||
|
@ -75,3 +75,24 @@ msgstr ""
|
|||||||
#: lib/cannery_web/controllers/user_settings_controller.ex:78
|
#: lib/cannery_web/controllers/user_settings_controller.ex:78
|
||||||
msgid "Your account has been deleted"
|
msgid "Your account has been deleted"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/form_component.ex:132
|
||||||
|
msgid "Ammo group created successfully"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/form_component.ex:119
|
||||||
|
msgid "Ammo group updated successfully"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/index.html.heex:69
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/show.html.heex:35
|
||||||
|
msgid "Are you sure you want to delete this ammo?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#, elixir-format, ex-autogen
|
||||||
|
#: lib/cannery_web/live/ammo_group_live/form_component.ex:91
|
||||||
|
msgid "Saving..."
|
||||||
|
msgstr ""
|
||||||
|
Loading…
Reference in New Issue
Block a user