From d9e7948bb0b6f8b293d46f5556b1ab21035a6d1d Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 4 Mar 2022 21:07:32 -0500 Subject: [PATCH] fixup! use new table component for ammo type index table --- lib/cannery_web/live/ammo_type_live/index.ex | 50 +++++++++----------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/lib/cannery_web/live/ammo_type_live/index.ex b/lib/cannery_web/live/ammo_type_live/index.ex index a417e7f2..1b6d1ed1 100644 --- a/lib/cannery_web/live/ammo_type_live/index.ex +++ b/lib/cannery_web/live/ammo_type_live/index.ex @@ -84,13 +84,7 @@ defmodule CanneryWeb.AmmoTypeLive.Index do end) |> Kernel.++([ %{label: gettext("Total # of rounds"), key: "round_count", type: :round_count}, - %{ - label: nil, - key: "actions", - class: "px-4 py-2 space-x-4 flex justify-center items-center", - type: :actions, - sortable: false - } + %{label: nil, key: "actions", type: :actions, sortable: false} ]) rows = @@ -115,28 +109,30 @@ defmodule CanneryWeb.AmmoTypeLive.Index do :actions -> ~H""" - <%= live_redirect to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type), +
+ <%= live_redirect to: Routes.ammo_type_show_path(Endpoint, :show, ammo_type), + class: "text-primary-600 link", + data: [qa: "view-#{ammo_type.id}"] do %> + + <% end %> + + <%= live_patch to: Routes.ammo_type_index_path(Endpoint, :edit, ammo_type), class: "text-primary-600 link", - data: [qa: "view-#{ammo_type.id}"] do %> - - <% end %> + data: [qa: "edit-#{ammo_type.id}"] do %> + + <% end %> - <%= live_patch to: Routes.ammo_type_index_path(Endpoint, :edit, ammo_type), - class: "text-primary-600 link", - data: [qa: "edit-#{ammo_type.id}"] do %> - - <% end %> - - <%= link to: "#", - class: "text-primary-600 link", - phx_click: "delete", - phx_value_id: ammo_type.id, - data: [ - confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"), - qa: "delete-#{ammo_type.id}" - ] do %> - - <% end %> + <%= link to: "#", + class: "text-primary-600 link", + phx_click: "delete", + phx_value_id: ammo_type.id, + data: [ + confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"), + qa: "delete-#{ammo_type.id}" + ] do %> + + <% end %> +
""" nil ->