impress/app/views/items/badges/_first_seen.html.haml

13 lines
448 B
Text

-# Renders a "first seen" timestamp badge for an item
-#
-# Usage:
-# = render "items/badges/first_seen", item: @item
-#
-# Shows when the item was first added to the database.
-# Only renders if the item has a created_at timestamp.
- if item.created_at?
%time.item-badge.first-seen-at{
datetime: item.created_at.iso8601,
title: "First seen on #{item.created_at.to_date.to_fs(:long)}",
}= time_with_only_month_if_old item.created_at