Files
fizzy/app/views/bubbles/_meta.html.erb
T
Jason Zimdars 28a569c49b Tickets
2025-03-17 21:24:08 -05:00

45 lines
1.8 KiB
Plaintext

<div class="card__meta flex txt-tight-lines txt-uppercase">
<div class="flex flex-column gap txt-align-end">
<span class="pad-inline overflow-ellipsis"><%= bubble.creating? ? "Added" : "Updated" %>
<%= days = (Date.current - bubble.updated_at.to_date).to_i
case days
when 0 then "<strong>Today</strong>".html_safe
when 1 then "<strong>Yesterday</strong>".html_safe
else "<strong>#{days}</strong> days ago".html_safe
end %>
</span>
<hr class="full-width separator--horizontal unpad margin-none card__hide-on-index">
<% if bubble.creating? %>
<span class="pad-inline overflow-ellipsis card__hide-on-index">Expires
<%= days = (bubble.auto_pop_at.to_date - Date.current).to_i
case days
when 0 then "<strong>Today</strong>".html_safe
else "in <strong>#{days}</strong> days".html_safe
end %>
</span>
<% else %>
<span class="pad-inline overflow-ellipsis card__hide-on-index">Added
<%= days = (Date.current - bubble.created_at.to_date).to_i
case days
when 0 then "<strong>Today</strong>".html_safe
when 1 then "<strong>Yesterday</strong>".html_safe
else "<strong>#{days}</strong> days ago".html_safe
end %>
</span>
<% end %>
</div>
<hr class="separator margin-none unpad card__hide-on-index">
<div class="flex flex-column gap txt-align-start card__hide-on-index">
<span class="pad-inline overflow-ellipsis">
<strong><%= bubble.comments_count %></strong> <%= bubble.comments_count == 1 ? "comment" : "comments" %>
</span>
<hr class="full-width separator--horizontal unpad margin-none">
<%= render "bubbles/boosts", bubble: bubble %>
</div>
</div>