Compare commits

..

9 Commits

Author SHA1 Message Date
a0389db9ef run npm audit
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-06 00:03:57 -04:00
e6e4db7410 add involvement links 2022-05-05 23:59:31 -04:00
78542a533a bump version 2022-05-05 23:45:03 -04:00
46665dce88 add changes to changelog 2022-05-05 23:44:32 -04:00
4b420f313c add locale as per user setting 2022-05-05 23:26:29 -04:00
42b4d0758f add gettext changes 2022-05-05 23:02:06 -04:00
901c2a948f add created at date to ammo types 2022-05-05 21:43:49 -04:00
6fe5a29ebd add registered on date to user card 2022-05-05 21:43:13 -04:00
ce7223597c add created date to ammo groups 2022-05-05 21:43:03 -04:00
33 changed files with 493 additions and 224 deletions

View File

@ -1,3 +1,11 @@
# v0.5.2
- Add "Added on" date to ammo groups
- Add "Added on" date to ammo types
- Add "Registered on" date to user information
- Add language in user settings. The `LOCALE` environment variable will continue
to set the default locale for the application.
- Add involvement links to home page
# v0.5.1 # v0.5.1
- Add French translation: Thank you [duponin](https://udongein.xyz/users/duponin)! - Add French translation: Thank you [duponin](https://udongein.xyz/users/duponin)!

View File

@ -63,8 +63,7 @@ And as always, thank you!
[`phx_gen_auth`](https://hexdocs.pm/phx_gen_auth/). [`phx_gen_auth`](https://hexdocs.pm/phx_gen_auth/).
- `Dockerfile` and example `docker-compose.yml` - `Dockerfile` and example `docker-compose.yml`
- Automatic migrations in `MIX_ENV=prod` or Docker image - Automatic migrations in `MIX_ENV=prod` or Docker image
- JS linting with [standard.js](https://standardjs.com), HEEx linting with - JS linting with [standard.js](https://standardjs.com)
[heex_formatter](https://github.com/feliperenan/heex_formatter)
## Docs ## Docs
@ -109,7 +108,7 @@ In `dev` mode, Cannery will listen for these environment variables at runtime.
Defaults to `false`. Defaults to `false`.
- `POOL_SIZE`: Controls the pool size to use with PostgreSQL. Defaults to `10`. - `POOL_SIZE`: Controls the pool size to use with PostgreSQL. Defaults to `10`.
- `REGISTRATION`: Controls if user sign-up should be invite only or set to public. Set to `public` to enable public registration. Defaults to `invite`. - `REGISTRATION`: Controls if user sign-up should be invite only or set to public. Set to `public` to enable public registration. Defaults to `invite`.
- `LOCALE`: Sets a custom locale. Defaults to `en_US`. - `LOCALE`: Sets a custom default locale. Defaults to `en_US`.
- Available options: `en_US`, `de`, and `fr` - Available options: `en_US`, `de`, and `fr`
## `MIX_ENV=test` ## `MIX_ENV=test`

View File

@ -63,7 +63,7 @@ You can use the following environment variables to configure Cannery in
with `docker run -it shibaobun/cannery mix phx.gen.secret` and set for server to start. with `docker run -it shibaobun/cannery mix phx.gen.secret` and set for server to start.
- `REGISTRATION`: Controls if user sign-up should be invite only or set to - `REGISTRATION`: Controls if user sign-up should be invite only or set to
public. Set to `public` to enable public registration. Defaults to `invite`. public. Set to `public` to enable public registration. Defaults to `invite`.
- `LOCALE`: Sets a custom locale. Defaults to `en_US` - `LOCALE`: Sets a custom default locale. Defaults to `en_US`
- Available options: `en_US`, `de`, and `fr` - Available options: `en_US`, `de`, and `fr`
- `SMTP_HOST`: The url for your SMTP email provider. Must be set - `SMTP_HOST`: The url for your SMTP email provider. Must be set
- `SMTP_PORT`: The port for your SMTP relay. Defaults to `587`. - `SMTP_PORT`: The port for your SMTP relay. Defaults to `587`.

View File

@ -4,6 +4,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "assets",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
@ -40,7 +41,7 @@
} }
}, },
"../deps/phoenix": { "../deps/phoenix": {
"version": "1.6.6", "version": "1.6.7",
"integrity": "sha512-KLNHVlrZH8UAoEzeCS1XBI9z5juWz0gZ/+No7j5p/byVINnd+del9H5vtBMzQgZa3ZcUjVVZcQR8bKdnH/FmMg==", "integrity": "sha512-KLNHVlrZH8UAoEzeCS1XBI9z5juWz0gZ/+No7j5p/byVINnd+del9H5vtBMzQgZa3ZcUjVVZcQR8bKdnH/FmMg==",
"license": "MIT" "license": "MIT"
}, },
@ -49,7 +50,7 @@
"integrity": "sha512-zv7PIZk0MPkF0ax8n465Q6w86+sGAy5cTem6KcbkUbdgxGc0y3WZmzkM2bSlYdSGbLEZfjXxos1G72xXsha6xA==" "integrity": "sha512-zv7PIZk0MPkF0ax8n465Q6w86+sGAy5cTem6KcbkUbdgxGc0y3WZmzkM2bSlYdSGbLEZfjXxos1G72xXsha6xA=="
}, },
"../deps/phoenix_live_view": { "../deps/phoenix_live_view": {
"version": "0.17.6", "version": "0.17.9",
"integrity": "sha512-2C/Gq+QaBp4h/ZVHhzHqIoVsVShJfZkGAHlR4dtjXM5yZA313sghfaf8a48T/xLHF3j/ObPR/xajmNO856sCsw==", "integrity": "sha512-2C/Gq+QaBp4h/ZVHhzHqIoVsVShJfZkGAHlR4dtjXM5yZA313sghfaf8a48T/xLHF3j/ObPR/xajmNO856sCsw==",
"license": "MIT" "license": "MIT"
}, },
@ -2617,9 +2618,9 @@
} }
}, },
"node_modules/async": { "node_modules/async": {
"version": "2.6.3", "version": "2.6.4",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lodash": "^4.17.14" "lodash": "^4.17.14"
@ -7606,9 +7607,9 @@
} }
}, },
"node_modules/minimist": { "node_modules/minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
"dev": true "dev": true
}, },
"node_modules/minimist-options": { "node_modules/minimist-options": {
@ -7813,9 +7814,9 @@
} }
}, },
"node_modules/node-forge": { "node_modules/node-forge": {
"version": "1.2.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
"integrity": "sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w==", "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 6.13.0" "node": ">= 6.13.0"
@ -14689,9 +14690,9 @@
"dev": true "dev": true
}, },
"async": { "async": {
"version": "2.6.3", "version": "2.6.4",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lodash": "^4.17.14" "lodash": "^4.17.14"
@ -18453,9 +18454,9 @@
} }
}, },
"minimist": { "minimist": {
"version": "1.2.5", "version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
"dev": true "dev": true
}, },
"minimist-options": { "minimist-options": {
@ -18613,9 +18614,9 @@
} }
}, },
"node-forge": { "node-forge": {
"version": "1.2.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
"integrity": "sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w==", "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
"dev": true "dev": true
}, },
"node-gyp": { "node-gyp": {

View File

@ -269,6 +269,35 @@ defmodule Cannery.Accounts do
end end
end end
@doc """
Returns an `%Changeset{}` for changing the user locale.
## Examples
iex> change_user_locale(user)
%Changeset{data: %User{}}
"""
@spec change_user_locale(User.t()) :: Changeset.t(User.t())
def change_user_locale(%{locale: locale} = user), do: User.locale_changeset(user, locale)
@doc """
Updates the user locale.
## Examples
iex> update_user_locale(user, "valid locale")
{:ok, %User{}}
iex> update_user_password(user, "invalid locale")
{:error, %Changeset{}}
"""
@spec update_user_locale(User.t(), locale :: String.t()) ::
{:ok, User.t()} | {:error, Changeset.t(User.t())}
def update_user_locale(user, locale),
do: user |> User.locale_changeset(locale) |> Repo.update()
@doc """ @doc """
Deletes a user. must be performed by an admin or the same user! Deletes a user. must be performed by an admin or the same user!

View File

@ -18,6 +18,7 @@ defmodule Cannery.Accounts.User do
field :hashed_password, :string field :hashed_password, :string
field :confirmed_at, :naive_datetime field :confirmed_at, :naive_datetime
field :role, Ecto.Enum, values: [:admin, :user], default: :user field :role, Ecto.Enum, values: [:admin, :user], default: :user
field :locale, :string
has_many :invites, Invite, on_delete: :delete_all has_many :invites, Invite, on_delete: :delete_all
@ -31,6 +32,7 @@ defmodule Cannery.Accounts.User do
hashed_password: String.t(), hashed_password: String.t(),
confirmed_at: NaiveDateTime.t(), confirmed_at: NaiveDateTime.t(),
role: atom(), role: atom(),
locale: String.t() | nil,
invites: [Invite.t()], invites: [Invite.t()],
inserted_at: NaiveDateTime.t(), inserted_at: NaiveDateTime.t(),
updated_at: NaiveDateTime.t() updated_at: NaiveDateTime.t()
@ -60,7 +62,7 @@ defmodule Cannery.Accounts.User do
Changeset.t(t() | new_user()) Changeset.t(t() | new_user())
def registration_changeset(user, attrs, opts \\ []) do def registration_changeset(user, attrs, opts \\ []) do
user user
|> cast(attrs, [:email, :password, :role]) |> cast(attrs, [:email, :password, :role, :locale])
|> validate_email() |> validate_email()
|> validate_password(opts) |> validate_password(opts)
end end
@ -185,4 +187,14 @@ defmodule Cannery.Accounts.User do
do: changeset, do: changeset,
else: changeset |> add_error(:current_password, dgettext("errors", "is not valid")) else: changeset |> add_error(:current_password, dgettext("errors", "is not valid"))
end end
@doc """
A changeset for changing the user's locale
"""
@spec locale_changeset(t() | Changeset.t(t()), locale :: String.t() | nil) :: Changeset.t(t())
def locale_changeset(user_or_changeset, locale) do
user_or_changeset
|> cast(%{"locale" => locale}, [:locale])
|> validate_required(:locale)
end
end end

View File

@ -47,6 +47,7 @@ defmodule CanneryWeb do
use Phoenix.LiveView, use Phoenix.LiveView,
layout: {CanneryWeb.LayoutView, "live.html"} layout: {CanneryWeb.LayoutView, "live.html"}
on_mount CanneryWeb.InitAssigns
unquote(view_helpers()) unquote(view_helpers())
end end
end end

View File

@ -37,6 +37,11 @@ defmodule CanneryWeb.Components.AmmoGroupCard do
</span> </span>
<% end %> <% end %>
<span class="rounded-lg title text-lg">
<%= gettext("Added on:") %>
<%= @ammo_group.inserted_at |> display_datetime() %>
</span>
<%= 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">
<%= gettext("Price paid:") %> <%= gettext("Price paid:") %>

View File

@ -18,12 +18,18 @@ defmodule CanneryWeb.Components.UserCard do
</h1> </h1>
<h3 class="px-4 py-2 rounded-lg title text-lg"> <h3 class="px-4 py-2 rounded-lg title text-lg">
<%= if @user.confirmed_at |> is_nil() do %> <p>
Email unconfirmed <%= if @user.confirmed_at |> is_nil() do %>
<% else %> Email unconfirmed
<p>User was confirmed at</p> <% else %>
<%= @user.confirmed_at |> display_datetime() %> User was confirmed at <%= @user.confirmed_at |> display_datetime() %>
<% end %> <% end %>
</p>
<p>
<%= gettext("User registered on") %>
<%= @user.inserted_at |> display_datetime() %>
</p>
</h3> </h3>
<%= if @inner_block do %> <%= if @inner_block do %>

View File

@ -10,10 +10,11 @@ defmodule CanneryWeb.UserSettingsController do
render(conn, "edit.html", page_title: gettext("Settings")) render(conn, "edit.html", page_title: gettext("Settings"))
end end
def update(conn, %{"action" => "update_email"} = params) do def update(%{assigns: %{current_user: user}} = conn, %{
%{"current_password" => password, "user" => user_params} = params "action" => "update_email",
user = conn.assigns.current_user "current_password" => password,
"user" => user_params
}) do
case Accounts.apply_user_email(user, password, user_params) do case Accounts.apply_user_email(user, password, user_params) do
{:ok, applied_user} -> {:ok, applied_user} ->
Accounts.deliver_update_email_instructions( Accounts.deliver_update_email_instructions(
@ -33,14 +34,15 @@ defmodule CanneryWeb.UserSettingsController do
|> redirect(to: Routes.user_settings_path(conn, :edit)) |> redirect(to: Routes.user_settings_path(conn, :edit))
{:error, changeset} -> {:error, changeset} ->
render(conn, "edit.html", email_changeset: changeset) conn |> render("edit.html", email_changeset: changeset)
end end
end end
def update(conn, %{"action" => "update_password"} = params) do def update(%{assigns: %{current_user: user}} = conn, %{
%{"current_password" => password, "user" => user_params} = params "action" => "update_password",
user = conn.assigns.current_user "current_password" => password,
"user" => user_params
}) do
case Accounts.update_user_password(user, password, user_params) do case Accounts.update_user_password(user, password, user_params) do
{:ok, user} -> {:ok, user} ->
conn conn
@ -49,12 +51,27 @@ defmodule CanneryWeb.UserSettingsController do
|> UserAuth.log_in_user(user) |> UserAuth.log_in_user(user)
{:error, changeset} -> {:error, changeset} ->
render(conn, "edit.html", password_changeset: changeset) conn |> render("edit.html", password_changeset: changeset)
end end
end end
def confirm_email(conn, %{"token" => token}) do def update(
case Accounts.update_user_email(conn.assigns.current_user, token) do %{assigns: %{current_user: user}} = conn,
%{"action" => "update_locale", "user" => %{"locale" => locale}}
) do
case Accounts.update_user_locale(user, locale) do
{:ok, _user} ->
conn
|> put_flash(:info, dgettext("prompts", "Language updated successfully."))
|> redirect(to: Routes.user_settings_path(conn, :edit))
{:error, changeset} ->
conn |> render("edit.html", locale_changeset: changeset)
end
end
def confirm_email(%{assigns: %{current_user: user}} = conn, %{"token" => token}) do
case Accounts.update_user_email(user, token) do
:ok -> :ok ->
conn conn
|> put_flash(:info, dgettext("prompts", "Email changed successfully.")) |> put_flash(:info, dgettext("prompts", "Email changed successfully."))
@ -84,11 +101,10 @@ defmodule CanneryWeb.UserSettingsController do
end end
end end
defp assign_email_and_password_changesets(conn, _opts) do defp assign_email_and_password_changesets(%{assigns: %{current_user: user}} = conn, _opts) do
user = conn.assigns.current_user
conn conn
|> assign(:email_changeset, Accounts.change_user_email(user)) |> assign(:email_changeset, Accounts.change_user_email(user))
|> assign(:password_changeset, Accounts.change_user_password(user)) |> assign(:password_changeset, Accounts.change_user_password(user))
|> assign(:locale_changeset, Accounts.change_user_locale(user))
end end
end end

View File

@ -8,8 +8,8 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
alias CanneryWeb.Endpoint alias CanneryWeb.Endpoint
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket) do
{:ok, socket |> assign_defaults(session) |> display_ammo_groups()} {:ok, socket |> display_ammo_groups()}
end end
@impl true @impl true
@ -83,6 +83,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
%{label: gettext("% left"), key: "remaining"}, %{label: gettext("% left"), key: "remaining"},
%{label: gettext("Range"), key: "range"}, %{label: gettext("Range"), key: "range"},
%{label: gettext("Container"), key: "container"}, %{label: gettext("Container"), key: "container"},
%{label: gettext("Added on"), key: "added_on"},
%{label: nil, key: "actions", sortable: false} %{label: nil, key: "actions", sortable: false}
] ]
@ -116,6 +117,15 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
defp get_value_for_key("price_paid", %{price_paid: price_paid}), defp get_value_for_key("price_paid", %{price_paid: price_paid}),
do: gettext("$%{amount}", amount: price_paid |> :erlang.float_to_binary(decimals: 2)) do: gettext("$%{amount}", amount: price_paid |> :erlang.float_to_binary(decimals: 2))
defp get_value_for_key("added_on", %{inserted_at: inserted_at}) do
assigns = %{inserted_at: inserted_at}
{inserted_at,
~H"""
<%= @inserted_at |> display_datetime() %>
"""}
end
defp get_value_for_key("range", %{staged: staged} = ammo_group) do defp get_value_for_key("range", %{staged: staged} = ammo_group) do
assigns = %{ammo_group: ammo_group} assigns = %{ammo_group: ammo_group}

View File

@ -10,9 +10,7 @@ defmodule CanneryWeb.AmmoGroupLive.Show do
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket), do: {:ok, socket}
{:ok, socket |> assign_defaults(session)}
end
@impl true @impl true
def handle_params( def handle_params(

View File

@ -26,6 +26,11 @@
</span> </span>
<% end %> <% end %>
<span class="rounded-lg title text-lg">
<%= gettext("Added on:") %>
<%= @ammo_group.inserted_at |> display_datetime() %>
</span>
<%= 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">
<%= gettext("Original cost:") %> <%= gettext("Original cost:") %>

View File

@ -9,8 +9,8 @@ defmodule CanneryWeb.AmmoTypeLive.Index do
alias CanneryWeb.Endpoint alias CanneryWeb.Endpoint
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket) do
{:ok, socket |> assign_defaults(session) |> list_ammo_types()} {:ok, socket |> list_ammo_types()}
end end
@impl true @impl true

View File

@ -9,9 +9,7 @@ defmodule CanneryWeb.AmmoTypeLive.Show do
alias CanneryWeb.Endpoint alias CanneryWeb.Endpoint
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket), do: {:ok, socket}
{:ok, socket |> assign_defaults(session)}
end
@impl true @impl true
def handle_params(%{"id" => id}, _params, %{assigns: %{current_user: current_user}} = socket) do def handle_params(%{"id" => id}, _params, %{assigns: %{current_user: current_user}} = socket) do

