Compare commits
3 Commits
11b1ae9980
...
5fd46c326f
Author | SHA1 | Date | |
---|---|---|---|
5fd46c326f | |||
8c62a39c97 | |||
9a1a104c6d |
@ -1,7 +1,8 @@
|
||||
# v0.5.4
|
||||
- Rename "Ammo" tab to "Catalog", and "Manage" tab is now "Ammo"
|
||||
- Ammo groups are now just referred to as Ammo
|
||||
- Ammo groups are now just referred to as Ammo or "Packs"
|
||||
- URL paths now reflect new names
|
||||
- Add pack and round count to container information
|
||||
|
||||
# v0.5.3
|
||||
- Update French translation: Thank you [duponin](https://udongein.xyz/users/duponin)!
|
||||
|
@ -207,6 +207,18 @@ defmodule Cannery.Containers do
|
||||
if count == 0, do: raise("could not delete container tag"), else: count
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns number of rounds in container. If data is already preloaded, then
|
||||
there will be no db hit.
|
||||
"""
|
||||
@spec get_container_ammo_group_count!(Container.t()) :: non_neg_integer()
|
||||
def get_container_ammo_group_count!(%Container{} = container) do
|
||||
container
|
||||
|> Repo.preload(:ammo_groups)
|
||||
|> Map.fetch!(:ammo_groups)
|
||||
|> Enum.count()
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns number of rounds in container. If data is already preloaded, then
|
||||
there will be no db hit.
|
||||
|
@ -45,7 +45,12 @@ defmodule CanneryWeb.Components.ContainerCard do
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<%= if @container.ammo_groups do %>
|
||||
<%= unless @container.ammo_groups |> Enum.empty?() do %>
|
||||
<span class="rounded-lg title text-lg">
|
||||
<%= gettext("Packs:") %>
|
||||
<%= @container |> Containers.get_container_ammo_group_count!() %>
|
||||
</span>
|
||||
|
||||
<span class="rounded-lg title text-lg">
|
||||
<%= gettext("Rounds:") %>
|
||||
<%= @container |> Containers.get_container_rounds!() %>
|
||||
|
@ -22,6 +22,18 @@
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<%= unless @container.ammo_groups |> Enum.empty?() do %>
|
||||
<span class="rounded-lg title text-lg">
|
||||
<%= gettext("Packs:") %>
|
||||
<%= @container |> Containers.get_container_ammo_group_count!() %>
|
||||
</span>
|
||||
|
||||
<span class="rounded-lg title text-lg">
|
||||
<%= gettext("Rounds:") %>
|
||||
<%= @container |> Containers.get_container_rounds!() %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<div class="flex space-x-4 justify-center items-center text-primary-600">
|
||||
<%= live_patch to: Routes.container_show_path(Endpoint, :edit, @container),
|
||||
class: "text-primary-600 link",
|
||||
|
@ -126,7 +126,7 @@ defmodule CanneryWeb.HomeLive do
|
||||
to: "https://gitea.bubbletea.dev/shibao/cannery/src/branch/stable/CHANGELOG.md",
|
||||
target: "_blank",
|
||||
rel: "noopener noreferrer" do %>
|
||||
<p>0.5.3</p>
|
||||
<p>0.5.4</p>
|
||||
<i class="fas fa-md fa-info-circle"></i>
|
||||
<% end %>
|
||||
</li>
|
||||
|
2
mix.exs
2
mix.exs
@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
|
||||
def project do
|
||||
[
|
||||
app: :cannery,
|
||||
version: "0.5.3",
|
||||
version: "0.5.4",
|
||||
elixir: "1.13.4",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
compilers: [:gettext] ++ Mix.compilers(),
|
||||
|
@ -136,7 +136,7 @@ msgid "Send instructions to reset password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:53
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:65
|
||||
msgid "Why not add one?"
|
||||
msgstr ""
|
||||
|
||||
|
@ -149,7 +149,7 @@ msgid "Send instructions to reset password"
|
||||
msgstr "Anleitung zum Passwort zurücksetzen zusenden"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:53
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:65
|
||||
msgid "Why not add one?"
|
||||
msgstr "Warum fügen Sie keine hinzu?"
|
||||
|
||||
|
@ -502,7 +502,7 @@ msgid "Your data stays with you, period"
|
||||
msgstr "Ihre Daten bleiben bei Ihnen, Punkt"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:61
|
||||
msgid "No tags for this container"
|
||||
msgstr "Keine Tags für diesen Behälter"
|
||||
|
||||
@ -720,7 +720,8 @@ msgid "Edit %{name} tags"
|
||||
msgstr "Editiere %{name} Tags"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/components/container_card.ex:55
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:32
|
||||
msgid "Rounds:"
|
||||
msgstr "Patronen:"
|
||||
|
||||
@ -898,7 +899,7 @@ msgid "Move Ammo"
|
||||
msgstr "Munition verschieben"
|
||||
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:78
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||
msgid "No ammo in this container"
|
||||
msgstr "Keine Munitionsgruppe in diesem Behälter"
|
||||
|
||||
@ -911,3 +912,9 @@ msgstr "Zeige Munitionsarten"
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
|
||||
msgid "This ammo is not in a container"
|
||||
msgstr "Diese Munitionsgruppe ist nicht in einem Behälter"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:27
|
||||
msgid "Packs:"
|
||||
msgstr ""
|
||||
|
@ -90,7 +90,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
|
||||
#: lib/cannery_web/live/container_live/index.html.heex:46
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:37
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/tag_live/index.html.heex:38
|
||||
msgid "Are you sure you want to delete %{name}?"
|
||||
msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?"
|
||||
|
@ -485,7 +485,7 @@ msgid "Your data stays with you, period"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:61
|
||||
msgid "No tags for this container"
|
||||
msgstr ""
|
||||
|
||||
@ -703,7 +703,8 @@ msgid "Edit %{name} tags"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/components/container_card.ex:55
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:32
|
||||
msgid "Rounds:"
|
||||
msgstr ""
|
||||
|
||||
@ -881,7 +882,7 @@ msgid "Move Ammo"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:78
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||
msgid "No ammo in this container"
|
||||
msgstr ""
|
||||
|
||||
@ -894,3 +895,9 @@ msgstr ""
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
|
||||
msgid "This ammo is not in a container"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:27
|
||||
msgid "Packs:"
|
||||
msgstr ""
|
||||
|
@ -137,7 +137,7 @@ msgid "Send instructions to reset password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:53
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:65
|
||||
msgid "Why not add one?"
|
||||
msgstr ""
|
||||
|
||||
|
@ -486,7 +486,7 @@ msgid "Your data stays with you, period"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:61
|
||||
msgid "No tags for this container"
|
||||
msgstr ""
|
||||
|
||||
@ -704,7 +704,8 @@ msgid "Edit %{name} tags"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/components/container_card.ex:55
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:32
|
||||
msgid "Rounds:"
|
||||
msgstr ""
|
||||
|
||||
@ -882,7 +883,7 @@ msgid "Move Ammo"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:78
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||
msgid "No ammo in this container"
|
||||
msgstr ""
|
||||
|
||||
@ -895,3 +896,9 @@ msgstr ""
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
|
||||
msgid "This ammo is not in a container"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:27
|
||||
msgid "Packs:"
|
||||
msgstr ""
|
||||
|
@ -76,7 +76,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
|
||||
#: lib/cannery_web/live/container_live/index.html.heex:46
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:37
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/tag_live/index.html.heex:38
|
||||
msgid "Are you sure you want to delete %{name}?"
|
||||
msgstr ""
|
||||
|
@ -147,7 +147,7 @@ msgid "Send instructions to reset password"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:53
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:65
|
||||
msgid "Why not add one?"
|
||||
msgstr ""
|
||||
|
||||
|
@ -496,7 +496,7 @@ msgid "Your data stays with you, period"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:61
|
||||
msgid "No tags for this container"
|
||||
msgstr ""
|
||||
|
||||
@ -714,7 +714,8 @@ msgid "Edit %{name} tags"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/components/container_card.ex:55
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:32
|
||||
msgid "Rounds:"
|
||||
msgstr ""
|
||||
|
||||
@ -892,7 +893,7 @@ msgid "Move Ammo"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:78
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||
msgid "No ammo in this container"
|
||||
msgstr ""
|
||||
|
||||
@ -905,3 +906,9 @@ msgstr ""
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
|
||||
msgid "This ammo is not in a container"
|
||||
msgstr ""
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:27
|
||||
msgid "Packs:"
|
||||
msgstr ""
|
||||
|
@ -86,7 +86,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
|
||||
#: lib/cannery_web/live/container_live/index.html.heex:46
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:37
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/tag_live/index.html.heex:38
|
||||
msgid "Are you sure you want to delete %{name}?"
|
||||
msgstr ""
|
||||
|
@ -149,7 +149,7 @@ msgid "Send instructions to reset password"
|
||||
msgstr "Envoyer les instructions pour réinitialiser le mot de passe"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:53
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:65
|
||||
msgid "Why not add one?"
|
||||
msgstr "Pourquoi pas en ajouter un ?"
|
||||
|
||||
|
@ -504,7 +504,7 @@ msgid "Your data stays with you, period"
|
||||
msgstr "Vos données restent avec vous, point final"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:61
|
||||
msgid "No tags for this container"
|
||||
msgstr "Aucun tag pour ce conteneur"
|
||||
|
||||
@ -722,7 +722,8 @@ msgid "Edit %{name} tags"
|
||||
msgstr "Éditer les tags de %{name}"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/components/container_card.ex:55
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:32
|
||||
msgid "Rounds:"
|
||||
msgstr "Cartouches :"
|
||||
|
||||
@ -900,7 +901,7 @@ msgid "Move Ammo"
|
||||
msgstr "Déplacer munition"
|
||||
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:78
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:90
|
||||
msgid "No ammo in this container"
|
||||
msgstr "Aucun groupe de munition pour ce conteneur"
|
||||
|
||||
@ -913,3 +914,9 @@ msgstr "Montrer le type de munition"
|
||||
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108
|
||||
msgid "This ammo is not in a container"
|
||||
msgstr "Ce groupe de munition n’est pas dans un conteneur"
|
||||
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/components/container_card.ex:50
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:27
|
||||
msgid "Packs:"
|
||||
msgstr ""
|
||||
|
@ -91,7 +91,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
|
||||
#: lib/cannery_web/live/container_live/index.html.heex:46
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:37
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/tag_live/index.html.heex:38
|
||||
msgid "Are you sure you want to delete %{name}?"
|
||||
msgstr "Êtes-vous certain·e de supprimer %{name} ?"
|
||||
|
@ -75,7 +75,7 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27
|
||||
#: lib/cannery_web/live/container_live/index.html.heex:46
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:37
|
||||
#: lib/cannery_web/live/container_live/show.html.heex:49
|
||||
#: lib/cannery_web/live/tag_live/index.html.heex:38
|
||||
msgid "Are you sure you want to delete %{name}?"
|
||||
msgstr ""
|
||||
|
Loading…
Reference in New Issue
Block a user