From faacf80b513f91bee8bc8e0bff3f48da1216579c Mon Sep 17 00:00:00 2001 From: shibao Date: Sat, 3 Dec 2022 21:56:14 -0500 Subject: [PATCH] improve container card style --- lib/cannery_web/components/container_card.ex | 2 +- .../live/container_live/index.html.heex | 118 +++++++++--------- priv/gettext/de/LC_MESSAGES/default.po | 2 +- priv/gettext/de/LC_MESSAGES/prompts.po | 4 +- priv/gettext/default.pot | 2 +- priv/gettext/en/LC_MESSAGES/default.po | 2 +- priv/gettext/en/LC_MESSAGES/prompts.po | 4 +- priv/gettext/es/LC_MESSAGES/default.po | 2 +- priv/gettext/es/LC_MESSAGES/prompts.po | 4 +- priv/gettext/fr/LC_MESSAGES/default.po | 2 +- priv/gettext/fr/LC_MESSAGES/prompts.po | 4 +- priv/gettext/ga/LC_MESSAGES/default.po | 2 +- priv/gettext/ga/LC_MESSAGES/prompts.po | 4 +- priv/gettext/prompts.pot | 4 +- 14 files changed, 77 insertions(+), 79 deletions(-) diff --git a/lib/cannery_web/components/container_card.ex b/lib/cannery_web/components/container_card.ex index d810e21f..e9b5c1ac 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 ee3972ed..380cf563 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 ca3ea160..97585990 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 d77a8f56..1c772c4a 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 98eca4d5..437dab8d 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 5630e08f..a0effe66 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 70ef8b31..b4eb254d 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 d892bd74..28349490 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 e4a8c1ff..85c4d377 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 84de8908..c93eaf59 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 db271048..5ea7abfc 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 1f9cfd9d..469d0b3e 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 bf861615..e970824e 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 bf281510..1dc50da7 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