View File

@ -87,6 +87,14 @@
<%= @ammo_type |> Ammo.get_used_count_for_ammo_type(@current_user) %> <%= @ammo_type |> Ammo.get_used_count_for_ammo_type(@current_user) %>
</span> </span>
<h3 class="title text-lg">
<%= gettext("Added on:") %>
</h3>
<span class="text-primary-600">
<%= @ammo_type.inserted_at |> display_datetime() %>
</span>
<%= if @avg_cost_per_round do %> <%= if @avg_cost_per_round do %>
<h3 class="title text-lg"> <h3 class="title text-lg">
<%= gettext("Average Price paid") %>: <%= gettext("Average Price paid") %>:

View File

@ -10,9 +10,7 @@ defmodule CanneryWeb.ContainerLive.Index do
alias Ecto.Changeset alias Ecto.Changeset
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket), do: {:ok, socket}
{:ok, socket |> assign_defaults(session)}
end
@impl true @impl true
def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do

View File

@ -11,9 +11,7 @@ defmodule CanneryWeb.ContainerLive.Show do
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket), do: {:ok, socket}
{:ok, socket |> assign_defaults(session)}
end
@impl true @impl true
def handle_params( def handle_params(

View File

@ -7,14 +7,9 @@ defmodule CanneryWeb.HomeLive do
alias Cannery.Accounts alias Cannery.Accounts
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket) do
admins = Accounts.list_users_by_role(:admin) admins = Accounts.list_users_by_role(:admin)
socket = socket |> assign(page_title: "Home", query: "", results: %{}, admins: admins)
socket =
socket
|> assign_defaults(session)
|> assign(page_title: "Home", query: "", results: %{}, admins: admins)
{:ok, socket} {:ok, socket}
end end
@ -131,11 +126,47 @@ defmodule CanneryWeb.HomeLive do
to: "https://gitea.bubbletea.dev/shibao/cannery/src/branch/stable/CHANGELOG.md", to: "https://gitea.bubbletea.dev/shibao/cannery/src/branch/stable/CHANGELOG.md",
target: "_blank", target: "_blank",
rel: "noopener noreferrer" do %> rel: "noopener noreferrer" do %>
<p>0.5.1</p> <p>0.5.2</p>
<i class="fas fa-md fa-info-circle"></i> <i class="fas fa-md fa-info-circle"></i>
<% end %> <% end %>
</li> </li>
</ul> </ul>
<hr class="hr" />
<ul class="flex flex-col space-y-2 text-center justify-center">
<h2 class="title text-primary-600 text-lg">
<%= gettext("Get involved!") %>
</h2>
<li class="flex flex-col justify-center space-x-2">
<%= link class: "flex flex-row justify-center items-center space-x-2 hover:underline",
to: "https://gitea.bubbletea.dev/shibao/cannery",
target: "_blank",
rel: "noopener noreferrer" do %>
<p><%= gettext("View the source code") %></p>
<i class="fas fa-md fa-code"></i>
<% end %>
</li>
<li class="flex flex-col justify-center space-x-2">
<%= link class: "flex flex-row justify-center items-center space-x-2 hover:underline",
to: "https://weblate.bubbletea.dev/engage/cannery",
target: "_blank",
rel: "noopener noreferrer" do %>
<p><%= gettext("Help translate") %></p>
<i class="fas fa-md fa-language"></i>
<% end %>
</li>
<li class="flex flex-col justify-center space-x-2">
<%= link class: "flex flex-row justify-center items-center space-x-2 hover:underline",
to: "https://gitea.bubbletea.dev/shibao/cannery/issues/new",
target: "_blank",
rel: "noopener noreferrer" do %>
<p><%= gettext("Report bugs or request features") %></p>
<i class="fas fa-md fa-spider"></i>
<% end %>
</li>
</ul>
</div> </div>
""" """
end end

View File

@ -0,0 +1,19 @@
defmodule CanneryWeb.InitAssigns do
@moduledoc """
Ensures common `assigns` are applied to all LiveViews attaching this hook.
"""
import Phoenix.LiveView
alias Cannery.Accounts
def on_mount(:default, _params, %{"locale" => locale, "user_token" => user_token}, socket) do
Gettext.put_locale(locale)
socket =
socket
|> assign_new(:current_user, fn -> Accounts.get_user_by_session_token(user_token) end)
{:cont, socket}
end
def on_mount(:default, _params, _session, socket), do: {:cont, socket}
end

View File

@ -10,9 +10,7 @@ defmodule CanneryWeb.InviteLive.Index do
alias Phoenix.LiveView.JS alias Phoenix.LiveView.JS
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, %{assigns: %{current_user: current_user}} = socket) do
%{assigns: %{current_user: current_user}} = socket = socket |> assign_defaults(session)
socket = socket =
if current_user |> Map.get(:role) == :admin do if current_user |> Map.get(:role) == :admin do
socket |> display_invites() socket |> display_invites()

