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 .rainbow-pool-list
margin-top: 1em .name span
margin-bottom: .5em display: inline-block
.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

View file

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

View file

@ -1,4 +1,6 @@
%li %li
= link_to view_or_edit_alt_style_url(alt_style) do = link_to view_or_edit_alt_style_url(alt_style) do
= image_tag alt_style.preview_image_url, class: "preview", loading: "lazy" = 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