From 25d4f1916ae4248ca858072e6042d05b6c1f7c23 Mon Sep 17 00:00:00 2001 From: shibao Date: Sat, 19 Nov 2022 13:16:55 -0500 Subject: [PATCH] display link to container in table --- CHANGELOG.md | 1 + lib/cannery_web/live/container_live/index.ex | 13 +++++++++++++ priv/gettext/de/LC_MESSAGES/prompts.po | 2 +- priv/gettext/en/LC_MESSAGES/prompts.po | 2 +- priv/gettext/es/LC_MESSAGES/prompts.po | 2 +- priv/gettext/fr/LC_MESSAGES/prompts.po | 2 +- priv/gettext/ga/LC_MESSAGES/prompts.po | 2 +- priv/gettext/prompts.pot | 2 +- 8 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b647810a..ae668bfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/cannery_web/live/container_live/index.ex b/lib/cannery_web/live/container_live/index.ex index 9e9dddf9..a44accf0 100644 --- a/lib/cannery_web/live/container_live/index.ex +++ b/lib/cannery_web/live/container_live/index.ex @@ -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""" +
+ <.link navigate={Routes.container_show_path(Endpoint, :show, @id)} class="link"> + <%= @container_name %> + +
+ """} + end + defp get_value_for_key(:packs, container) do container |> Containers.get_container_ammo_group_count!() end diff --git a/priv/gettext/de/LC_MESSAGES/prompts.po b/priv/gettext/de/LC_MESSAGES/prompts.po index 7b2b17f9..f591f50b 100644 --- a/priv/gettext/de/LC_MESSAGES/prompts.po +++ b/priv/gettext/de/LC_MESSAGES/prompts.po @@ -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 diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po index 39399f50..8e453f67 100644 --- a/priv/gettext/en/LC_MESSAGES/prompts.po +++ b/priv/gettext/en/LC_MESSAGES/prompts.po @@ -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 diff --git a/priv/gettext/es/LC_MESSAGES/prompts.po b/priv/gettext/es/LC_MESSAGES/prompts.po index b31abdda..f52290e3 100644 --- a/priv/gettext/es/LC_MESSAGES/prompts.po +++ b/priv/gettext/es/LC_MESSAGES/prompts.po @@ -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 diff --git a/priv/gettext/fr/LC_MESSAGES/prompts.po b/priv/gettext/fr/LC_MESSAGES/prompts.po index 53a0eaea..e6b93a32 100644 --- a/priv/gettext/fr/LC_MESSAGES/prompts.po +++ b/priv/gettext/fr/LC_MESSAGES/prompts.po @@ -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 diff --git a/priv/gettext/ga/LC_MESSAGES/prompts.po b/priv/gettext/ga/LC_MESSAGES/prompts.po index 430d7fac..e0fdf181 100644 --- a/priv/gettext/ga/LC_MESSAGES/prompts.po +++ b/priv/gettext/ga/LC_MESSAGES/prompts.po @@ -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 diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index ffd88440..55f8605f 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -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