Add the "body fit" field to the item editing page

This commit is contained in:
Emi Matchu 2024-11-20 12:23:30 -08:00
parent f49f9f386d
commit c7bea666c9
2 changed files with 10 additions and 2 deletions

View file

@ -183,7 +183,7 @@ class ItemsController < ApplicationController
def item_params def item_params
params.require(:item).permit( params.require(:item).permit(
:name, :thumbnail_url, :description, :modeling_status_hint, :name, :thumbnail_url, :description, :modeling_status_hint,
:is_manually_nc :is_manually_nc, :explicitly_body_specific,
).tap do |p| ).tap do |p|
p[:modeling_status_hint] = nil if p[:modeling_status_hint] == "" p[:modeling_status_hint] = nil if p[:modeling_status_hint] == ""
end end

View file

@ -4,7 +4,7 @@
%h1#title Editing "#{@item.name}" %h1#title Editing "#{@item.name}"
:markdown :markdown
Heads up: the modeling process controls many of these fields by default! If Heads up: the modeling process controls some of these fields by default! If
you change something, but it doesn't match what we're seeing on Neopets.com, you change something, but it doesn't match what we're seeing on Neopets.com,
it will probably be reverted automatically when someone models it. it will probably be reverted automatically when someone models it.
@ -44,6 +44,14 @@
%label{title: "Use this when e.g. this fits the Blue Vandagyre even though it's a Maraquan item.\nBehaves identically to Done, but helps us remember why we did this!"} %label{title: "Use this when e.g. this fits the Blue Vandagyre even though it's a Maraquan item.\nBehaves identically to Done, but helps us remember why we did this!"}
= f.radio_button :modeling_status_hint, "glitchy" = f.radio_button :modeling_status_hint, "glitchy"
Glitchy: Neopets.com has <em>too many</em> models Glitchy: Neopets.com has <em>too many</em> models
.field-name Body fit
.radio-field
%label{title: "When an asset in a zone like Background is modeled, assume it fits all pets the same, and assign it body ID \#0.\nOtherwise, assume it fits only the kind of pet it was modeled on."}
= f.radio_button :explicitly_body_specific, false
Automatic: Some zones fit all species
%label{title: "Use this when an item uses a generally-universal zone like Static, but is body-specific regardless. \"Encased in Ice\" is one example.\nThis prevents these uncommon items from breaking every time they're modeled."}
= f.radio_button :explicitly_body_specific, true
Body-specific: Fits all species differently
.actions .actions
= f.submit "Save changes" = f.submit "Save changes"