2024-01-21 04:40:25 -08:00
|
|
|
- raise ArgumentError unless defined? item
|
2024-01-21 04:45:22 -08:00
|
|
|
- raise ArgumentError unless defined? trades
|
2024-01-21 06:42:24 -08:00
|
|
|
- raise ArgumentError unless defined? current_user_lists
|
|
|
|
- raise ArgumentError unless defined? current_user_quantities
|
2024-01-21 04:40:25 -08:00
|
|
|
- raise ArgumentError unless defined? current_subpage
|
|
|
|
|
2024-01-21 03:38:02 -08:00
|
|
|
%header.item-header
|
2024-01-21 04:40:25 -08:00
|
|
|
.item-header-main
|
|
|
|
= image_tag item.thumbnail_url, class: 'item-thumbnail'
|
|
|
|
%h2.item-name= item.name
|
|
|
|
%nav.item-links
|
2024-01-21 05:20:08 -08:00
|
|
|
- if item.nc?
|
2024-01-21 05:41:55 -08:00
|
|
|
%abbr.item-kind{'data-type' => 'nc', title: t('items.show.item_kinds.nc.description')}
|
|
|
|
= t('items.show.item_kinds.nc.label')
|
2024-01-21 05:23:53 -08:00
|
|
|
- elsif item.pb?
|
2024-01-21 05:41:55 -08:00
|
|
|
%abbr.item-kind{'data-type' => 'pb', title: t('items.show.item_kinds.pb.description')}
|
|
|
|
= t('items.show.item_kinds.pb.label')
|
2024-01-21 05:20:08 -08:00
|
|
|
- else
|
2024-01-21 05:41:55 -08:00
|
|
|
%abbr.item-kind{'data-type' => 'np', title: t('items.show.item_kinds.np.description')}
|
|
|
|
= t('items.show.item_kinds.np.label')
|
2024-01-21 05:20:08 -08:00
|
|
|
|
2024-02-20 14:32:45 -08:00
|
|
|
- if item.created_at?
|
|
|
|
%time.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
|
|
|
|
|
2024-01-21 04:40:25 -08:00
|
|
|
= link_to t('items.show.resources.jn_items'), jn_items_url_for(item)
|
2024-03-13 17:46:45 -07:00
|
|
|
= link_to t('items.show.resources.impress_2020'), impress_2020_url_for(item)
|
2024-01-21 04:40:25 -08:00
|
|
|
- if item.nc_trade_value
|
2024-05-27 15:50:41 -07:00
|
|
|
= link_to t('items.show.resources.owls', value: item.nc_trade_value_text),
|
2024-01-21 04:40:25 -08:00
|
|
|
"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 06:20:32 -08:00
|
|
|
- if user_signed_in?
|
2024-01-23 04:20:03 -08:00
|
|
|
.user-lists-info
|
2024-01-21 06:20:32 -08:00
|
|
|
= link_to t('items.show.closet_hangers.button'),
|
|
|
|
user_closet_hangers_path(current_user),
|
2024-01-23 04:20:03 -08:00
|
|
|
class: 'user-lists-form-opener'
|
|
|
|
|
2024-01-23 04:30:23 -08:00
|
|
|
- if user_signed_in?
|
|
|
|
= form_tag update_quantities_user_item_closet_hangers_path(user_id: current_user, item_id: item), method: :put, class: 'user-lists-form', hidden: item_header_user_lists_form_state != "open" do
|
|
|
|
%h3
|
|
|
|
= t 'items.show.closet_hangers.header_html',
|
|
|
|
user_items_link: link_to(t('your_items'),
|
|
|
|
user_closet_hangers_path(current_user))
|
|
|
|
.closet-hangers-ownership-groups
|
|
|
|
- [true, false].each do |owned|
|
|
|
|
- lists = current_user_lists[owned]
|
|
|
|
%div
|
|
|
|
%h4= closet_lists_group_name(:you, owned)
|
|
|
|
%ul
|
|
|
|
- lists.each_with_index do |list, index|
|
|
|
|
%li
|
|
|
|
= number_field_tag "quantity[#{list.id}]",
|
|
|
|
current_user_quantities[list.id], min: 0,
|
|
|
|
autofocus: owned && index == 0
|
|
|
|
= label_tag "quantity[#{list.id}]", list.name
|
|
|
|
|
2024-01-23 04:20:03 -08:00
|
|
|
%li
|
2024-01-23 04:30:23 -08:00
|
|
|
= number_field_tag "quantity[#{owned}]",
|
|
|
|
current_user_quantities[owned], min: 0,
|
|
|
|
autofocus: owned && lists.empty?
|
|
|
|
|
|
|
|
- unless lists.empty?
|
|
|
|
= label_tag "quantity[#{owned}]",
|
|
|
|
t('closet_lists.unlisted_name'),
|
|
|
|
:class => 'unlisted'
|
|
|
|
- else
|
|
|
|
= label_tag "quantity[#{owned}]",
|
|
|
|
t('items.show.closet_hangers.quantity_label')
|
|
|
|
= submit_tag t('items.show.closet_hangers.submit')
|
2024-01-21 06:20:32 -08:00
|
|
|
|
2024-01-21 06:42:24 -08:00
|
|
|
%p.item-description= item.description
|
2024-01-21 05:07:45 -08:00
|
|
|
|
2024-01-21 04:40:25 -08:00
|
|
|
%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
|
2024-01-21 04:45:22 -08:00
|
|
|
= link_to t('items.show.subpages_nav.trades.offering',
|
|
|
|
count: trades[:offering].size),
|
2024-01-21 04:40:25 -08:00
|
|
|
item_trades_path(item, type: 'offering'),
|
|
|
|
'data-is-current' => current_subpage == 'trades_offering'
|
|
|
|
%li
|
2024-01-21 04:45:22 -08:00
|
|
|
= link_to t('items.show.subpages_nav.trades.seeking',
|
2024-01-21 06:54:26 -08:00
|
|
|
count: trades[:seeking].size),
|
2024-01-21 04:40:25 -08:00
|
|
|
item_trades_path(item, type: 'seeking'),
|
|
|
|
'data-is-current' => current_subpage == 'trades_seeking'
|
2024-01-21 06:20:32 -08:00
|
|
|
|
|
|
|
- content_for :javascripts do
|
2024-03-13 21:26:22 -07:00
|
|
|
= javascript_include_tag 'items/item_header', defer: true
|