mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-24 02:51:43 +01:00
Order emoji categories (in admin interface) by name (#33630)
This commit is contained in:
parent
3dcf5e12b1
commit
e380e803a8
@ -14,4 +14,6 @@ class CustomEmojiCategory < ApplicationRecord
|
|||||||
has_many :emojis, class_name: 'CustomEmoji', foreign_key: 'category_id', inverse_of: :category, dependent: nil
|
has_many :emojis, class_name: 'CustomEmoji', foreign_key: 'category_id', inverse_of: :category, dependent: nil
|
||||||
|
|
||||||
validates :name, presence: true, uniqueness: true
|
validates :name, presence: true, uniqueness: true
|
||||||
|
|
||||||
|
scope :alphabetic, -> { order(name: :asc) }
|
||||||
end
|
end
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
.input.select.optional
|
.input.select.optional
|
||||||
.label_input
|
.label_input
|
||||||
= f.select :category_id,
|
= f.select :category_id,
|
||||||
options_from_collection_for_select(CustomEmojiCategory.all, 'id', 'name'),
|
options_from_collection_for_select(CustomEmojiCategory.alphabetic.all, 'id', 'name'),
|
||||||
'aria-label': t('admin.custom_emojis.assign_category'),
|
'aria-label': t('admin.custom_emojis.assign_category'),
|
||||||
class: 'select optional',
|
class: 'select optional',
|
||||||
prompt: t('admin.custom_emojis.assign_category')
|
prompt: t('admin.custom_emojis.assign_category')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user