impress/app/views/items/_item_header.haml

49 lines
2 KiB
Text
Raw Normal View History

- raise ArgumentError unless defined? item
- raise ArgumentError unless defined? trades
- raise ArgumentError unless defined? current_subpage
%header.item-header
.item-header-main
= image_tag item.thumbnail_url, class: 'item-thumbnail'
%h2.item-name= item.name
%nav.item-links
- if item.nc?
2024-01-21 05:23:53 -08:00
.item-kind{'data-type' => 'nc', title: 'Purchaseable with Neocash'}
NC
2024-01-21 05:23:53 -08:00
- elsif item.pb?
.item-kind{'data-type' => 'pb', title: 'Only obtainable via paintbrush'}
PB
- else
2024-01-21 05:23:53 -08:00
.item-kind{'data-type' => 'np', title: 'Purchaseable with Neopoints'}
NP
= link_to t('items.show.resources.jn_items'), jn_items_url_for(item)
- if item.nc_trade_value
= link_to t('items.show.resources.owls', value: item.nc_trade_value.value_text),
"https://www.neopets.com/~owls",
title: nc_trade_value_updated_at_text(item.nc_trade_value)
- unless item.nc?
= link_to t('items.show.resources.shop_wizard'), shop_wizard_url_for(item)
= link_to t('items.show.resources.super_shop_wizard'), super_shop_wizard_url_for(item)
= link_to t('items.show.resources.trading_post'), trading_post_url_for(item)
= link_to t('items.show.resources.auction_genie'), auction_genie_url_for(item)
2024-01-21 05:07:45 -08:00
%p.item-description= @item.description
%nav.item-subpages-nav
= link_to t('items.show.subpages_nav.preview'), item,
class: ['preview-link'], 'data-is-current' => current_subpage == 'preview'
.trades-section
%header= t('items.show.subpages_nav.trades.header')
%ul
%li
= link_to t('items.show.subpages_nav.trades.offering',
count: trades[:offering].size),
item_trades_path(item, type: 'offering'),
'data-is-current' => current_subpage == 'trades_offering'
%li
= link_to t('items.show.subpages_nav.trades.seeking',
count: trades[:offering].size),
item_trades_path(item, type: 'seeking'),
'data-is-current' => current_subpage == 'trades_seeking'