display link to container in table

This commit is contained in:
shibao 2022-11-19 13:16:55 -05:00
parent fd583f2941
commit 25d4f1916a
8 changed files with 20 additions and 6 deletions

View File

@ -2,6 +2,7 @@
- Fix table component alignment and styling
- Fix toggle button styling
- Miscellanous code improvements
- Improve container index table
# v0.7.1
- Add shading to table component

View File

@ -162,6 +162,19 @@ defmodule CanneryWeb.ContainerLive.Index do
end
@spec get_value_for_key(atom(), Container.t()) :: any()
defp get_value_for_key(:name, %{id: id, name: container_name}) do
assigns = %{id: id, container_name: container_name}
{container_name,
~H"""
<div class="flex flex-wrap justify-center items-center">
<.link navigate={Routes.container_show_path(Endpoint, :show, @id)} class="link">
<%= @container_name %>
</.link>
</div>
"""}
end
defp get_value_for_key(:packs, container) do
container |> Containers.get_container_ammo_group_count!()
end

View File

@ -87,7 +87,7 @@ msgstr ""
"Sind Sie sicher, dass sie %{email} löschen möchten? Dies kann nicht "
"zurückgenommen werden!"
#: lib/cannery_web/live/container_live/index.ex:223
#: lib/cannery_web/live/container_live/index.ex:236
#: lib/cannery_web/live/container_live/index.html.heex:73
#: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:39

View File

@ -73,7 +73,7 @@ msgstr ""
msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:223
#: lib/cannery_web/live/container_live/index.ex:236
#: lib/cannery_web/live/container_live/index.html.heex:73
#: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:39

View File

@ -87,7 +87,7 @@ msgstr "Grupo de Munición borrado exitosamente"
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.ex:223
#: lib/cannery_web/live/container_live/index.ex:236
#: lib/cannery_web/live/container_live/index.html.heex:73
#: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:39

View File

@ -88,7 +88,7 @@ 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.ex:223
#: lib/cannery_web/live/container_live/index.ex:236
#: lib/cannery_web/live/container_live/index.html.heex:73
#: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:39

View File

@ -83,7 +83,7 @@ msgstr ""
msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:223
#: lib/cannery_web/live/container_live/index.ex:236
#: lib/cannery_web/live/container_live/index.html.heex:73
#: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:39

View File

@ -72,7 +72,7 @@ msgstr ""
msgid "Are you sure you want to delete %{email}? This action is permanent!"
msgstr ""
#: lib/cannery_web/live/container_live/index.ex:223
#: lib/cannery_web/live/container_live/index.ex:236
#: lib/cannery_web/live/container_live/index.html.heex:73
#: lib/cannery_web/live/container_live/show.html.heex:59
#: lib/cannery_web/live/tag_live/index.html.heex:39