cannery/lib/cannery_web/live/ammo_type_live/index.html.heex

44 lines
1.3 KiB
Plaintext
Raw Normal View History

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>
<%= 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
<.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 %>
<.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
<.live_component
module={CanneryWeb.Components.TableComponent}
2022-03-04 22:27:09 -05:00
id="ammo_types_index_table"
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>
2022-11-10 19:10:28 -05:00
<%= if @live_action in [:new, :edit, :clone] 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 %>