diff --git a/lib/cannery_web/components/container_card.ex b/lib/cannery_web/components/container_card.ex index d810e21..e9b5c1a 100644 --- a/lib/cannery_web/components/container_card.ex +++ b/lib/cannery_web/components/container_card.ex @@ -23,7 +23,7 @@ defmodule CanneryWeb.Components.ContainerCard do ~H"""
diff --git a/lib/cannery_web/live/container_live/index.html.heex b/lib/cannery_web/live/container_live/index.html.heex index ee3972e..380cf56 100644 --- a/lib/cannery_web/live/container_live/index.html.heex +++ b/lib/cannery_web/live/container_live/index.html.heex @@ -42,65 +42,63 @@
<% end %> -
- <%= if @containers |> Enum.empty?() do %> -

- <%= gettext("No containers") %> - <%= display_emoji("😔") %> -

+ <%= if @containers |> Enum.empty?() do %> +

+ <%= gettext("No containers") %> + <%= display_emoji("😔") %> +

+ <% else %> + <%= if @view_table do %> + <.live_component + module={CanneryWeb.Components.ContainerTableComponent} + id="containers_index_table" + action={@live_action} + containers={@containers} + current_user={@current_user} + > + <:tag_actions :let={container}> +
+ <.link + patch={Routes.container_index_path(Endpoint, :edit_tags, container)} + class="text-primary-600 link" + > + + +
+ + <:actions :let={container}> + <.link + patch={Routes.container_index_path(Endpoint, :edit, container)} + class="text-primary-600 link" + data-qa={"edit-#{container.id}"} + > + + + + <.link + patch={Routes.container_index_path(Endpoint, :clone, container)} + class="text-primary-600 link" + data-qa={"clone-#{container.id}"} + > + + + + <.link + href="#" + class="text-primary-600 link" + phx-click="delete" + phx-value-id={container.id} + data-confirm={ + dgettext("prompts", "Are you sure you want to delete %{name}?", name: container.name) + } + data-qa={"delete-#{container.id}"} + > + + + + <% else %> - <%= if @view_table do %> - <.live_component - module={CanneryWeb.Components.ContainerTableComponent} - id="containers_index_table" - action={@live_action} - containers={@containers} - current_user={@current_user} - > - <:tag_actions :let={container}> -
- <.link - patch={Routes.container_index_path(Endpoint, :edit_tags, container)} - class="text-primary-600 link" - > - - -
- - <:actions :let={container}> - <.link - patch={Routes.container_index_path(Endpoint, :edit, container)} - class="text-primary-600 link" - data-qa={"edit-#{container.id}"} - > - - - - <.link - patch={Routes.container_index_path(Endpoint, :clone, container)} - class="text-primary-600 link" - data-qa={"clone-#{container.id}"} - > - - - - <.link - href="#" - class="text-primary-600 link" - phx-click="delete" - phx-value-id={container.id} - data-confirm={ - dgettext("prompts", "Are you sure you want to delete %{name}?", - name: container.name - ) - } - data-qa={"delete-#{container.id}"} - > - - - - - <% else %> +
<%= for container <- @containers do %> <.container_card container={container}> <:tag_actions> @@ -145,9 +143,9 @@ <% end %> - <% end %> +
<% end %> -
+ <% end %> <%= if @live_action in [:new, :edit, :clone] do %> diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index ca3ea16..9758599 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -294,7 +294,7 @@ msgid "No ammo for this type" msgstr "Keine Munition dieser Art" #: lib/cannery_web/live/container_live/index.html.heex:8 -#: lib/cannery_web/live/container_live/index.html.heex:48 +#: lib/cannery_web/live/container_live/index.html.heex:47 #, elixir-autogen, elixir-format msgid "No containers" msgstr "Kein Behälter" diff --git a/priv/gettext/de/LC_MESSAGES/prompts.po b/priv/gettext/de/LC_MESSAGES/prompts.po index d77a8f5..1c772c4 100644 --- a/priv/gettext/de/LC_MESSAGES/prompts.po +++ b/priv/gettext/de/LC_MESSAGES/prompts.po @@ -82,8 +82,8 @@ msgstr "" "Sind Sie sicher, dass sie %{email} löschen möchten? Dies kann nicht " "zurückgenommen werden!" -#: lib/cannery_web/live/container_live/index.html.heex:93 -#: lib/cannery_web/live/container_live/index.html.heex:138 +#: lib/cannery_web/live/container_live/index.html.heex:92 +#: lib/cannery_web/live/container_live/index.html.heex:136 #: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/tag_live/index.html.heex:64 #, elixir-autogen, elixir-format diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 98eca4d..437dab8 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -279,7 +279,7 @@ msgid "No ammo for this type" msgstr "" #: lib/cannery_web/live/container_live/index.html.heex:8 -#: lib/cannery_web/live/container_live/index.html.heex:48 +#: lib/cannery_web/live/container_live/index.html.heex:47 #, elixir-autogen, elixir-format msgid "No containers" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 5630e08..a0effe6 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -280,7 +280,7 @@ msgid "No ammo for this type" msgstr "" #: lib/cannery_web/live/container_live/index.html.heex:8 -#: lib/cannery_web/live/container_live/index.html.heex:48 +#: lib/cannery_web/live/container_live/index.html.heex:47 #, elixir-autogen, elixir-format msgid "No containers" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po index 70ef8b3..b4eb254 100644 --- a/priv/gettext/en/LC_MESSAGES/prompts.po +++ b/priv/gettext/en/LC_MESSAGES/prompts.po @@ -68,8 +68,8 @@ msgstr "" msgid "Are you sure you want to delete %{email}? This action is permanent!" msgstr "" -#: lib/cannery_web/live/container_live/index.html.heex:93 -#: lib/cannery_web/live/container_live/index.html.heex:138 +#: lib/cannery_web/live/container_live/index.html.heex:92 +#: lib/cannery_web/live/container_live/index.html.heex:136 #: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/tag_live/index.html.heex:64 #, elixir-autogen, elixir-format diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po index d892bd7..2834949 100644 --- a/priv/gettext/es/LC_MESSAGES/default.po +++ b/priv/gettext/es/LC_MESSAGES/default.po @@ -294,7 +294,7 @@ msgid "No ammo for this type" msgstr "" #: lib/cannery_web/live/container_live/index.html.heex:8 -#: lib/cannery_web/live/container_live/index.html.heex:48 +#: lib/cannery_web/live/container_live/index.html.heex:47 #, elixir-autogen, elixir-format msgid "No containers" msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/prompts.po b/priv/gettext/es/LC_MESSAGES/prompts.po index e4a8c1f..85c4d37 100644 --- a/priv/gettext/es/LC_MESSAGES/prompts.po +++ b/priv/gettext/es/LC_MESSAGES/prompts.po @@ -82,8 +82,8 @@ msgstr "" msgid "Are you sure you want to delete %{email}? This action is permanent!" msgstr "Está seguro que desea eliminar %{email}? Esta acción es permanente!" -#: lib/cannery_web/live/container_live/index.html.heex:93 -#: lib/cannery_web/live/container_live/index.html.heex:138 +#: lib/cannery_web/live/container_live/index.html.heex:92 +#: lib/cannery_web/live/container_live/index.html.heex:136 #: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/tag_live/index.html.heex:64 #, elixir-autogen, elixir-format diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po index 84de890..c93eaf5 100644 --- a/priv/gettext/fr/LC_MESSAGES/default.po +++ b/priv/gettext/fr/LC_MESSAGES/default.po @@ -294,7 +294,7 @@ msgid "No ammo for this type" msgstr "Aucune munition pour ce type" #: lib/cannery_web/live/container_live/index.html.heex:8 -#: lib/cannery_web/live/container_live/index.html.heex:48 +#: lib/cannery_web/live/container_live/index.html.heex:47 #, elixir-autogen, elixir-format msgid "No containers" msgstr "Aucun conteneur" diff --git a/priv/gettext/fr/LC_MESSAGES/prompts.po b/priv/gettext/fr/LC_MESSAGES/prompts.po index db27104..5ea7abf 100644 --- a/priv/gettext/fr/LC_MESSAGES/prompts.po +++ b/priv/gettext/fr/LC_MESSAGES/prompts.po @@ -83,8 +83,8 @@ msgid "Are you sure you want to delete %{email}? This action is permanent!" msgstr "" "Êtes-vous certain·e de supprimer %{email} ? Cette action est définitive !" -#: lib/cannery_web/live/container_live/index.html.heex:93 -#: lib/cannery_web/live/container_live/index.html.heex:138 +#: lib/cannery_web/live/container_live/index.html.heex:92 +#: lib/cannery_web/live/container_live/index.html.heex:136 #: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/tag_live/index.html.heex:64 #, elixir-autogen, elixir-format diff --git a/priv/gettext/ga/LC_MESSAGES/default.po b/priv/gettext/ga/LC_MESSAGES/default.po index 1f9cfd9..469d0b3 100644 --- a/priv/gettext/ga/LC_MESSAGES/default.po +++ b/priv/gettext/ga/LC_MESSAGES/default.po @@ -290,7 +290,7 @@ msgid "No ammo for this type" msgstr "" #: lib/cannery_web/live/container_live/index.html.heex:8 -#: lib/cannery_web/live/container_live/index.html.heex:48 +#: lib/cannery_web/live/container_live/index.html.heex:47 #, elixir-autogen, elixir-format msgid "No containers" msgstr "" diff --git a/priv/gettext/ga/LC_MESSAGES/prompts.po b/priv/gettext/ga/LC_MESSAGES/prompts.po index bf86161..e970824 100644 --- a/priv/gettext/ga/LC_MESSAGES/prompts.po +++ b/priv/gettext/ga/LC_MESSAGES/prompts.po @@ -78,8 +78,8 @@ msgstr "" msgid "Are you sure you want to delete %{email}? This action is permanent!" msgstr "" -#: lib/cannery_web/live/container_live/index.html.heex:93 -#: lib/cannery_web/live/container_live/index.html.heex:138 +#: lib/cannery_web/live/container_live/index.html.heex:92 +#: lib/cannery_web/live/container_live/index.html.heex:136 #: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/tag_live/index.html.heex:64 #, elixir-autogen, elixir-format diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index bf28151..1dc50da 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -67,8 +67,8 @@ msgstr "" msgid "Are you sure you want to delete %{email}? This action is permanent!" msgstr "" -#: lib/cannery_web/live/container_live/index.html.heex:93 -#: lib/cannery_web/live/container_live/index.html.heex:138 +#: lib/cannery_web/live/container_live/index.html.heex:92 +#: lib/cannery_web/live/container_live/index.html.heex:136 #: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/tag_live/index.html.heex:64 #, elixir-autogen, elixir-format