1
0
Fork 0
forked from OpenNeo/impress

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.)
This commit is contained in:
Emi Matchu 2024-05-06 20:37:59 -07:00
parent 08130a4350
commit 9733ceae25
5 changed files with 36 additions and 1 deletions

View file

@ -1,6 +1,6 @@
@import "partials/campaign-progress"
body.items, body.item_trades
body.items-index, body.items-show, body.items-needed, body.item_trades
+campaign-progress
text-align: center

View file

@ -112,6 +112,22 @@ class ItemsController < ApplicationController
end
end
def sources
item_ids = params[:ids].split(",")
@items = Item.where(id: item_ids).order(:name)
if @items.empty?
render file: "public/404.html", status: :not_found, layout: nil
return
end
@nc_items = @items.select(&:nc?)
@np_items = @items.select(&:np?)
@pb_items = @items.select(&:pb?)
render layout: "application"
end
protected
def assign_closeted!

View file

@ -158,6 +158,10 @@ class Item < ApplicationRecord
I18n.with_locale(:en) { self.description == PAINTBRUSH_SET_DESCRIPTION }
end
def np?
!nc? && !pb?
end
def owned?
@owned || false
end

View file

@ -0,0 +1,14 @@
- title "Item Getting Guide"
%h1#title Item Getting Guide
- if @nc_items.present?
%h2 Neocash items
= render @nc_items
- if @np_items.present?
%h2 Neopoint items
= render @np_items
- if @pb_items.present?
%h2 Paintbrush items
= render @pb_items

View file

@ -27,6 +27,7 @@ OpenneoImpressItems::Application.routes.draw do
collection do
get :needed
get "sources/:ids", action: :sources
end
end
resources :species, only: [] do