forked from OpenNeo/impress
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:
parent
9295ae75ad
commit
75418339da
3 changed files with 11 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
require "addressable/template"
|
||||
|
||||
module ItemsHelper
|
||||
JNItemsURLFormat = 'https://items.jellyneo.net/search/?name=%s&name_type=3'
|
||||
|
||||
|
@ -75,6 +77,13 @@ module ItemsHelper
|
|||
def jn_items_url_for(item)
|
||||
sprintf(JNItemsURLFormat, CGI::escape(item.name))
|
||||
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)
|
||||
"https://www.neopets.com/market.phtml?type=wizard&string=#{CGI::escape item.name}"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
}= 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.impress_2020'), impress_2020_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",
|
||||
|
|
|
@ -309,6 +309,7 @@ en:
|
|||
description: Only obtainable via paintbrush
|
||||
resources:
|
||||
jn_items: JN Items
|
||||
impress_2020: DTI 2020
|
||||
owls: "Owls: %{value}"
|
||||
shop_wizard: Shop Wizard
|
||||
super_shop_wizard: Super Wizard
|
||||
|
|
Loading…
Reference in a new issue