View File

@ -3,20 +3,9 @@ defmodule CanneryWeb.LiveHelpers do
Contains common helper functions for liveviews Contains common helper functions for liveviews
""" """
import Phoenix.LiveView
import Phoenix.LiveView.Helpers import Phoenix.LiveView.Helpers
alias Cannery.Accounts
alias Phoenix.LiveView.JS alias Phoenix.LiveView.JS
def assign_defaults(socket, %{"user_token" => user_token} = _session) do
socket
|> assign_new(:current_user, fn -> Accounts.get_user_by_session_token(user_token) end)
end
def assign_defaults(socket, _session) do
socket
end
@doc """ @doc """
Renders a live component inside a modal. Renders a live component inside a modal.

View File

@ -10,9 +10,7 @@ defmodule CanneryWeb.RangeLive.Index do
alias Phoenix.LiveView.Socket alias Phoenix.LiveView.Socket
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket), do: {:ok, socket |> display_shot_groups()}
{:ok, socket |> assign_defaults(session) |> display_shot_groups()}
end
@impl true @impl true
def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do

View File

@ -9,9 +9,7 @@ defmodule CanneryWeb.TagLive.Index do
alias CanneryWeb.Endpoint alias CanneryWeb.Endpoint
@impl true @impl true
def mount(_params, session, socket) do def mount(_params, _session, socket), do: {:ok, socket |> display_tags()}
{:ok, socket |> assign_defaults(session) |> display_tags()}
end
@impl true @impl true
def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do def handle_params(params, _url, %{assigns: %{live_action: live_action}} = socket) do

