From 1d4622a2859ecfad568a0a3e9a9fe41c019ebcc1 Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 4 Mar 2022 21:09:05 -0500 Subject: [PATCH] fixup! use table component for ammo group table --- lib/cannery_web/live/ammo_group_live/index.ex | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/lib/cannery_web/live/ammo_group_live/index.ex b/lib/cannery_web/live/ammo_group_live/index.ex index da439c2..96e19d8 100644 --- a/lib/cannery_web/live/ammo_group_live/index.ex +++ b/lib/cannery_web/live/ammo_group_live/index.ex @@ -83,12 +83,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do %{label: gettext("% left"), key: "remaining"}, %{label: gettext("Range"), key: "range"}, %{label: gettext("Container"), key: "container"}, - %{ - label: nil, - key: "actions", - sortable: false, - class: "px-4 py-2 space-x-4 flex justify-center items-center" - } + %{label: nil, key: "actions", sortable: false} ] rows = @@ -150,28 +145,30 @@ defmodule CanneryWeb.AmmoGroupLive.Index do "actions" -> ~H""" - <%= live_redirect to: Routes.ammo_group_show_path(Endpoint, :show, ammo_group), +
+ <%= live_redirect to: Routes.ammo_group_show_path(Endpoint, :show, ammo_group), + class: "text-primary-600 link", + data: [qa: "view-#{ammo_group.id}"] do %> + + <% end %> + + <%= live_patch to: Routes.ammo_group_index_path(Endpoint, :edit, ammo_group), class: "text-primary-600 link", - data: [qa: "view-#{ammo_group.id}"] do %> - - <% end %> + data: [qa: "edit-#{ammo_group.id}"] do %> + + <% end %> - <%= live_patch to: Routes.ammo_group_index_path(Endpoint, :edit, ammo_group), - class: "text-primary-600 link", - data: [qa: "edit-#{ammo_group.id}"] do %> - - <% end %> - - <%= link to: "#", - class: "text-primary-600 link", - phx_click: "delete", - phx_value_id: ammo_group.id, - data: [ - confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"), - qa: "delete-#{ammo_group.id}" - ] do %> - - <% end %> + <%= link to: "#", + class: "text-primary-600 link", + phx_click: "delete", + phx_value_id: ammo_group.id, + data: [ + confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"), + qa: "delete-#{ammo_group.id}" + ] do %> + + <% end %> +
""" _ ->