Use radio buttons for poses in Rainbow Pool form, instead of dropdown

Just a bit easier to find what you want! especially with the grid layout
This commit is contained in:
Emi Matchu 2024-09-27 22:34:52 -07:00
parent d5a901b917
commit 946a6326ac
3 changed files with 48 additions and 7 deletions

View file

@ -0,0 +1,25 @@
@import "../partials/clean/constants"
outfit-viewer
margin: 0 auto
.pose-options
list-style-type: none
display: grid
grid-template-columns: 1fr 1fr 1fr
gap: .25em
label
display: flex
align-items: center
gap: .5em
padding: .5em 1em
border: 1px solid $soft-border-color
border-radius: 1em
input
margin: 0
&:has(:checked)
background: $module-bg-color
border-color: $module-border-color

View file

@ -20,9 +20,17 @@ module PetStatesHelper
end end
end end
POSE_OPTIONS = %w(UNKNOWN HAPPY_FEM HAPPY_MASC SAD_FEM SAD_MASC SICK_FEM POSE_OPTIONS = %w(HAPPY_FEM SAD_FEM SICK_FEM HAPPY_MASC SAD_MASC SICK_MASC
SICK_MASC UNCONVERTED) UNCONVERTED UNKNOWN)
def pose_options def pose_options
POSE_OPTIONS.map { |p| [pose_name(p), p] } POSE_OPTIONS
end
def useful_pet_state_path(...)
if support_staff?
edit_pet_type_pet_state_path(...)
else
pet_type_pet_state_path(...)
end
end end
end end

View file

@ -27,16 +27,24 @@
- @pet_state.errors.each do |error| - @pet_state.errors.each do |error|
%li= error.full_message %li= error.full_message
%dl %dl
%dt= f.label :pose %dt Pose
%dd= f.select :pose, pose_options %dd
%dt= f.label :glitched, "Glitched?" %ul.pose-options
%dd= f.select :glitched, [["✅ Not marked as Glitched", false], - pose_options.each do |pose|
%li
%label
= f.radio_button :pose, pose
= pose_name pose
%dt Glitched?
%dd
= f.select :glitched, [["✅ Not marked as Glitched", false],
["👾 Yes, it's bad news bonko'd", true]] ["👾 Yes, it's bad news bonko'd", true]]
= f.submit "Save" = f.submit "Save"
- content_for :stylesheets do - content_for :stylesheets do
= stylesheet_link_tag "application/breadcrumbs" = stylesheet_link_tag "application/breadcrumbs"
= stylesheet_link_tag "application/outfit-viewer" = stylesheet_link_tag "application/outfit-viewer"
= page_stylesheet_link_tag "pet_states/edit"
- content_for :javascripts do - content_for :javascripts do
= javascript_include_tag "outfit-viewer" = javascript_include_tag "outfit-viewer"