2023-03-17 21:06:08 -04:00
|
|
|
<div
|
2023-03-29 22:54:55 -04:00
|
|
|
id={"pack-#{@pack.id}"}
|
2023-03-17 21:06:08 -04:00
|
|
|
class="mx-4 my-2 px-8 py-4
|
|
|
|
flex flex-col justify-center items-center
|
|
|
|
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
|
|
|
|
transition-all duration-300 ease-in-out"
|
|
|
|
>
|
2023-03-29 22:54:55 -04:00
|
|
|
<.link navigate={Routes.pack_show_path(Endpoint, :show, @pack)} class="mb-2 link">
|
2023-03-17 21:06:08 -04:00
|
|
|
<h1 class="title text-xl title-primary-500">
|
2023-03-29 22:54:55 -04:00
|
|
|
<%= @pack.ammo_type.name %>
|
2023-03-17 21:06:08 -04:00
|
|
|
</h1>
|
|
|
|
</.link>
|
|
|
|
|
|
|
|
<div class="flex flex-col justify-center items-center">
|
|
|
|
<span class="rounded-lg title text-lg">
|
|
|
|
<%= gettext("Count:") %>
|
2023-03-29 22:54:55 -04:00
|
|
|
<%= if @pack.count == 0, do: gettext("Empty"), else: @pack.count %>
|
2023-03-17 21:06:08 -04:00
|
|
|
</span>
|
|
|
|
|
2023-03-29 22:54:55 -04:00
|
|
|
<span :if={@original_count && @original_count != @pack.count} class="rounded-lg title text-lg">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Original Count:") %>
|
2023-03-18 21:06:00 -04:00
|
|
|
<%= @original_count %>
|
2023-03-17 21:06:08 -04:00
|
|
|
</span>
|
|
|
|
|
2023-03-29 22:54:55 -04:00
|
|
|
<span :if={@pack.notes} class="rounded-lg title text-lg">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Notes:") %>
|
2023-03-29 22:54:55 -04:00
|
|
|
<%= @pack.notes %>
|
2023-03-17 21:06:08 -04:00
|
|
|
</span>
|
|
|
|
|
2023-03-29 22:54:55 -04:00
|
|
|
<span :if={@pack.purchased_on} class="rounded-lg title text-lg">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Purchased on:") %>
|
2023-03-29 22:54:55 -04:00
|
|
|
<.date id={"#{@pack.id}-purchased-on"} date={@pack.purchased_on} />
|
2023-03-17 21:06:08 -04:00
|
|
|
</span>
|
|
|
|
|
2023-03-18 21:06:00 -04:00
|
|
|
<span :if={@last_used_date} class="rounded-lg title text-lg">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Last used on:") %>
|
2023-03-29 22:54:55 -04:00
|
|
|
<.date id={"#{@pack.id}-last-used-on"} date={@last_used_date} />
|
2023-03-17 21:06:08 -04:00
|
|
|
</span>
|
|
|
|
|
2023-03-29 22:54:55 -04:00
|
|
|
<span :if={@pack.price_paid} class="rounded-lg title text-lg">
|
2023-03-18 21:06:00 -04:00
|
|
|
<%= gettext("Price paid:") %>
|
2023-03-29 22:54:55 -04:00
|
|
|
<%= gettext("$%{amount}", amount: display_currency(@pack.price_paid)) %>
|
2023-03-18 21:06:00 -04:00
|
|
|
</span>
|
2023-03-17 21:06:08 -04:00
|
|
|
|
2023-03-18 21:06:00 -04:00
|
|
|
<span :if={@cpr} class="rounded-lg title text-lg">
|
|
|
|
<%= gettext("CPR:") %>
|
|
|
|
<%= gettext("$%{amount}", amount: display_currency(@cpr)) %>
|
|
|
|
</span>
|
2023-03-17 21:06:08 -04:00
|
|
|
|
2023-03-19 15:05:09 -04:00
|
|
|
<span :if={@container} class="rounded-lg title text-lg">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Container:") %>
|
|
|
|
|
2023-03-19 15:05:09 -04:00
|
|
|
<.link navigate={Routes.container_show_path(Endpoint, :show, @container)} class="link">
|
|
|
|
<%= @container.name %>
|
2023-03-17 21:06:08 -04:00
|
|
|
</.link>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div :if={@inner_block} class="mt-4 flex space-x-4 justify-center items-center">
|
|
|
|
<%= render_slot(@inner_block) %>
|
|
|
|
</div>
|
|
|
|
</div>
|