forked from shibao/cannery
64 lines
1.8 KiB
Plaintext
64 lines
1.8 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">
|
|
<%= @container.name %>
|
|
</h1>
|
|
|
|
<%= if @container.desc do %>
|
|
<span class="rounded-lg title text-lg">
|
|
<%= gettext("Description:") %>
|
|
<%= @container.desc %>
|
|
</span>
|
|
<% end %>
|
|
|
|
<span class="rounded-lg title text-lg">
|
|
<%= gettext("Type:") %>
|
|
<%= @container.type %>
|
|
</span>
|
|
|
|
<%= if @container.location do %>
|
|
<span class="rounded-lg title text-lg">
|
|
<%= gettext("Location:") %>
|
|
<%= @container.location %>
|
|
</span>
|
|
<% end %>
|
|
|
|
<div class="flex space-x-4 justify-center items-center text-primary-500">
|
|
<%= live_patch to: Routes.container_show_path(@socket, :edit, @container),
|
|
class: "text-primary-500 link" do %>
|
|
<i class="fa-fw fa-lg fas fa-edit"></i>
|
|
<% end %>
|
|
|
|
<%= link to: "#",
|
|
class: "text-primary-500 link",
|
|
phx_click: "delete",
|
|
data: [
|
|
confirm:
|
|
dgettext("prompts", "Are you sure you want to delete %{name}?", name: @container.name)
|
|
] do %>
|
|
<i class="fa-fw fa-lg fas fa-trash"></i>
|
|
<% end %>
|
|
</div>
|
|
|
|
<hr class="mb-4 w-full">
|
|
|
|
<p>
|
|
<%= if @container.ammo_groups |> Enum.empty?() do %>
|
|
<%= gettext("No ammo groups in this container") %>
|
|
<% else %>
|
|
<%= for ammo_group <- @container.ammo_groups do %>
|
|
<.ammo_group_card ammo_group={ammo_group} />
|
|
<% end %>
|
|
<% end %>
|
|
</p>
|
|
|
|
<%= if @live_action in [:edit] do %>
|
|
<%= live_modal(CanneryWeb.ContainerLive.FormComponent,
|
|
id: @container.id,
|
|
title: @page_title,
|
|
action: @live_action,
|
|
container: @container,
|
|
return_to: Routes.container_show_path(@socket, :show, @container)
|
|
) %>
|
|
<% end %>
|
|
</div>
|