View File

@ -11,8 +11,17 @@ defmodule CanneryWeb.Router do
plug :protect_from_forgery plug :protect_from_forgery
plug :put_secure_browser_headers plug :put_secure_browser_headers
plug :fetch_current_user plug :fetch_current_user
plug :put_user_locale, default: Application.get_env(:gettext, :default_locale, "en_US")
end
Gettext.put_locale(Application.get_env(:gettext, :default_locale, "en_US")) defp put_user_locale(%{assigns: %{current_user: %{locale: locale}}} = conn, default: default) do
Gettext.put_locale(locale || default)
conn |> put_session(:locale, locale || default)
end
defp put_user_locale(conn, default: default) do
Gettext.put_locale(default)
conn |> put_session(:locale, default)
end end
pipeline :require_admin do pipeline :require_admin do

View File

@ -30,6 +30,15 @@
<%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %> <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
<%= error_tag(f, :password, "col-span-3") %> <%= error_tag(f, :password, "col-span-3") %>
<%= label(f, :locale, gettext("Language"), class: "title text-lg text-primary-600") %>
<%= select(
f,
:locale,
[{gettext("English"), "en_US"}, {gettext("German"), "de"}, {gettext("French"), "fr"}],
class: "input input-primary col-span-2"
) %>
<%= error_tag(f, :locale) %>
<%= submit(dgettext("actions", "Register"), class: "mx-auto btn btn-primary col-span-3") %> <%= submit(dgettext("actions", "Register"), class: "mx-auto btn btn-primary col-span-3") %>
<% end %> <% end %>

View File

@ -1,17 +1,16 @@
<div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center space-y-4"> <div class="mx-auto mb-8 max-w-2xl flex flex-col justify-center items-center text-center space-y-4">
<h1 class="pb-4 title text-primary-600 text-xl"> <h1 class="pb-4 title text-primary-600 text-xl">
<%= gettext("Settings") %> <%= gettext("Settings") %>
</h1> </h1>
<hr class="hr" /> <hr class="hr" />
<%= form_for @email_changeset, <.form
Routes.user_settings_path(@conn, :update), let={f}
[ for={@email_changeset}
class: action={Routes.user_settings_path(@conn, :update)}
"flex flex-col space-y-4 sm:space-y-0 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"
], >
fn f -> %>
<h3 class="title text-primary-600 text-lg col-span-3"> <h3 class="title text-primary-600 text-lg col-span-3">
<%= dgettext("actions", "Change email") %> <%= dgettext("actions", "Change email") %>
</h3> </h3>
@ -45,17 +44,16 @@
<%= submit(dgettext("actions", "Change email"), <%= submit(dgettext("actions", "Change email"),
class: "mx-auto btn btn-primary col-span-3" class: "mx-auto btn btn-primary col-span-3"
) %> ) %>
<% end %> </.form>
<hr class="hr" /> <hr class="hr" />
<%= form_for @password_changeset, <.form
Routes.user_settings_path(@conn, :update), let={f}
[ for={@password_changeset}
class: action={Routes.user_settings_path(@conn, :update)}
"flex flex-col space-y-4 sm:space-y-0 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"
], >
fn f -> %>
<h3 class="title text-primary-600 text-lg col-span-3"> <h3 class="title text-primary-600 text-lg col-span-3">
<%= dgettext("actions", "Change password") %> <%= dgettext("actions", "Change password") %>
</h3> </h3>
@ -101,7 +99,43 @@
<%= submit(dgettext("actions", "Change password"), <%= submit(dgettext("actions", "Change password"),
class: "mx-auto btn btn-primary col-span-3" class: "mx-auto btn btn-primary col-span-3"
) %> ) %>
<% end %> </.form>
<hr class="hr" />
<.form
let={f}
for={@locale_changeset}
action={Routes.user_settings_path(@conn, :update)}
class="flex flex-col space-y-4 justify-center items-center"
>
<h3 class="title text-primary-600 text-lg">
<%= dgettext("actions", "Change Language") %>
</h3>
<%= if @locale_changeset.action && not @locale_changeset.valid? do %>
<div class="alert alert-danger">
<p>
<%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
</p>
</div>
<% end %>
<%= hidden_input(f, :action, name: "action", value: "update_locale") %>
<%= select(
f,
:locale,
[{gettext("English"), "en_US"}, {gettext("German"), "de"}, {gettext("French"), "fr"}],
class: "mx-2 my-1 min-w-md input input-primary"
) %>
<%= error_tag(f, :locale) %>
<%= submit(dgettext("actions", "Change language"),
class: "whitespace-nowrap mx-auto btn btn-primary",
data: [qa: dgettext("prompts", "Are you sure you want to change your language?")]
) %>
</.form>
<hr class="hr" /> <hr class="hr" />

