Add bare-bones Item Getting Guide page
TNT requested that we figure out ways to connect the dots between
people's intentions on DTI to their purchases in the NC Mall.
But rather than just slam ad links everywhere, our plan is to design an
actually useful feature about it: the "Item Getting Guide". It'll break
down items by how you can actually get them (NP economy, NC Mall,
retired NC, Dyeworks, etc), and we're planning some cute actions you
can take, like shortcuts for getting them onto trade wishlists or into
your NC Mall cart.
This is just a little demo version of the page, just breaking down
items specified in the URL into NC/NP/PB! Later we'll do more granular
breakdown than this, with more info and actions—and we'll also like,
link to it at all, which isn't the case yet! (The main way we expect
people to get here is by a "Get these items" button we'll add to the
outfit editor, but there might be other paths, too.)
2024-05-06 20:37:59 -07:00
- title "Item Getting Guide"
%h1#title Item Getting Guide
2024-05-14 00:09:27 -07:00
- if @nc_mall_items.present?
%h2 NC Mall items
2024-05-14 17:41:05 -07:00
:markdown
2024-05-14 16:03:35 -07:00
These items are available in the NC Mall right now! You can buy them
2024-05-14 17:41:05 -07:00
with Neocash, a special currency you can [purchase directly][nc]
from Neopets or redeem via [gift cards][gc].
[nc]: https://secure.nc.neopets.com/get-neocash
[gc]: https://secure.nc.neopets.com/nickcash-cards
2024-06-09 15:05:00 -07:00
2024-05-20 15:23:34 -07:00
%table.item-list
%thead
%tr
%td
%th
2024-06-09 13:25:59 -07:00
Total: #{nc_total_for @nc_mall_items} NC
2024-05-20 15:23:34 -07:00
(#{pluralize @nc_mall_items.size, "item"})
2024-05-20 16:15:46 -07:00
%td.actions-cell
%button{onclick: "alert('Todo!')"}
2024-05-21 18:12:40 -07:00
= cart_icon alt: ""
2024-05-20 15:23:34 -07:00
Buy all in NC Mall
%tbody
- @nc_mall_items.each do |item|
2024-05-21 18:48:29 -07:00
= render "item_list_row", item: do
%button{onclick: "alert('Todo!')"}
= cart_icon alt: ""
Buy (#{item.current_nc_price} NC)
Add bare-bones Item Getting Guide page
TNT requested that we figure out ways to connect the dots between
people's intentions on DTI to their purchases in the NC Mall.
But rather than just slam ad links everywhere, our plan is to design an
actually useful feature about it: the "Item Getting Guide". It'll break
down items by how you can actually get them (NP economy, NC Mall,
retired NC, Dyeworks, etc), and we're planning some cute actions you
can take, like shortcuts for getting them onto trade wishlists or into
your NC Mall cart.
This is just a little demo version of the page, just breaking down
items specified in the URL into NC/NP/PB! Later we'll do more granular
breakdown than this, with more info and actions—and we'll also like,
link to it at all, which isn't the case yet! (The main way we expect
people to get here is by a "Get these items" button we'll add to the
outfit editor, but there might be other paths, too.)
2024-05-06 20:37:59 -07:00
2024-06-09 14:46:24 -07:00
- if @buyable_dyeworks_items.present?
2024-06-09 13:25:59 -07:00
%h2 Dyeworks items
:markdown
These are recolored "Dyeworks" variants of items. First get the "base"
item, then get a Dyeworks Hue Brew Potion, and combine them in the
[Dyeworks][dyeworks] section of the NC Mall! Potions can also be bought in
bundles of 5 or 10.
[dyeworks]: https://www.neopets.com/mall/dyeworks/
2024-06-09 15:05:00 -07:00
2024-06-09 13:25:59 -07:00
%table.item-list
%thead
%td.thumbnail-cell
= image_tag "https://images.neopets.com/items/mall_80x80_cleaning.gif",
alt: "Dyeworks Hue Brew Potion"
%th
2024-06-09 14:46:24 -07:00
Total: #{dyeworks_nc_total_for @buyable_dyeworks_items} NC
2024-06-09 13:25:59 -07:00
= surround "(", ")" do
%span.price-breakdown{
2024-06-09 14:46:24 -07:00
title: "#{dyeworks_items_nc_total_for(@buyable_dyeworks_items)} NC"
2024-06-09 13:25:59 -07:00
}<
2024-06-09 14:46:24 -07:00
#{pluralize @buyable_dyeworks_items.size, "item"}
2024-06-09 13:25:59 -07:00
+
%span.price-breakdown{
2024-06-09 14:46:24 -07:00
title: dyeworks_potions_nc_summary(@buyable_dyeworks_items.size)
2024-06-09 13:25:59 -07:00
}<
2024-06-09 14:46:24 -07:00
#{pluralize @buyable_dyeworks_items.size, "potion"}
2024-06-09 13:25:59 -07:00
%td.actions-cell
%button{onclick: "alert('Todo!')"}
= cart_icon alt: ""
Buy all in NC Mall
%tbody
2024-06-09 14:46:24 -07:00
- @buyable_dyeworks_items.each do |item|
Move Item Getting Guide subtitle UI out of helpers, into templates
I thought to myself, "I wonder if it's possible to use a sneaky hacky
`content_for` trick to be able to run this code in the template." And
indeed it is!
It's tricky cuz like, I want to render this template, and I want to
provide _multiple_ slots of content to it. So, in this variant, we keep
the block as being primarily for the actions, but also optionally
accept `content_for :subtitle` inside that block, too.
Executing that correctly is a bit tricky! The subtitle comes *before*
the actions. So, we `yield` the actions block immediately, save it to a
variable, and *then* get the subtitle block.
2024-06-09 15:03:35 -07:00
= render "item_list_row", item: do
- base_item = item.dyeworks_base_item
2024-06-09 15:05:00 -07:00
Move Item Getting Guide subtitle UI out of helpers, into templates
I thought to myself, "I wonder if it's possible to use a sneaky hacky
`content_for` trick to be able to run this code in the template." And
indeed it is!
It's tricky cuz like, I want to render this template, and I want to
provide _multiple_ slots of content to it. So, in this variant, we keep
the block as being primarily for the actions, but also optionally
accept `content_for :subtitle` inside that block, too.
Executing that correctly is a bit tricky! The subtitle comes *before*
the actions. So, we `yield` the actions block immediately, save it to a
variable, and *then* get the subtitle block.
2024-06-09 15:03:35 -07:00
- content_for :subtitle, flush: true do
2024-06-09 15:21:42 -07:00
= link_to base_item.name, base_item, target: "_blank"
+ 1 potion
- if item.dyeworks_permanent?
%span.dyeworks-timeframe{
title: "This recipe is NOT currently scheduled to be removed " +
"from Dyeworks. It might not stay forever, but it's also " +
"not part of a known limited-time event, like most " +
"Dyeworks items are."
}
(Permanent)
2024-06-09 15:05:00 -07:00
2024-06-09 13:25:59 -07:00
%button{onclick: "alert('Todo!')"}
= cart_icon alt: ""
Buy base (#{item.dyeworks_base_item.current_nc_price} NC)
Add bare-bones Item Getting Guide page
TNT requested that we figure out ways to connect the dots between
people's intentions on DTI to their purchases in the NC Mall.
But rather than just slam ad links everywhere, our plan is to design an
actually useful feature about it: the "Item Getting Guide". It'll break
down items by how you can actually get them (NP economy, NC Mall,
retired NC, Dyeworks, etc), and we're planning some cute actions you
can take, like shortcuts for getting them onto trade wishlists or into
your NC Mall cart.
This is just a little demo version of the page, just breaking down
items specified in the URL into NC/NP/PB! Later we'll do more granular
breakdown than this, with more info and actions—and we'll also like,
link to it at all, which isn't the case yet! (The main way we expect
people to get here is by a "Get these items" button we'll add to the
outfit editor, but there might be other paths, too.)
2024-05-06 20:37:59 -07:00
- if @np_items.present?
%h2 Neopoint items
2024-05-14 17:41:05 -07:00
:markdown
These items can be purchased with Neopoints. For less-expensive items,
check the [Shop Wizard][wiz] first. Otherwise, try the
[Trading Post][tp] or [Auction Genie][ag]. Dress to Impress doesn't
track Neopoint item prices, but other fansites do!
[wiz]: https://www.neopets.com/shops/wizard.phtml
[tp]: https://www.neopets.com/island/tradingpost.phtml?type=browse
[ag]: https://www.neopets.com/genie.phtml
2024-06-09 15:05:00 -07:00
2024-05-21 18:03:00 -07:00
%table.item-list
%thead
%td
%th{colspan: 2}
Total: #{pluralize @np_items.size, "item"}
%tbody
- @np_items.each do |item|
2024-05-21 18:48:29 -07:00
= render "item_list_row", item: do
= button_link_to "Shops", shop_wizard_url_for(item),
target: "_blank", icon: search_icon
= button_link_to "Trades", trading_post_url_for(item),
target: "_blank", icon: search_icon
Add bare-bones Item Getting Guide page
TNT requested that we figure out ways to connect the dots between
people's intentions on DTI to their purchases in the NC Mall.
But rather than just slam ad links everywhere, our plan is to design an
actually useful feature about it: the "Item Getting Guide". It'll break
down items by how you can actually get them (NP economy, NC Mall,
retired NC, Dyeworks, etc), and we're planning some cute actions you
can take, like shortcuts for getting them onto trade wishlists or into
your NC Mall cart.
This is just a little demo version of the page, just breaking down
items specified in the URL into NC/NP/PB! Later we'll do more granular
breakdown than this, with more info and actions—and we'll also like,
link to it at all, which isn't the case yet! (The main way we expect
people to get here is by a "Get these items" button we'll add to the
outfit editor, but there might be other paths, too.)
2024-05-06 20:37:59 -07:00
- if @pb_items.present?
2024-05-22 15:41:46 -07:00
%h2 Paint Brush items
2024-05-14 17:41:05 -07:00
:markdown
2024-05-22 15:41:46 -07:00
These items are part of a paint brush set. Once you paint your pet,
2024-05-14 17:41:05 -07:00
these items will be semi-permanently added to your Closet, even if your
pet changes color again! You can use this to mix-and-match styles for
"cross-paint" outfits.
2024-06-09 15:05:00 -07:00
2024-05-22 16:34:48 -07:00
- @pb_items_by_color.each do |color, items|
2024-05-22 16:59:36 -07:00
%table.item-list{"data-group-type": "bundle"}
2024-05-22 16:34:48 -07:00
%thead
2024-05-22 16:59:36 -07:00
%td.thumbnail-cell
Handle newly-released PB items in Item Getting Guide
Oh right, it's possible for `Item#pb?` to return true, but
`Item#pb_color` to return `nil`, if the item has the paintbrush item
description but we can't find a color whose name matches the item name.
This would be expected if a new color were added to Neopets, and PB
items for it were modeled by the community, but we hadn't manually
added the color to the database yet.
Previously, the Item Getting Guide would crash in this scenario. Now,
it correctly handles the possibility of a `nil` value for `pb_color`,
and shows some placeholder info.
To test this, I temporarily edited some item names to not contain the
color name anymore (e.g. "P-rate Elephante Shirt and Vest"), then
loaded the guide and made changes until it no longer crashed.
2024-06-05 19:20:57 -07:00
- if color&.pb_item_thumbnail_url?
2024-05-22 16:59:36 -07:00
= image_tag color.pb_item_thumbnail_url,
alt: "Item thumbnail for #{color.pb_item_name}"
Handle newly-released PB items in Item Getting Guide
Oh right, it's possible for `Item#pb?` to return true, but
`Item#pb_color` to return `nil`, if the item has the paintbrush item
description but we can't find a color whose name matches the item name.
This would be expected if a new color were added to Neopets, and PB
items for it were modeled by the community, but we hadn't manually
added the color to the database yet.
Previously, the Item Getting Guide would crash in this scenario. Now,
it correctly handles the possibility of a `nil` value for `pb_color`,
and shows some placeholder info.
To test this, I temporarily edited some item names to not contain the
color name anymore (e.g. "P-rate Elephante Shirt and Vest"), then
loaded the guide and made changes until it no longer crashed.
2024-06-05 19:20:57 -07:00
- elsif color
2024-05-22 17:53:52 -07:00
= image_tag pet_type_image_url(@pb_color_pet_types[color], size: :face),
srcset: ["#{pet_type_image_url(@pb_color_pet_types[color], size: :face_2x)} 2x"],
alt: @pb_color_pet_types[color].human_name
Fix handling of basic PB items in Item Getting Guide
Okay so, like 30 minutes ago I added fallback behavior for cases where
we can't correctly infer the color from a PB item's name… and then I
pulled it up in the color and found that, oh, right, there are already
3 PB items that *correctly* return `nil` for `Item#pb_color`: Aisha
Collar, Elephante Hat, and Ixi Collar.
This is because they're common items that apply to many colors, like
the basics, but also many other less-special or older color variants.
They are the most likely case where we'll return `nil`.
So, I've updated our fallback UI to, instead of talk vaguely about
missing data, just assume that we're dealing with basic items. In the
rare window of time where a new color is released, and we have PB items
for it but no manual color data yet, this can just incorrectly say
"Basic Colors" and that's fine.
2024-06-05 19:45:39 -07:00
- else
= image_tag "https://images.neopets.com/items/starter_red_pb.gif",
alt: "Item thumbnail for Starter Red Paint Brush"
2024-05-22 16:34:48 -07:00
%th
Handle newly-released PB items in Item Getting Guide
Oh right, it's possible for `Item#pb?` to return true, but
`Item#pb_color` to return `nil`, if the item has the paintbrush item
description but we can't find a color whose name matches the item name.
This would be expected if a new color were added to Neopets, and PB
items for it were modeled by the community, but we hadn't manually
added the color to the database yet.
Previously, the Item Getting Guide would crash in this scenario. Now,
it correctly handles the possibility of a `nil` value for `pb_color`,
and shows some placeholder info.
To test this, I temporarily edited some item names to not contain the
color name anymore (e.g. "P-rate Elephante Shirt and Vest"), then
loaded the guide and made changes until it no longer crashed.
2024-06-05 19:20:57 -07:00
- if color
#{color.pb_item_name || color.name.humanize}
- else
Fix handling of basic PB items in Item Getting Guide
Okay so, like 30 minutes ago I added fallback behavior for cases where
we can't correctly infer the color from a PB item's name… and then I
pulled it up in the color and found that, oh, right, there are already
3 PB items that *correctly* return `nil` for `Item#pb_color`: Aisha
Collar, Elephante Hat, and Ixi Collar.
This is because they're common items that apply to many colors, like
the basics, but also many other less-special or older color variants.
They are the most likely case where we'll return `nil`.
So, I've updated our fallback UI to, instead of talk vaguely about
missing data, just assume that we're dealing with basic items. In the
rare window of time where a new color is released, and we have PB items
for it but no manual color data yet, this can just incorrectly say
"Basic Colors" and that's fine.
2024-06-05 19:45:39 -07:00
Basic colors
2024-05-22 16:34:48 -07:00
(#{pluralize items.size, "item"})
%td.actions-cell
Handle newly-released PB items in Item Getting Guide
Oh right, it's possible for `Item#pb?` to return true, but
`Item#pb_color` to return `nil`, if the item has the paintbrush item
description but we can't find a color whose name matches the item name.
This would be expected if a new color were added to Neopets, and PB
items for it were modeled by the community, but we hadn't manually
added the color to the database yet.
Previously, the Item Getting Guide would crash in this scenario. Now,
it correctly handles the possibility of a `nil` value for `pb_color`,
and shows some placeholder info.
To test this, I temporarily edited some item names to not contain the
color name anymore (e.g. "P-rate Elephante Shirt and Vest"), then
loaded the guide and made changes until it no longer crashed.
2024-06-05 19:20:57 -07:00
- if color&.pb_item_name?
2024-05-22 15:41:46 -07:00
= button_link_to "Shops",
2024-05-22 16:34:48 -07:00
shop_wizard_url_for(color.pb_item_name),
2024-05-22 15:41:46 -07:00
target: "_blank", icon: search_icon
= button_link_to "Trades",
2024-05-22 16:34:48 -07:00
trading_post_url_for(color.pb_item_name),
2024-05-22 15:41:46 -07:00
target: "_blank", icon: search_icon
Handle newly-released PB items in Item Getting Guide
Oh right, it's possible for `Item#pb?` to return true, but
`Item#pb_color` to return `nil`, if the item has the paintbrush item
description but we can't find a color whose name matches the item name.
This would be expected if a new color were added to Neopets, and PB
items for it were modeled by the community, but we hadn't manually
added the color to the database yet.
Previously, the Item Getting Guide would crash in this scenario. Now,
it correctly handles the possibility of a `nil` value for `pb_color`,
and shows some placeholder info.
To test this, I temporarily edited some item names to not contain the
color name anymore (e.g. "P-rate Elephante Shirt and Vest"), then
loaded the guide and made changes until it no longer crashed.
2024-06-05 19:20:57 -07:00
- elsif color
2024-05-22 15:41:46 -07:00
.special-color-explanation
2024-05-22 16:34:48 -07:00
Get via Lab Ray, morphing potions, etc.
Handle newly-released PB items in Item Getting Guide
Oh right, it's possible for `Item#pb?` to return true, but
`Item#pb_color` to return `nil`, if the item has the paintbrush item
description but we can't find a color whose name matches the item name.
This would be expected if a new color were added to Neopets, and PB
items for it were modeled by the community, but we hadn't manually
added the color to the database yet.
Previously, the Item Getting Guide would crash in this scenario. Now,
it correctly handles the possibility of a `nil` value for `pb_color`,
and shows some placeholder info.
To test this, I temporarily edited some item names to not contain the
color name anymore (e.g. "P-rate Elephante Shirt and Vest"), then
loaded the guide and made changes until it no longer crashed.
2024-06-05 19:20:57 -07:00
- else
.special-color-explanation
2024-06-05 19:51:11 -07:00
Many colors, like Red, will grant these items.
2024-05-22 16:34:48 -07:00
%tbody
- items.each do |item|
= render "item_list_row", item:
2024-05-14 00:09:27 -07:00
- if @other_nc_items.present?
2024-06-09 13:25:59 -07:00
%h2 Neocash items (Capsules, events, retired, etc.)
2024-05-14 17:41:05 -07:00
:markdown
These items are part of the Neocash economy and can't be purchased with
Neopoints. We don't track all the details of how to get these items
right now! Sometimes they're available via packs or capsules or events
in the [NC Mall][mall]. Sometimes they're retired and can't be
purchased at all anymore, and can only be obtained via gifts or trades.
[mall]: https://ncmall.neopets.com/
2024-06-09 15:05:00 -07:00
2024-05-27 14:25:12 -07:00
%table.item-list
%thead
%td
%th{colspan: 2}
Total: #{pluralize @other_nc_items.size, "item"}
%tbody
- @other_nc_items.each do |item|
Move Item Getting Guide subtitle UI out of helpers, into templates
I thought to myself, "I wonder if it's possible to use a sneaky hacky
`content_for` trick to be able to run this code in the template." And
indeed it is!
It's tricky cuz like, I want to render this template, and I want to
provide _multiple_ slots of content to it. So, in this variant, we keep
the block as being primarily for the actions, but also optionally
accept `content_for :subtitle` inside that block, too.
Executing that correctly is a bit tricky! The subtitle comes *before*
the actions. So, we `yield` the actions block immediately, save it to a
variable, and *then* get the subtitle block.
2024-06-09 15:03:35 -07:00
= render "item_list_row", item: do
- content_for :subtitle, flush: true do
- if item.nc_trade_value.present?
= link_to "Owls listing: #{item.nc_trade_value.value_text}",
"https://www.neopets.com/~owls", target: "_blank",
title: 'Owls keeps track of approximate "capsule" values of NC items for trading. Items with similar values can often be traded for one another. This is an estimate, not a rule!'
2024-06-09 15:05:00 -07:00
2024-05-27 14:25:12 -07:00
= button_link_to "NC Trades",
item_trades_path(item, type: "offering"),
target: "_blank", icon: search_icon
2024-05-14 16:03:35 -07:00
- content_for :stylesheets do
= page_stylesheet_link_tag "items/sources"