Compare commits

..

No commits in common. "5fd46c326f1297b74485177deefe4da981353e8d" and "11b1ae9980358d9e8d8d2a9cdd1c4bea2a973c5d" have entirely different histories.

21 changed files with 29 additions and 94 deletions

View File

@ -1,8 +1,7 @@
# v0.5.4 # v0.5.4
- Rename "Ammo" tab to "Catalog", and "Manage" tab is now "Ammo" - Rename "Ammo" tab to "Catalog", and "Manage" tab is now "Ammo"
- Ammo groups are now just referred to as Ammo or "Packs" - Ammo groups are now just referred to as Ammo
- URL paths now reflect new names - URL paths now reflect new names
- Add pack and round count to container information
# v0.5.3 # v0.5.3
- Update French translation: Thank you [duponin](https://udongein.xyz/users/duponin)! - Update French translation: Thank you [duponin](https://udongein.xyz/users/duponin)!

View File

@ -207,18 +207,6 @@ defmodule Cannery.Containers do
if count == 0, do: raise("could not delete container tag"), else: count if count == 0, do: raise("could not delete container tag"), else: count
end 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 """ @doc """
Returns number of rounds in container. If data is already preloaded, then Returns number of rounds in container. If data is already preloaded, then
there will be no db hit. there will be no db hit.

View File

@ -45,12 +45,7 @@ defmodule CanneryWeb.Components.ContainerCard do
</span> </span>
<% end %> <% end %>
<%= unless @container.ammo_groups |> Enum.empty?() do %> <%= if @container.ammo_groups 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"> <span class="rounded-lg title text-lg">
<%= gettext("Rounds:") %> <%= gettext("Rounds:") %>
<%= @container |> Containers.get_container_rounds!() %> <%= @container |> Containers.get_container_rounds!() %>

View File

@ -22,18 +22,6 @@
</span> </span>
<% end %> <% 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"> <div class="flex space-x-4 justify-center items-center text-primary-600">
<%= live_patch to: Routes.container_show_path(Endpoint, :edit, @container), <%= live_patch to: Routes.container_show_path(Endpoint, :edit, @container),
class: "text-primary-600 link", class: "text-primary-600 link",

View File

@ -126,7 +126,7 @@ 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.4</p> <p>0.5.3</p>
<i class="fas fa-md fa-info-circle"></i> <i class="fas fa-md fa-info-circle"></i>
<% end %> <% end %>
</li> </li>

View File

@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
def project do def project do
[ [
app: :cannery, app: :cannery,
version: "0.5.4", version: "0.5.3",
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(),

View File

@ -136,7 +136,7 @@ msgid "Send instructions to reset password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:65 #: lib/cannery_web/live/container_live/show.html.heex:53
msgid "Why not add one?" msgid "Why not add one?"
msgstr "" msgstr ""

View File

@ -149,7 +149,7 @@ msgid "Send instructions to reset password"
msgstr "Anleitung zum Passwort zurücksetzen zusenden" msgstr "Anleitung zum Passwort zurücksetzen zusenden"
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:65 #: lib/cannery_web/live/container_live/show.html.heex:53
msgid "Why not add one?" msgid "Why not add one?"
msgstr "Warum fügen Sie keine hinzu?" msgstr "Warum fügen Sie keine hinzu?"

View File

@ -502,7 +502,7 @@ msgid "Your data stays with you, period"
msgstr "Ihre Daten bleiben bei Ihnen, Punkt" msgstr "Ihre Daten bleiben bei Ihnen, Punkt"
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:61 #: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container" msgid "No tags for this container"
msgstr "Keine Tags für diesen Behälter" msgstr "Keine Tags für diesen Behälter"
@ -720,8 +720,7 @@ msgid "Edit %{name} tags"
msgstr "Editiere %{name} Tags" msgstr "Editiere %{name} Tags"
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55 #: lib/cannery_web/components/container_card.ex:50
#: lib/cannery_web/live/container_live/show.html.heex:32
msgid "Rounds:" msgid "Rounds:"
msgstr "Patronen:" msgstr "Patronen:"
@ -899,7 +898,7 @@ msgid "Move Ammo"
msgstr "Munition verschieben" msgstr "Munition verschieben"
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/container_live/show.html.heex:90 #: lib/cannery_web/live/container_live/show.html.heex:78
msgid "No ammo in this container" msgid "No ammo in this container"
msgstr "Keine Munitionsgruppe in diesem Behälter" msgstr "Keine Munitionsgruppe in diesem Behälter"
@ -912,9 +911,3 @@ msgstr "Zeige Munitionsarten"
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108 #: lib/cannery_web/live/ammo_group_live/show.html.heex:108
msgid "This ammo is not in a container" msgid "This ammo is not in a container"
msgstr "Diese Munitionsgruppe ist nicht in einem Behälter" 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 ""

View File

@ -90,7 +90,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27 #: 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/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49 #: lib/cannery_web/live/container_live/show.html.heex:37
#: lib/cannery_web/live/tag_live/index.html.heex:38 #: lib/cannery_web/live/tag_live/index.html.heex:38
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?" msgstr "Sind Sie sicher, dass sie %{name} löschen möchten?"

View File

@ -485,7 +485,7 @@ msgid "Your data stays with you, period"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:61 #: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container" msgid "No tags for this container"
msgstr "" msgstr ""
@ -703,8 +703,7 @@ msgid "Edit %{name} tags"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55 #: lib/cannery_web/components/container_card.ex:50
#: lib/cannery_web/live/container_live/show.html.heex:32
msgid "Rounds:" msgid "Rounds:"
msgstr "" msgstr ""
@ -882,7 +881,7 @@ msgid "Move Ammo"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:90 #: lib/cannery_web/live/container_live/show.html.heex:78
msgid "No ammo in this container" msgid "No ammo in this container"
msgstr "" msgstr ""
@ -895,9 +894,3 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108 #: lib/cannery_web/live/ammo_group_live/show.html.heex:108
msgid "This ammo is not in a container" msgid "This ammo is not in a container"
msgstr "" 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 ""

View File

@ -137,7 +137,7 @@ msgid "Send instructions to reset password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:65 #: lib/cannery_web/live/container_live/show.html.heex:53
msgid "Why not add one?" msgid "Why not add one?"
msgstr "" msgstr ""

View File

@ -486,7 +486,7 @@ msgid "Your data stays with you, period"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:61 #: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container" msgid "No tags for this container"
msgstr "" msgstr ""
@ -704,8 +704,7 @@ msgid "Edit %{name} tags"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/components/container_card.ex:55 #: lib/cannery_web/components/container_card.ex:50
#: lib/cannery_web/live/container_live/show.html.heex:32
msgid "Rounds:" msgid "Rounds:"
msgstr "" msgstr ""
@ -883,7 +882,7 @@ msgid "Move Ammo"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/container_live/show.html.heex:90 #: lib/cannery_web/live/container_live/show.html.heex:78
msgid "No ammo in this container" msgid "No ammo in this container"
msgstr "" msgstr ""
@ -896,9 +895,3 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108 #: lib/cannery_web/live/ammo_group_live/show.html.heex:108
msgid "This ammo is not in a container" msgid "This ammo is not in a container"
msgstr "" 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 ""

View File

@ -76,7 +76,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27 #: 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/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49 #: lib/cannery_web/live/container_live/show.html.heex:37
#: lib/cannery_web/live/tag_live/index.html.heex:38 #: lib/cannery_web/live/tag_live/index.html.heex:38
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "" msgstr ""

View File

@ -147,7 +147,7 @@ msgid "Send instructions to reset password"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:65 #: lib/cannery_web/live/container_live/show.html.heex:53
msgid "Why not add one?" msgid "Why not add one?"
msgstr "" msgstr ""

View File

@ -496,7 +496,7 @@ msgid "Your data stays with you, period"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:61 #: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container" msgid "No tags for this container"
msgstr "" msgstr ""
@ -714,8 +714,7 @@ msgid "Edit %{name} tags"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55 #: lib/cannery_web/components/container_card.ex:50
#: lib/cannery_web/live/container_live/show.html.heex:32
msgid "Rounds:" msgid "Rounds:"
msgstr "" msgstr ""
@ -893,7 +892,7 @@ msgid "Move Ammo"
msgstr "" msgstr ""
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/container_live/show.html.heex:90 #: lib/cannery_web/live/container_live/show.html.heex:78
msgid "No ammo in this container" msgid "No ammo in this container"
msgstr "" msgstr ""
@ -906,9 +905,3 @@ msgstr ""
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108 #: lib/cannery_web/live/ammo_group_live/show.html.heex:108
msgid "This ammo is not in a container" msgid "This ammo is not in a container"
msgstr "" 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 ""

View File

@ -86,7 +86,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27 #: 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/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49 #: lib/cannery_web/live/container_live/show.html.heex:37
#: lib/cannery_web/live/tag_live/index.html.heex:38 #: lib/cannery_web/live/tag_live/index.html.heex:38
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "" msgstr ""

View File

@ -149,7 +149,7 @@ msgid "Send instructions to reset password"
msgstr "Envoyer les instructions pour réinitialiser le mot de passe" msgstr "Envoyer les instructions pour réinitialiser le mot de passe"
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:65 #: lib/cannery_web/live/container_live/show.html.heex:53
msgid "Why not add one?" msgid "Why not add one?"
msgstr "Pourquoi pas en ajouter un?" msgstr "Pourquoi pas en ajouter un?"

View File

@ -504,7 +504,7 @@ msgid "Your data stays with you, period"
msgstr "Vos données restent avec vous, point final" msgstr "Vos données restent avec vous, point final"
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/container_live/show.html.heex:61 #: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container" msgid "No tags for this container"
msgstr "Aucun tag pour ce conteneur" msgstr "Aucun tag pour ce conteneur"
@ -722,8 +722,7 @@ msgid "Edit %{name} tags"
msgstr "Éditer les tags de %{name}" msgstr "Éditer les tags de %{name}"
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55 #: lib/cannery_web/components/container_card.ex:50
#: lib/cannery_web/live/container_live/show.html.heex:32
msgid "Rounds:" msgid "Rounds:"
msgstr "Cartouches:" msgstr "Cartouches:"
@ -901,7 +900,7 @@ msgid "Move Ammo"
msgstr "Déplacer munition" msgstr "Déplacer munition"
#, elixir-autogen, elixir-format, fuzzy #, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/live/container_live/show.html.heex:90 #: lib/cannery_web/live/container_live/show.html.heex:78
msgid "No ammo in this container" msgid "No ammo in this container"
msgstr "Aucun groupe de munition pour ce conteneur" msgstr "Aucun groupe de munition pour ce conteneur"
@ -914,9 +913,3 @@ msgstr "Montrer le type de munition"
#: lib/cannery_web/live/ammo_group_live/show.html.heex:108 #: lib/cannery_web/live/ammo_group_live/show.html.heex:108
msgid "This ammo is not in a container" msgid "This ammo is not in a container"
msgstr "Ce groupe de munition nest pas dans un conteneur" msgstr "Ce groupe de munition nest 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 ""

View File

@ -91,7 +91,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27 #: 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/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49 #: lib/cannery_web/live/container_live/show.html.heex:37
#: lib/cannery_web/live/tag_live/index.html.heex:38 #: lib/cannery_web/live/tag_live/index.html.heex:38
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "Êtes-vous certain·e de supprimer %{name}?" msgstr "Êtes-vous certain·e de supprimer %{name}?"

View File

@ -75,7 +75,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
#: lib/cannery_web/live/ammo_type_live/show.html.heex:27 #: 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/index.html.heex:46
#: lib/cannery_web/live/container_live/show.html.heex:49 #: lib/cannery_web/live/container_live/show.html.heex:37
#: lib/cannery_web/live/tag_live/index.html.heex:38 #: lib/cannery_web/live/tag_live/index.html.heex:38
msgid "Are you sure you want to delete %{name}?" msgid "Are you sure you want to delete %{name}?"
msgstr "" msgstr ""