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

56 lines
1.4 KiB
Plaintext

<div class="mx-auto space-y-4 max-w-3xl flex flex-col justify-center items-center">
<h1 class="title text-2xl title-primary-500">
<%= @ammo_type.name %>
</h1>
<div class="flex space-x-4 justify-center items-center text-primary-500">
<%= live_redirect("Back", to: Routes.ammo_type_index_path(@socket, :index), class: "link") %>
<%= live_patch("Edit", to: Routes.ammo_type_show_path(@socket, :edit, @ammo_type), class: "button") %>
<%= link("Delete",
to: "#",
class: "link",
phx_click: "delete",
data: [confirm: "Are you sure you want to delete #{@ammo_type.name}?"]
) %>
</div>
<hr class="w-full">
<ul class="text-center">
<li>
<strong>Desc:</strong>
<%= @ammo_type.desc %>
</li>
<li>
<strong>Case material:</strong>
<%= @ammo_type.case_material %>
</li>
<li>
<strong>Bullet type:</strong>
<%= @ammo_type.bullet_type %>
</li>
<li>
<strong>Grain:</strong>
<%= @ammo_type.grain %>
</li>
<li>
<strong>Manufacturer:</strong>
<%= @ammo_type.manufacturer %>
</li>
</ul>
</div>
<%= if @live_action in [:edit] do %>
<%= live_modal(CanneryWeb.AmmoTypeLive.FormComponent,
id: @ammo_type.id,
title: @page_title,
action: @live_action,
ammo_type: @ammo_type,
return_to: Routes.ammo_type_show_path(@socket, :show, @ammo_type)
) %>
<% end %>