diff --git a/lib/cannery_web/live/ammo_type_live/index.html.heex b/lib/cannery_web/live/ammo_type_live/index.html.heex index f70ca9e..d894d71 100644 --- a/lib/cannery_web/live/ammo_type_live/index.html.heex +++ b/lib/cannery_web/live/ammo_type_live/index.html.heex @@ -3,42 +3,52 @@ Listing Ammo Types - <%= live_patch "New Ammo type", - to: Routes.ammo_type_index_path(@socket, :new), - class: "btn btn-primary" %> + <%= if @ammo_types |> Enum.empty?() do %> +
Name | -Case material | -Bullet type | -Grain | -Manufacturer | + <%= live_patch "Add your first type!", + to: Routes.ammo_type_index_path(@socket, :new), + class: "btn btn-primary" %> + <% else %> + <%= live_patch "New Ammo type", + to: Routes.ammo_type_index_path(@socket, :new), + class: "btn btn-primary" %> -- | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
<%= ammo_type.name %> | -<%= ammo_type.case_material %> | -<%= ammo_type.bullet_type %> | -<%= ammo_type.grain %> | -<%= ammo_type.manufacturer %> | +
Name | +Case material | +Bullet type | +Grain | +Manufacturer | -- <%= live_redirect "Show", to: Routes.ammo_type_show_path(@socket, :show, ammo_type) %> - <%= live_patch "Edit", to: Routes.ammo_type_index_path(@socket, :edit, ammo_type) %> - <%= link "Delete", to: "#", phx_click: "delete", phx_value_id: ammo_type.id, data: [confirm: "Are you sure?"] %> - | +
---|