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-07-01 00:20:50 -04:00
|
|
|
<%= gettext("Catalog") %>
|
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-11-07 22:36:38 -05:00
|
|
|
<.link patch={Routes.ammo_type_index_path(Endpoint, :new)} class="btn btn-primary">
|
|
|
|
<%= dgettext("actions", "Add your first type!") %>
|
|
|
|
</.link>
|
2022-02-01 00:12:09 -05:00
|
|
|
<% else %>
|
2022-11-07 22:36:38 -05:00
|
|
|
<.link patch={Routes.ammo_type_index_path(Endpoint, :new)} class="btn btn-primary">
|
|
|
|
<%= dgettext("actions", "New Ammo type") %>
|
|
|
|
</.link>
|
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 %>
|