fixup! use table component for ammo group table

This commit is contained in:
shibao 2022-03-04 21:09:05 -05:00
parent d9e7948bb0
commit 1d4622a285
1 changed files with 23 additions and 26 deletions

View File

@ -83,12 +83,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
%{label: gettext("% left"), key: "remaining"}, %{label: gettext("% left"), key: "remaining"},
%{label: gettext("Range"), key: "range"}, %{label: gettext("Range"), key: "range"},
%{label: gettext("Container"), key: "container"}, %{label: gettext("Container"), key: "container"},
%{ %{label: nil, key: "actions", sortable: false}
label: nil,
key: "actions",
sortable: false,
class: "px-4 py-2 space-x-4 flex justify-center items-center"
}
] ]
rows = rows =
@ -150,28 +145,30 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
"actions" -> "actions" ->
~H""" ~H"""
<%= live_redirect to: Routes.ammo_group_show_path(Endpoint, :show, ammo_group), <div class="py-2 px-4 h-full space-x-4 flex justify-center items-center">
<%= live_redirect to: Routes.ammo_group_show_path(Endpoint, :show, ammo_group),
class: "text-primary-600 link",
data: [qa: "view-#{ammo_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-eye"></i>
<% end %>
<%= live_patch to: Routes.ammo_group_index_path(Endpoint, :edit, ammo_group),
class: "text-primary-600 link", class: "text-primary-600 link",
data: [qa: "view-#{ammo_group.id}"] do %> data: [qa: "edit-#{ammo_group.id}"] do %>
<i class="fa-fw fa-lg fas fa-eye"></i> <i class="fa-fw fa-lg fas fa-edit"></i>
<% end %> <% end %>
<%= live_patch to: Routes.ammo_group_index_path(Endpoint, :edit, ammo_group), <%= link to: "#",
class: "text-primary-600 link", class: "text-primary-600 link",
data: [qa: "edit-#{ammo_group.id}"] do %> phx_click: "delete",
<i class="fa-fw fa-lg fas fa-edit"></i> phx_value_id: ammo_group.id,
<% end %> data: [
confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"),
<%= link to: "#", qa: "delete-#{ammo_group.id}"
class: "text-primary-600 link", ] do %>
phx_click: "delete", <i class="fa-fw fa-lg fas fa-trash"></i>
phx_value_id: ammo_group.id, <% end %>
data: [ </div>
confirm: dgettext("prompts", "Are you sure you want to delete this ammo?"),
qa: "delete-#{ammo_group.id}"
] do %>
<i class="fa-fw fa-lg fas fa-trash"></i>
<% end %>
""" """
_ -> _ ->