improve container card style

This commit is contained in:
shibao 2022-12-03 21:56:14 -05:00
parent 7a7754767f
commit faacf80b51
14 changed files with 77 additions and 79 deletions

View File

@ -23,7 +23,7 @@ defmodule CanneryWeb.Components.ContainerCard do
~H""" ~H"""
<div <div
id={"container-#{@container.id}"} id={"container-#{@container.id}"}
class="overflow-hidden max-w-full mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center space-y-4 class="overflow-hidden max-w-full mx-4 mb-2 px-8 py-4 flex flex-col justify-center items-center space-y-4
border border-gray-400 rounded-lg shadow-lg hover:shadow-md border border-gray-400 rounded-lg shadow-lg hover:shadow-md
transition-all duration-300 ease-in-out" transition-all duration-300 ease-in-out"
> >

View File

@ -42,65 +42,63 @@
</div> </div>
<% end %> <% end %>
<div class="w-full flex flex-row flex-wrap justify-center items-center"> <%= if @containers |> Enum.empty?() do %>
<%= if @containers |> Enum.empty?() do %> <h2 class="title text-xl text-primary-600">
<h2 class="title text-xl text-primary-600"> <%= gettext("No containers") %>
<%= gettext("No containers") %> <%= display_emoji("😔") %>
<%= display_emoji("😔") %> </h2>
</h2> <% 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}>
<div class="mx-4 my-2">
<.link
patch={Routes.container_index_path(Endpoint, :edit_tags, container)}
class="text-primary-600 link"
>
<i class="fa-fw fa-lg fas fa-tags"></i>
</.link>
</div>
</:tag_actions>
<:actions :let={container}>
<.link
patch={Routes.container_index_path(Endpoint, :edit, container)}
class="text-primary-600 link"
data-qa={"edit-#{container.id}"}
>
<i class="fa-fw fa-lg fas fa-edit"></i>
</.link>
<.link
patch={Routes.container_index_path(Endpoint, :clone, container)}
class="text-primary-600 link"
data-qa={"clone-#{container.id}"}
>
<i class="fa-fw fa-lg fas fa-copy"></i>
</.link>
<.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}"}
>
<i class="fa-fw fa-lg fas fa-trash"></i>
</.link>
</:actions>
</.live_component>
<% else %> <% else %>
<%= if @view_table do %> <div class="w-full flex flex-row flex-wrap justify-center items-stretch">
<.live_component
module={CanneryWeb.Components.ContainerTableComponent}
id="containers_index_table"
action={@live_action}
containers={@containers}
current_user={@current_user}
>
<:tag_actions :let={container}>
<div class="mx-4 my-2">
<.link
patch={Routes.container_index_path(Endpoint, :edit_tags, container)}
class="text-primary-600 link"
>
<i class="fa-fw fa-lg fas fa-tags"></i>
</.link>
</div>
</:tag_actions>
<:actions :let={container}>
<.link
patch={Routes.container_index_path(Endpoint, :edit, container)}
class="text-primary-600 link"
data-qa={"edit-#{container.id}"}
>
<i class="fa-fw fa-lg fas fa-edit"></i>
</.link>
<.link
patch={Routes.container_index_path(Endpoint, :clone, container)}
class="text-primary-600 link"
data-qa={"clone-#{container.id}"}
>
<i class="fa-fw fa-lg fas fa-copy"></i>
</.link>
<.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}"}
>
<i class="fa-fw fa-lg fas fa-trash"></i>
</.link>
</:actions>
</.live_component>
<% else %>
<%= for container <- @containers do %> <%= for container <- @containers do %>
<.container_card container={container}> <.container_card container={container}>
<:tag_actions> <:tag_actions>
@ -145,9 +143,9 @@
</.link> </.link>
</.container_card> </.container_card>
<% end %> <% end %>
<% end %> </div>
<% end %> <% end %>
</div> <% end %>
</div> </div>
<%= if @live_action in [:new, :edit, :clone] do %> <%= if @live_action in [:new, :edit, :clone] do %>

View File

@ -294,7 +294,7 @@ msgid "No ammo for this type"
msgstr "Keine Munition dieser Art" msgstr "Keine Munition dieser Art"
#: lib/cannery_web/live/container_live/index.html.heex:8 #: 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 #, elixir-autogen, elixir-format
msgid "No containers" msgid "No containers"
msgstr "Kein Behälter" msgstr "Kein Behälter"

View File

@ -82,8 +82,8 @@ msgstr ""
"Sind Sie sicher, dass sie %{email} löschen möchten? Dies kann nicht " "Sind Sie sicher, dass sie %{email} löschen möchten? Dies kann nicht "
"zurückgenommen werden!" "zurückgenommen werden!"
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:92
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:136
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:64 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -279,7 +279,7 @@ msgid "No ammo for this type"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:8 #: 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 #, elixir-autogen, elixir-format
msgid "No containers" msgid "No containers"
msgstr "" msgstr ""

View File

@ -280,7 +280,7 @@ msgid "No ammo for this type"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:8 #: 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 #, elixir-autogen, elixir-format
msgid "No containers" msgid "No containers"
msgstr "" msgstr ""

View File

@ -68,8 +68,8 @@ msgstr ""
msgid "Are you sure you want to delete %{email}? This action is permanent!" msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:92
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:136
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:64 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -294,7 +294,7 @@ msgid "No ammo for this type"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:8 #: 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 #, elixir-autogen, elixir-format
msgid "No containers" msgid "No containers"
msgstr "" msgstr ""

View File

@ -82,8 +82,8 @@ msgstr ""
msgid "Are you sure you want to delete %{email}? This action is permanent!" 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!" 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:92
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:136
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:64 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -294,7 +294,7 @@ msgid "No ammo for this type"
msgstr "Aucune munition pour ce 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: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 #, elixir-autogen, elixir-format
msgid "No containers" msgid "No containers"
msgstr "Aucun conteneur" msgstr "Aucun conteneur"

View File

@ -83,8 +83,8 @@ msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr "" msgstr ""
"Êtes-vous certain·e de supprimer %{email}? Cette action est définitive!" "Ê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:92
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:136
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:64 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -290,7 +290,7 @@ msgid "No ammo for this type"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:8 #: 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 #, elixir-autogen, elixir-format
msgid "No containers" msgid "No containers"
msgstr "" msgstr ""

View File

@ -78,8 +78,8 @@ msgstr ""
msgid "Are you sure you want to delete %{email}? This action is permanent!" msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:92
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:136
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:64 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View File

@ -67,8 +67,8 @@ msgstr ""
msgid "Are you sure you want to delete %{email}? This action is permanent!" msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr "" msgstr ""
#: lib/cannery_web/live/container_live/index.html.heex:93 #: lib/cannery_web/live/container_live/index.html.heex:92
#: lib/cannery_web/live/container_live/index.html.heex:138 #: lib/cannery_web/live/container_live/index.html.heex:136
#: lib/cannery_web/live/container_live/show.html.heex:59 #: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:64 #: lib/cannery_web/live/tag_live/index.html.heex:64
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format