2022-02-15 23:52:44 -05:00
|
|
|
<div class="flex flex-col space-y-8 justify-center items-center">
|
2022-01-31 23:03:13 -05:00
|
|
|
<h1 class="title text-2xl title-primary-500">
|
2022-02-15 17:33:07 -05:00
|
|
|
<%= gettext("Ammo Types") %>
|
2022-01-31 23:03:13 -05:00
|
|
|
</h1>
|
|
|
|
|
2022-03-04 18:28:10 -05:00
|
|
|
<%= if @rows |> Enum.empty?() do %>
|
2022-02-17 22:29:01 -05:00
|
|
|
<h2 class="title text-xl text-primary-600">
|
2022-02-15 23:52:44 -05:00
|
|
|
<%= gettext("No Ammo Types") %>
|
|
|
|
<%= display_emoji("😔") %>
|
2022-02-01 00:12:09 -05:00
|
|
|
</h2>
|
2022-01-31 23:03:13 -05:00
|
|
|
|
2022-02-09 00:39:27 -05:00
|
|
|
<%= live_patch(dgettext("actions", "Add your first type!"),
|
2022-02-17 22:31:37 -05:00
|
|
|
to: Routes.ammo_type_index_path(Endpoint, :new),
|
2022-02-01 01:08:18 -05:00
|
|
|
class: "btn btn-primary"
|
|
|
|
) %>
|
2022-02-01 00:12:09 -05:00
|
|
|
<% else %>
|
2022-02-09 00:39:27 -05:00
|
|
|
<%= live_patch(dgettext("actions", "New Ammo type"),
|
2022-02-17 22:31:37 -05:00
|
|
|
to: Routes.ammo_type_index_path(Endpoint, :new),
|
2022-02-01 01:08:18 -05:00
|
|
|
class: "btn btn-primary"
|
|
|
|
) %>
|
2022-01-31 23:03:13 -05:00
|
|
|
|
2022-03-04 18:28:10 -05:00
|
|
|
<.live_component
|
|
|
|
module={CanneryWeb.Components.TableComponent}
|
2022-03-04 22:27:09 -05:00
|
|
|
id="ammo_types_index_table"
|
2022-03-04 18:28:10 -05:00
|
|
|
action={@live_action}
|
|
|
|
columns={@columns}
|
|
|
|
rows={@rows}
|
|
|
|
/>
|
2022-02-01 00:12:09 -05:00
|
|
|
<% end %>
|
2022-01-31 23:03:13 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= if @live_action in [:new, :edit] do %>
|
2022-02-14 01:26:51 -05:00
|
|
|
<.modal return_to={Routes.ammo_type_index_path(Endpoint, :index)}>
|
|
|
|
<.live_component
|
|
|
|
module={CanneryWeb.AmmoTypeLive.FormComponent}
|
|
|
|
id={@ammo_type.id || :new}
|
|
|
|
title={@page_title}
|
|
|
|
action={@live_action}
|
|
|
|
ammo_type={@ammo_type}
|
|
|
|
return_to={Routes.ammo_type_index_path(Endpoint, :index)}
|
|
|
|
current_user={@current_user}
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</.modal>
|
2022-01-31 23:03:13 -05:00
|
|
|
<% end %>
|