Add DTI 2020 link to item pages

Someone requested this in Discord, and I figured why not! I'm still
planning to move stuff away from Impress 2020 over time, I just figure
may as well have them more linked while this is still The Reality
This commit is contained in:
Emi Matchu 2024-03-13 17:46:45 -07:00
parent 9295ae75ad
commit 75418339da
3 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,5 @@
require "addressable/template"
module ItemsHelper module ItemsHelper
JNItemsURLFormat = 'https://items.jellyneo.net/search/?name=%s&name_type=3' JNItemsURLFormat = 'https://items.jellyneo.net/search/?name=%s&name_type=3'
@ -76,6 +78,13 @@ module ItemsHelper
sprintf(JNItemsURLFormat, CGI::escape(item.name)) sprintf(JNItemsURLFormat, CGI::escape(item.name))
end end
IMPRESS_2020_ITEM_URL_TEMPLATE = Addressable::Template.new(
"#{Rails.configuration.impress_2020_origin}/items/{id}"
)
def impress_2020_url_for(item)
IMPRESS_2020_ITEM_URL_TEMPLATE.expand(id: item.id).to_s
end
def shop_wizard_url_for(item) def shop_wizard_url_for(item)
"https://www.neopets.com/market.phtml?type=wizard&string=#{CGI::escape item.name}" "https://www.neopets.com/market.phtml?type=wizard&string=#{CGI::escape item.name}"
end end

View file

@ -26,6 +26,7 @@
}= time_with_only_month_if_old item.created_at }= time_with_only_month_if_old item.created_at
= link_to t('items.show.resources.jn_items'), jn_items_url_for(item) = link_to t('items.show.resources.jn_items'), jn_items_url_for(item)
= link_to t('items.show.resources.impress_2020'), impress_2020_url_for(item)
- if item.nc_trade_value - if item.nc_trade_value
= link_to t('items.show.resources.owls', value: item.nc_trade_value.value_text), = link_to t('items.show.resources.owls', value: item.nc_trade_value.value_text),
"https://www.neopets.com/~owls", "https://www.neopets.com/~owls",

View file

@ -309,6 +309,7 @@ en:
description: Only obtainable via paintbrush description: Only obtainable via paintbrush
resources: resources:
jn_items: JN Items jn_items: JN Items
impress_2020: DTI 2020
owls: "Owls: %{value}" owls: "Owls: %{value}"
shop_wizard: Shop Wizard shop_wizard: Shop Wizard
super_shop_wizard: Super Wizard super_shop_wizard: Super Wizard