From 1acb00e35a721011a25ec46ca97b4bdc849f790f Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 18 Jun 2024 13:25:29 -0700 Subject: [PATCH] Add NC prices to item pages --- app/assets/stylesheets/partials/_item_header.sass | 7 ++++++- app/views/items/_item_header.html.haml | 7 ++++++- config/locales/en.yml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/partials/_item_header.sass b/app/assets/stylesheets/partials/_item_header.sass index 6e897872..47fad34a 100644 --- a/app/assets/stylesheets/partials/_item_header.sass +++ b/app/assets/stylesheets/partials/_item_header.sass @@ -37,10 +37,12 @@ align-items: center gap: 1em + abbr + cursor: help + .item-kind, .first-seen-at padding: .25em .5em border-radius: .25em - cursor: help text-decoration: none font-weight: bold @@ -48,6 +50,9 @@ background: #E2E8F0 color: #1A202C + + .icon + vertical-align: middle .item-kind // These colors are copied from DTI 2020, for initial consistency! diff --git a/app/views/items/_item_header.html.haml b/app/views/items/_item_header.html.haml index d1a68f4f..68dc9d5f 100644 --- a/app/views/items/_item_header.html.haml +++ b/app/views/items/_item_header.html.haml @@ -9,7 +9,12 @@ = image_tag item.thumbnail_url, class: 'item-thumbnail' %h2.item-name= item.name %nav.item-links - - if item.nc? + - if item.currently_in_mall? + = link_to "https://ncmall.neopets.com/", class: "item-kind", data: {type: "nc"}, + title: "Currently in NC Mall!", target: "_blank" do + = cart_icon alt: "Buy" + #{item.current_nc_price} NC + - elsif item.nc? %abbr.item-kind{'data-type' => 'nc', title: t('items.show.item_kinds.nc.description')} = t('items.show.item_kinds.nc.label') - elsif item.pb? diff --git a/config/locales/en.yml b/config/locales/en.yml index 779af7d3..582b501a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -299,7 +299,7 @@ en: item_kinds: nc: label: NC - description: Purchaseable with Neocash + description: Neocash (but not currently in NC Mall) np: label: NP description: Purchaseable with Neopoints