theseus/app/views/letters/_letter.html.erb
2025-05-31 23:25:41 -04:00

36 lines
1.2 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="<%= dom_id letter %>" class="letter-item p-3 bg-white border rounded shadow-sm hover:shadow-md transition-shadow">
<div class="flex justify-between items-center mb-2">
<h3 class="text-base font-medium">
<%= link_to letter do %>
<% if letter.user_facing_title.present? %>
<%= letter.user_facing_title %>
<% else %>
<%= letter.public_id %> to <%= letter.address.name_line %>
<% end %>
<% end %>
</h3>
<%= letter_status_badge(letter.aasm_state, 'float-right') %>
</div>
<div class="grid grid-cols-3 gap-1 text-sm text-gray-600">
<div class="truncate">
<span class="text-gray-400">From:</span>
<%= letter.return_address.present? ? letter.return_address_name_line : 'N/A' %>
</div>
<div class="truncate">
<span class="text-gray-400">Created:</span>
<%= time_ago_in_words(letter.created_at) %>
</div>
<div class="truncate">
<span class="text-gray-400">Size:</span>
<%= letter.height %>" × <%= letter.width %>"
</div>
</div>
<div class="mt-2">
<span class="text-gray-400">Tags:</span>
<%= render 'shared/tags', tags: letter.tags %>
</div>
</div>