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

25 lines
970 B
Text

-# Renders an item kind badge (NC/NP/PB)
-#
-# Usage:
-# = render "items/item_kind_badge", item: @item
-#
-# The badge shows:
-# - For NC Mall items: clickable link with price
-# - For NC items: purple "NC" badge
-# - For PB items: orange "PB" badge
-# - For NP items: gray "NP" badge
- if item.currently_in_mall?
= link_to "https://ncmall.neopets.com/", class: "item-badge", data: {item_kind: "nc"},
title: "Currently in NC Mall!", target: "_blank" do
= cart_icon alt: "Buy"
#{item.current_nc_price} NC
- elsif item.nc?
%abbr.item-badge{data: {item_kind: "nc"}, title: t('items.show.item_kinds.nc.description')}
= t('items.show.item_kinds.nc.label')
- elsif item.pb?
%abbr.item-badge{data: {item_kind: "pb"}, title: t('items.show.item_kinds.pb.description')}
= t('items.show.item_kinds.pb.label')
- else
%abbr.item-badge{data: {item_kind: "np"}, title: t('items.show.item_kinds.np.description')}
= t('items.show.item_kinds.np.label')