Use full name when showing Alt Styles in the list

This commit is contained in:
Emi Matchu 2024-09-30 17:41:21 -07:00
parent dd8426fefd
commit 5890e52e53
3 changed files with 9 additions and 19 deletions

View file

@ -1,17 +1,3 @@
.alt-styles-header
margin-top: 1em
margin-bottom: .5em
.alt-styles-list
list-style: none
display: flex
flex-wrap: wrap
gap: 1.5em
.alt-style
text-align: center
width: 80px
.alt-style-thumbnail
width: 80px
height: 80px
.rainbow-pool-list
.name span
display: inline-block

View file

@ -24,11 +24,13 @@ class AltStyle < ApplicationRecord
order("DATE(created_at) DESC")
}
def name
def pet_name
I18n.translate('pet_types.human_name', color_human_name: color.human_name,
species_human_name: species.human_name)
end
alias_method :name, :pet_name
# If the series_name hasn't yet been set manually by support staff, show the
# string "<New?>" instead. But it won't be searchable by that string—that is,
# `fits:<New?>-faerie-draik` intentionally will not work, and the canonical

View file

@ -1,4 +1,6 @@
%li
= link_to view_or_edit_alt_style_url(alt_style) do
= image_tag alt_style.preview_image_url, class: "preview", loading: "lazy"
.name= alt_style.name
.name
%span= alt_style.series_name
%span= alt_style.pet_name