View File

@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
def project do def project do
[ [
app: :cannery, app: :cannery,
version: "0.5.1", version: "0.5.2",
elixir: "1.13.4", elixir: "1.13.4",
elixirc_paths: elixirc_paths(Mix.env()), elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:gettext] ++ Mix.compilers(), compilers: [:gettext] ++ Mix.compilers(),
@ -13,6 +13,7 @@ defmodule Cannery.MixProject do
deps: deps(), deps: deps(),
dialyzer: [plt_add_apps: [:ex_unit]], dialyzer: [plt_add_apps: [:ex_unit]],
consolidate_protocols: Mix.env() not in [:dev, :test], consolidate_protocols: Mix.env() not in [:dev, :test],
preferred_cli_env: [test: :test],
# ExDoc # ExDoc
name: "Cannery", name: "Cannery",
source_url: "https://gitea.bubbletea.dev/shibao/cannery", source_url: "https://gitea.bubbletea.dev/shibao/cannery",
@ -91,6 +92,7 @@ defmodule Cannery.MixProject do
"dialyzer", "dialyzer",
"credo --strict", "credo --strict",
"format --check-formatted", "format --check-formatted",
"ecto.drop --quiet",
"ecto.create --quiet", "ecto.create --quiet",
"ecto.migrate --quiet", "ecto.migrate --quiet",
"test" "test"

View File

@ -31,14 +31,14 @@ msgid "Add your first type!"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:16 #: lib/cannery_web/templates/user_settings/edit.html.heex:15
#: lib/cannery_web/templates/user_settings/edit.html.heex:45 #: lib/cannery_web/templates/user_settings/edit.html.heex:44
msgid "Change email" msgid "Change email"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:60 #: lib/cannery_web/templates/user_settings/edit.html.heex:58
#: lib/cannery_web/templates/user_settings/edit.html.heex:101 #: lib/cannery_web/templates/user_settings/edit.html.heex:99
msgid "Change password" msgid "Change password"
msgstr "" msgstr ""
@ -48,12 +48,12 @@ msgid "Create Invite"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:108 #: lib/cannery_web/templates/user_settings/edit.html.heex:142
msgid "Delete User" msgid "Delete User"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_registration/new.html.heex:43 #: lib/cannery_web/templates/user_registration/new.html.heex:52
#: lib/cannery_web/templates/user_reset_password/new.html.heex:3 #: lib/cannery_web/templates/user_reset_password/new.html.heex:3
#: lib/cannery_web/templates/user_session/new.html.heex:45 #: lib/cannery_web/templates/user_session/new.html.heex:45
msgid "Forgot your password?" msgid "Forgot your password?"
@ -67,7 +67,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:106 #: lib/cannery_web/components/topbar.ex:106
#: lib/cannery_web/templates/user_confirmation/new.html.heex:30 #: lib/cannery_web/templates/user_confirmation/new.html.heex:30
#: lib/cannery_web/templates/user_registration/new.html.heex:39 #: lib/cannery_web/templates/user_registration/new.html.heex:48
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:48 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:48
#: lib/cannery_web/templates/user_reset_password/new.html.heex:30 #: lib/cannery_web/templates/user_reset_password/new.html.heex:30
#: lib/cannery_web/templates/user_session/new.html.heex:3 #: lib/cannery_web/templates/user_session/new.html.heex:3
@ -104,7 +104,7 @@ msgstr ""
#: lib/cannery_web/components/topbar.ex:99 #: lib/cannery_web/components/topbar.ex:99
#: lib/cannery_web/templates/user_confirmation/new.html.heex:25 #: lib/cannery_web/templates/user_confirmation/new.html.heex:25
#: lib/cannery_web/templates/user_registration/new.html.heex:3 #: lib/cannery_web/templates/user_registration/new.html.heex:3
#: lib/cannery_web/templates/user_registration/new.html.heex:33 #: lib/cannery_web/templates/user_registration/new.html.heex:42
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:43 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:43
#: lib/cannery_web/templates/user_reset_password/new.html.heex:25 #: lib/cannery_web/templates/user_reset_password/new.html.heex:25
#: lib/cannery_web/templates/user_session/new.html.heex:40 #: lib/cannery_web/templates/user_session/new.html.heex:40
@ -160,14 +160,14 @@ msgid "Why not get some ready to shoot?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:134 #: lib/cannery_web/live/ammo_group_live/index.ex:144
#: lib/cannery_web/live/ammo_group_live/show.html.heex:86 #: lib/cannery_web/live/ammo_group_live/show.html.heex:91
#: lib/cannery_web/live/range_live/index.html.heex:36 #: lib/cannery_web/live/range_live/index.html.heex:36
msgid "Record shots" msgid "Record shots"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:50 #: lib/cannery_web/live/ammo_group_live/show.html.heex:55
msgid "Ammo Details" msgid "Ammo Details"
msgstr "" msgstr ""
@ -177,7 +177,7 @@ msgid "Add another container!"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:80 #: lib/cannery_web/live/ammo_group_live/show.html.heex:85
msgid "Move containers" msgid "Move containers"
msgstr "" msgstr ""
@ -201,3 +201,13 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:66 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:66
msgid "Create" msgid "Create"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:113
msgid "Change Language"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:134
msgid "Change language"
msgstr ""

View File

@ -11,12 +11,12 @@ msgid ""
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:61 #: lib/cannery_web/live/home_live.ex:56
msgid "%{name} lets you easily keep an eye on your ammo levels before and after range day" msgid "%{name} lets you easily keep an eye on your ammo levels before and after range day"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:83 #: lib/cannery_web/live/home_live.ex:78
msgid "Access from any internet-capable device" msgid "Access from any internet-capable device"
msgstr "" msgstr ""
@ -26,14 +26,14 @@ msgid "Admins"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:97 #: lib/cannery_web/live/home_live.ex:92
msgid "Admins:" msgid "Admins:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:50 #: lib/cannery_web/components/topbar.ex:50
#: lib/cannery_web/live/ammo_group_live/index.html.heex:3 #: lib/cannery_web/live/ammo_group_live/index.html.heex:3
#: lib/cannery_web/live/range_live/index.ex:82 #: lib/cannery_web/live/range_live/index.ex:80
msgid "Ammo" msgid "Ammo"
msgstr "" msgstr ""
@ -45,7 +45,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:87 #: lib/cannery_web/live/ammo_type_live/index.ex:87
#: lib/cannery_web/live/ammo_type_live/show.html.heex:92 #: lib/cannery_web/live/ammo_type_live/show.html.heex:100
msgid "Average Price paid" msgid "Average Price paid"
msgstr "" msgstr ""
@ -110,7 +110,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:44 #: lib/cannery_web/components/topbar.ex:44
#: lib/cannery_web/live/container_live/index.ex:38 #: lib/cannery_web/live/container_live/index.ex:36
#: lib/cannery_web/live/container_live/index.html.heex:3 #: lib/cannery_web/live/container_live/index.html.heex:3
msgid "Containers" msgid "Containers"
msgstr "" msgstr ""
@ -152,29 +152,29 @@ msgid "Disable"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:58 #: lib/cannery_web/live/home_live.ex:53
msgid "Easy to Use:" msgid "Easy to Use:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:38 #: lib/cannery_web/live/ammo_group_live/index.ex:38
#: lib/cannery_web/live/ammo_group_live/show.ex:42 #: lib/cannery_web/live/ammo_group_live/show.ex:40
msgid "Edit Ammo group" msgid "Edit Ammo group"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:23 #: lib/cannery_web/live/ammo_type_live/index.ex:23
#: lib/cannery_web/live/ammo_type_live/show.ex:47 #: lib/cannery_web/live/ammo_type_live/show.ex:45
msgid "Edit Ammo type" msgid "Edit Ammo type"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:35 #: lib/cannery_web/live/invite_live/index.ex:33
msgid "Edit Invite" msgid "Edit Invite"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/index.ex:23 #: lib/cannery_web/live/tag_live/index.ex:21
msgid "Edit Tag" msgid "Edit Tag"
msgstr "" msgstr ""
@ -208,7 +208,7 @@ msgid "Incendiary"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:92 #: lib/cannery_web/live/home_live.ex:87
msgid "Instance Information" msgid "Instance Information"
msgstr "" msgstr ""
@ -218,13 +218,13 @@ msgid "Invite Disabled"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:123 #: lib/cannery_web/live/home_live.ex:118
msgid "Invite Only" msgid "Invite Only"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:69 #: lib/cannery_web/components/topbar.ex:69
#: lib/cannery_web/live/invite_live/index.ex:43 #: lib/cannery_web/live/invite_live/index.ex:41
#: lib/cannery_web/live/invite_live/index.html.heex:3 #: lib/cannery_web/live/invite_live/index.html.heex:3
msgid "Invites" msgid "Invites"
msgstr "" msgstr ""
@ -288,17 +288,17 @@ msgid "New Ammo type"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:33 #: lib/cannery_web/live/container_live/index.ex:31
msgid "New Container" msgid "New Container"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:39 #: lib/cannery_web/live/invite_live/index.ex:37
msgid "New Invite" msgid "New Invite"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/tag_live/index.ex:29 #: lib/cannery_web/live/tag_live/index.ex:27
msgid "New Tag" msgid "New Tag"
msgstr "" msgstr ""
@ -313,7 +313,7 @@ msgid "No Ammo Types"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:112 #: lib/cannery_web/live/ammo_type_live/show.html.heex:120
msgid "No ammo for this type" msgid "No ammo for this type"
msgstr "" msgstr ""
@ -341,9 +341,9 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/add_shot_group_component.html.heex:30 #: lib/cannery_web/components/add_shot_group_component.html.heex:30
#: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41 #: lib/cannery_web/live/ammo_group_live/form_component.html.heex:41
#: lib/cannery_web/live/ammo_group_live/show.ex:90 #: lib/cannery_web/live/ammo_group_live/show.ex:88
#: lib/cannery_web/live/range_live/form_component.html.heex:29 #: lib/cannery_web/live/range_live/form_component.html.heex:29
#: lib/cannery_web/live/range_live/index.ex:84 #: lib/cannery_web/live/range_live/index.ex:82
msgid "Notes" msgid "Notes"
msgstr "" msgstr ""
@ -372,7 +372,7 @@ msgid "Price paid"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:42 #: lib/cannery_web/components/ammo_group_card.ex:47
msgid "Price paid:" msgid "Price paid:"
msgstr "" msgstr ""
@ -384,17 +384,17 @@ msgid "Primer type"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:122 #: lib/cannery_web/live/home_live.ex:117
msgid "Public Signups" msgid "Public Signups"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:70 #: lib/cannery_web/live/home_live.ex:65
msgid "Secure:" msgid "Secure:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:73 #: lib/cannery_web/live/home_live.ex:68
msgid "Self-host your own instance, or use an instance from someone you trust." msgid "Self-host your own instance, or use an instance from someone you trust."
msgstr "" msgstr ""
@ -410,17 +410,17 @@ msgid "Settings"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.ex:41 #: lib/cannery_web/live/ammo_group_live/show.ex:39
msgid "Show Ammo group" msgid "Show Ammo group"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.ex:46 #: lib/cannery_web/live/ammo_type_live/show.ex:44
msgid "Show Ammo type" msgid "Show Ammo type"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:80 #: lib/cannery_web/live/home_live.ex:75
msgid "Simple:" msgid "Simple:"
msgstr "" msgstr ""
@ -430,13 +430,13 @@ msgid "Steel"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:98 #: lib/cannery_web/live/ammo_group_live/show.html.heex:103
msgid "Stored in" msgid "Stored in"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/topbar.ex:38 #: lib/cannery_web/components/topbar.ex:38
#: lib/cannery_web/live/tag_live/index.ex:34 #: lib/cannery_web/live/tag_live/index.ex:32
#: lib/cannery_web/live/tag_live/index.html.heex:3 #: lib/cannery_web/live/tag_live/index.html.heex:3
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
@ -452,12 +452,12 @@ msgid "Text color"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:49 #: lib/cannery_web/live/home_live.ex:44
msgid "The self-hosted firearm tracker website" msgid "The self-hosted firearm tracker website"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:103 #: lib/cannery_web/live/ammo_group_live/show.html.heex:108
msgid "This ammo group is not in a container" msgid "This ammo group is not in a container"
msgstr "" msgstr ""
@ -496,12 +496,12 @@ msgid "Uses left"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:45 #: lib/cannery_web/live/home_live.ex:40
msgid "Welcome to %{name}" msgid "Welcome to %{name}"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:74 #: lib/cannery_web/live/home_live.ex:69
msgid "Your data stays with you, period" msgid "Your data stays with you, period"
msgstr "" msgstr ""
@ -522,8 +522,8 @@ msgid "Range day"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.ex:91 #: lib/cannery_web/live/ammo_group_live/show.ex:89
#: lib/cannery_web/live/range_live/index.ex:85 #: lib/cannery_web/live/range_live/index.ex:83
msgid "Date" msgid "Date"
msgstr "" msgstr ""
@ -538,13 +538,13 @@ msgid "No ammo staged"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:77 #: lib/cannery_web/live/ammo_group_live/show.html.heex:82
#: lib/cannery_web/live/range_live/index.html.heex:33 #: lib/cannery_web/live/range_live/index.html.heex:33
msgid "Stage for range" msgid "Stage for range"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:76 #: lib/cannery_web/live/ammo_group_live/show.html.heex:81
#: lib/cannery_web/live/range_live/index.html.heex:32 #: lib/cannery_web/live/range_live/index.html.heex:32
msgid "Unstage from range" msgid "Unstage from range"
msgstr "" msgstr ""
@ -572,13 +572,13 @@ msgid "Date (UTC)"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.ex:39 #: lib/cannery_web/live/ammo_group_live/show.ex:37
#: lib/cannery_web/live/range_live/index.ex:34 #: lib/cannery_web/live/range_live/index.ex:32
msgid "Edit Shot Records" msgid "Edit Shot Records"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/range_live/index.ex:40 #: lib/cannery_web/live/range_live/index.ex:38
msgid "New Shot Records" msgid "New Shot Records"
msgstr "" msgstr ""
@ -593,19 +593,19 @@ msgid "Rounds left"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.ex:89 #: lib/cannery_web/live/ammo_group_live/show.ex:87
#: lib/cannery_web/live/range_live/index.ex:83 #: lib/cannery_web/live/range_live/index.ex:81
msgid "Rounds shot" msgid "Rounds shot"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/range_live/index.ex:46 #: lib/cannery_web/live/range_live/index.ex:44
msgid "Shot Records" msgid "Shot Records"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:32 #: lib/cannery_web/live/ammo_group_live/index.ex:32
#: lib/cannery_web/live/ammo_group_live/show.ex:40 #: lib/cannery_web/live/ammo_group_live/show.ex:38
msgid "Move Ammo group" msgid "Move Ammo group"
msgstr "" msgstr ""
@ -625,12 +625,12 @@ msgid "Shot log"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:43 #: lib/cannery_web/components/ammo_group_card.ex:48
#: lib/cannery_web/live/ammo_group_live/index.ex:117 #: lib/cannery_web/live/ammo_group_live/index.ex:118
#: lib/cannery_web/live/ammo_group_live/show.html.heex:32 #: lib/cannery_web/live/ammo_group_live/show.html.heex:37
#: lib/cannery_web/live/ammo_group_live/show.html.heex:39 #: lib/cannery_web/live/ammo_group_live/show.html.heex:44
#: lib/cannery_web/live/ammo_type_live/index.ex:114 #: lib/cannery_web/live/ammo_type_live/index.ex:114
#: lib/cannery_web/live/ammo_type_live/show.html.heex:96 #: lib/cannery_web/live/ammo_type_live/show.html.heex:104
msgid "$%{amount}" msgid "$%{amount}"
msgstr "" msgstr ""
@ -675,28 +675,28 @@ msgid "UPC"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:80 #: lib/cannery_web/templates/user_settings/edit.html.heex:78
msgid "Confirm new password" msgid "Confirm new password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:33 #: lib/cannery_web/templates/user_settings/edit.html.heex:32
#: lib/cannery_web/templates/user_settings/edit.html.heex:89 #: lib/cannery_web/templates/user_settings/edit.html.heex:87
msgid "Current password" msgid "Current password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:73 #: lib/cannery_web/templates/user_settings/edit.html.heex:71
msgid "New password" msgid "New password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:131 #: lib/cannery_web/live/ammo_group_live/index.ex:141
msgid "Stage" msgid "Stage"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:131 #: lib/cannery_web/live/ammo_group_live/index.ex:141
msgid "Unstage" msgid "Unstage"
msgstr "" msgstr ""
@ -718,14 +718,14 @@ msgid "Loading..."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:29 #: lib/cannery_web/live/container_live/index.ex:27
#: lib/cannery_web/live/container_live/show.ex:97 #: lib/cannery_web/live/container_live/show.ex:95
msgid "Edit %{name}" msgid "Edit %{name}"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:48 #: lib/cannery_web/live/container_live/index.ex:46
#: lib/cannery_web/live/container_live/show.ex:98 #: lib/cannery_web/live/container_live/show.ex:96
msgid "Edit %{name} tags" msgid "Edit %{name} tags"
msgstr "" msgstr ""
@ -735,13 +735,13 @@ msgid "Rounds:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.ex:96 #: lib/cannery_web/live/container_live/show.ex:94
msgid "Show %{name}" msgid "Show %{name}"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:113 #: lib/cannery_web/live/ammo_type_live/index.ex:113
#: lib/cannery_web/live/ammo_type_live/show.html.heex:102 #: lib/cannery_web/live/ammo_type_live/show.html.heex:110
msgid "No cost information" msgid "No cost information"
msgstr "" msgstr ""
@ -751,12 +751,12 @@ msgid "% left"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:38 #: lib/cannery_web/live/ammo_group_live/show.html.heex:43
msgid "Current value:" msgid "Current value:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:31 #: lib/cannery_web/live/ammo_group_live/show.html.heex:36
msgid "Original cost:" msgid "Original cost:"
msgstr "" msgstr ""
@ -771,7 +771,7 @@ msgid "Percentage left:"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.html.heex:111 #: lib/cannery_web/live/ammo_group_live/show.html.heex:116
msgid "Rounds used" msgid "Rounds used"
msgstr "" msgstr ""
@ -816,8 +816,8 @@ msgid "Reset your password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.ex:38 #: lib/cannery_web/live/ammo_group_live/show.ex:36
#: lib/cannery_web/live/range_live/index.ex:28 #: lib/cannery_web/live/range_live/index.ex:26
msgid "Record Shots" msgid "Record Shots"
msgstr "" msgstr ""
@ -830,3 +830,63 @@ msgstr ""
#: lib/cannery_web/live/ammo_type_live/index.ex:34 #: lib/cannery_web/live/ammo_type_live/index.ex:34
msgid "Ammo types" msgid "Ammo types"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:86
msgid "Added on"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/ammo_group_card.ex:41
#: lib/cannery_web/live/ammo_group_live/show.html.heex:30
#: lib/cannery_web/live/ammo_type_live/show.html.heex:91
msgid "Added on:"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/user_card.ex:30
msgid "User registered on"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_registration/new.html.heex:37
#: lib/cannery_web/templates/user_settings/edit.html.heex:129
msgid "English"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_registration/new.html.heex:37
#: lib/cannery_web/templates/user_settings/edit.html.heex:129
msgid "French"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_registration/new.html.heex:37
#: lib/cannery_web/templates/user_settings/edit.html.heex:129
msgid "German"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_registration/new.html.heex:33
msgid "Language"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:139
msgid "Get involved!"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:156
msgid "Help translate"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:165
msgid "Report bugs or request features"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:147
msgid "View the source code"
msgstr ""

View File

@ -16,18 +16,18 @@ msgid "Container must be empty before deleting"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:71 #: lib/cannery_web/live/container_live/index.ex:69
#: lib/cannery_web/live/container_live/show.ex:73 #: lib/cannery_web/live/container_live/show.ex:71
msgid "Could not delete %{name}: %{error}" msgid "Could not delete %{name}: %{error}"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:59 #: lib/cannery_web/live/container_live/index.ex:57
msgid "Could not find that container" msgid "Could not find that container"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/controllers/user_settings_controller.ex:67 #: lib/cannery_web/controllers/user_settings_controller.ex:84
msgid "Email change link is invalid or it has expired." msgid "Email change link is invalid or it has expired."
msgstr "" msgstr ""
@ -59,8 +59,9 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_registration/new.html.heex:16 #: lib/cannery_web/templates/user_registration/new.html.heex:16
#: lib/cannery_web/templates/user_reset_password/edit.html.heex:16 #: lib/cannery_web/templates/user_reset_password/edit.html.heex:16
#: lib/cannery_web/templates/user_settings/edit.html.heex:22 #: lib/cannery_web/templates/user_settings/edit.html.heex:21
#: lib/cannery_web/templates/user_settings/edit.html.heex:66 #: lib/cannery_web/templates/user_settings/edit.html.heex:64
#: lib/cannery_web/templates/user_settings/edit.html.heex:119
msgid "Oops, something went wrong! Please check the errors below." msgid "Oops, something went wrong! Please check the errors below."
msgstr "" msgstr ""
@ -82,7 +83,7 @@ msgid "Sorry, this invite was not found or expired"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/controllers/user_settings_controller.ex:82 #: lib/cannery_web/controllers/user_settings_controller.ex:99
msgid "Unable to delete user" msgid "Unable to delete user"
msgstr "" msgstr ""
@ -97,7 +98,7 @@ msgid "User confirmation link is invalid or it has expired."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:20 #: lib/cannery_web/live/invite_live/index.ex:18
msgid "You are not authorized to view this page" msgid "You are not authorized to view this page"
msgstr "" msgstr ""
@ -107,22 +108,22 @@ msgid "You are not authorized to view this page."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery/accounts/user.ex:128 #: lib/cannery/accounts/user.ex:130
msgid "did not change" msgid "did not change"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery/accounts/user.ex:149 #: lib/cannery/accounts/user.ex:151
msgid "does not match password" msgid "does not match password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery/accounts/user.ex:186 #: lib/cannery/accounts/user.ex:188
msgid "is not valid" msgid "is not valid"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery/accounts/user.ex:82 #: lib/cannery/accounts/user.ex:84
msgid "must have the @ sign and no spaces" msgid "must have the @ sign and no spaces"
msgstr "" msgstr ""

View File

@ -20,31 +20,31 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/index.ex:41 #: lib/cannery_web/live/ammo_type_live/index.ex:41
#: lib/cannery_web/live/ammo_type_live/show.ex:40 #: lib/cannery_web/live/ammo_type_live/show.ex:38
#: lib/cannery_web/live/invite_live/index.ex:55 #: lib/cannery_web/live/invite_live/index.ex:53
#: lib/cannery_web/live/invite_live/index.ex:135 #: lib/cannery_web/live/invite_live/index.ex:133
#: lib/cannery_web/live/tag_live/index.ex:40 #: lib/cannery_web/live/tag_live/index.ex:38
msgid "%{name} deleted succesfully" msgid "%{name} deleted succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:111 #: lib/cannery_web/live/invite_live/index.ex:109
msgid "%{name} disabled succesfully" msgid "%{name} disabled succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:89 #: lib/cannery_web/live/invite_live/index.ex:87
msgid "%{name} enabled succesfully" msgid "%{name} enabled succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/index.ex:64 #: lib/cannery_web/live/container_live/index.ex:62
#: lib/cannery_web/live/container_live/show.ex:63 #: lib/cannery_web/live/container_live/show.ex:61
msgid "%{name} has been deleted" msgid "%{name} has been deleted"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:69 #: lib/cannery_web/live/invite_live/index.ex:67
msgid "%{name} updated succesfully" msgid "%{name} updated succesfully"
msgstr "" msgstr ""
@ -57,13 +57,13 @@ msgid "%{name} updated successfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/controllers/user_settings_controller.ex:28 #: lib/cannery_web/controllers/user_settings_controller.ex:29
msgid "A link to confirm your email change has been sent to the new address." msgid "A link to confirm your email change has been sent to the new address."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:56 #: lib/cannery_web/live/ammo_group_live/index.ex:56
#: lib/cannery_web/live/ammo_group_live/show.ex:52 #: lib/cannery_web/live/ammo_group_live/show.ex:50
msgid "Ammo group deleted succesfully" msgid "Ammo group deleted succesfully"
msgstr "" msgstr ""
@ -92,14 +92,14 @@ msgid "Are you sure you want to delete the invite for %{name}?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/index.ex:167 #: lib/cannery_web/live/ammo_group_live/index.ex:177
#: lib/cannery_web/live/ammo_group_live/show.html.heex:66 #: lib/cannery_web/live/ammo_group_live/show.html.heex:71
#: lib/cannery_web/live/ammo_type_live/index.ex:140 #: lib/cannery_web/live/ammo_type_live/index.ex:140
msgid "Are you sure you want to delete this ammo?" msgid "Are you sure you want to delete this ammo?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:112 #: lib/cannery_web/templates/user_settings/edit.html.heex:146
msgid "Are you sure you want to delete your account?" msgid "Are you sure you want to delete your account?"
msgstr "" msgstr ""
@ -114,7 +114,7 @@ msgid "Are you sure you want to make %{name} unlimited?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/controllers/user_settings_controller.ex:60 #: lib/cannery_web/controllers/user_settings_controller.ex:77
msgid "Email changed successfully." msgid "Email changed successfully."
msgstr "" msgstr ""
@ -139,7 +139,7 @@ msgid "Password reset successfully."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/controllers/user_settings_controller.ex:47 #: lib/cannery_web/controllers/user_settings_controller.ex:49
msgid "Password updated successfully." msgid "Password updated successfully."
msgstr "" msgstr ""
@ -149,7 +149,7 @@ msgid "Please check your email to verify your account"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/home_live.ex:101 #: lib/cannery_web/live/home_live.ex:96
msgid "Register to setup %{name}" msgid "Register to setup %{name}"
msgstr "" msgstr ""
@ -165,7 +165,7 @@ msgid "Saving..."
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/controllers/user_settings_controller.ex:78 #: lib/cannery_web/controllers/user_settings_controller.ex:95
msgid "Your account has been deleted" msgid "Your account has been deleted"
msgstr "" msgstr ""
@ -180,7 +180,7 @@ msgid "%{name} added successfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.ex:39 #: lib/cannery_web/live/container_live/show.ex:37
msgid "%{tag_name} has been removed from %{container_name}" msgid "%{tag_name} has been removed from %{container_name}"
msgstr "" msgstr ""
@ -200,19 +200,19 @@ msgid "Are you sure you want to unstage this ammo?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/range_live/index.ex:70 #: lib/cannery_web/live/range_live/index.ex:68
msgid "Ammo group unstaged succesfully" msgid "Ammo group unstaged succesfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.ex:132 #: lib/cannery_web/live/ammo_group_live/show.ex:130
#: lib/cannery_web/live/range_live/index.ex:130 #: lib/cannery_web/live/range_live/index.ex:128
msgid "Are you sure you want to delete this shot record?" msgid "Are you sure you want to delete this shot record?"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_group_live/show.ex:80 #: lib/cannery_web/live/ammo_group_live/show.ex:78
#: lib/cannery_web/live/range_live/index.ex:56 #: lib/cannery_web/live/range_live/index.ex:54
msgid "Shot records deleted succesfully" msgid "Shot records deleted succesfully"
msgstr "" msgstr ""
@ -232,7 +232,7 @@ msgid "Ammo moved to %{name} successfully"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/invite_live/index.ex:123 #: lib/cannery_web/live/invite_live/index.ex:121
msgid "Copied to clipboard" msgid "Copied to clipboard"
msgstr "" msgstr ""
@ -258,3 +258,13 @@ msgid "Ammo group created successfully"
msgid_plural "Ammo groups created successfully" msgid_plural "Ammo groups created successfully"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/templates/user_settings/edit.html.heex:136
msgid "Are you sure you want to change your language?"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/controllers/user_settings_controller.ex:65
msgid "Language updated successfully."
msgstr ""

View File

@ -0,0 +1,9 @@
defmodule Cannery.Repo.Migrations.AddLocaleSetting do
use Ecto.Migration
def change do
alter table("users") do
add :locale, :string
end
end
end