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
- 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
- Add pack and round count to container information
# v0.5.3
- 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
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.

View File

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

View File

@ -22,18 +22,6 @@
</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",

View File

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

View File

@ -4,7 +4,7 @@ defmodule Cannery.MixProject do
def project do
[
app: :cannery,
version: "0.5.4",
version: "0.5.3",
elixir: "1.13.4",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:gettext] ++ Mix.compilers(),

View File

@ -136,7 +136,7 @@ msgid "Send instructions to reset password"
msgstr ""
#, 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?"
msgstr ""

View File

@ -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:65
#: lib/cannery_web/live/container_live/show.html.heex:53
msgid "Why not add one?"
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"
#, 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"
msgstr "Keine Tags für diesen Behälter"
@ -720,8 +720,7 @@ msgid "Edit %{name} tags"
msgstr "Editiere %{name} Tags"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55
#: lib/cannery_web/live/container_live/show.html.heex:32
#: lib/cannery_web/components/container_card.ex:50
msgid "Rounds:"
msgstr "Patronen:"
@ -899,7 +898,7 @@ msgid "Move Ammo"
msgstr "Munition verschieben"
#, 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"
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
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 ""

View File

@ -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:49
#: lib/cannery_web/live/container_live/show.html.heex:37
#: 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?"

View File

@ -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:61
#: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container"
msgstr ""
@ -703,8 +703,7 @@ msgid "Edit %{name} tags"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55
#: lib/cannery_web/live/container_live/show.html.heex:32
#: lib/cannery_web/components/container_card.ex:50
msgid "Rounds:"
msgstr ""
@ -882,7 +881,7 @@ msgid "Move Ammo"
msgstr ""
#, 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"
msgstr ""
@ -895,9 +894,3 @@ 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 ""

View File

@ -137,7 +137,7 @@ msgid "Send instructions to reset password"
msgstr ""
#, 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?"
msgstr ""

View File

@ -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:61
#: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container"
msgstr ""
@ -704,8 +704,7 @@ msgid "Edit %{name} tags"
msgstr ""
#, elixir-autogen, elixir-format, fuzzy
#: lib/cannery_web/components/container_card.ex:55
#: lib/cannery_web/live/container_live/show.html.heex:32
#: lib/cannery_web/components/container_card.ex:50
msgid "Rounds:"
msgstr ""
@ -883,7 +882,7 @@ msgid "Move Ammo"
msgstr ""
#, 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"
msgstr ""
@ -896,9 +895,3 @@ 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 ""

View File

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

View File

@ -147,7 +147,7 @@ msgid "Send instructions to reset password"
msgstr ""
#, 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?"
msgstr ""

View File

@ -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:61
#: lib/cannery_web/live/container_live/show.html.heex:49
msgid "No tags for this container"
msgstr ""
@ -714,8 +714,7 @@ msgid "Edit %{name} tags"
msgstr ""
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55
#: lib/cannery_web/live/container_live/show.html.heex:32
#: lib/cannery_web/components/container_card.ex:50
msgid "Rounds:"
msgstr ""
@ -893,7 +892,7 @@ msgid "Move Ammo"
msgstr ""
#, 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"
msgstr ""
@ -906,9 +905,3 @@ 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 ""

View File

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

View File

@ -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:65
#: lib/cannery_web/live/container_live/show.html.heex:53
msgid "Why not add one?"
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"
#, 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"
msgstr "Aucun tag pour ce conteneur"
@ -722,8 +722,7 @@ msgid "Edit %{name} tags"
msgstr "Éditer les tags de %{name}"
#, elixir-autogen, elixir-format
#: lib/cannery_web/components/container_card.ex:55
#: lib/cannery_web/live/container_live/show.html.heex:32
#: lib/cannery_web/components/container_card.ex:50
msgid "Rounds:"
msgstr "Cartouches:"
@ -901,7 +900,7 @@ msgid "Move Ammo"
msgstr "Déplacer munition"
#, 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"
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
msgid "This ammo is not in a container"
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
#: 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:49
#: lib/cannery_web/live/container_live/show.html.heex:37
#: 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}?"

View File

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