mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 12:50:27 +08:00
This adds the `emoji_picker_pinned_groups` site setting for pinning emoji groups at the top of the emoji picker list. It accepts both custom & non custom emoji group names, and can be ordered to preference. If a custom emoji group is added, and the group is deleted, it will gracefully ignore the missing group. A validator is included to ensure the site setting is correct at time of save. <img width="912" height="228" alt="image" src="https://github.com/user-attachments/assets/0a832cd9-146d-4d46-b9d1-4e8d4ea3b30d" /> <img width="464" height="354" alt="image" src="https://github.com/user-attachments/assets/2512df0e-035c-457a-bed3-b5d0ac3edc2c" /> --------- Co-authored-by: Martin Brennan <martin@discourse.org>
19 lines
461 B
Ruby
Vendored
19 lines
461 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
class EmojisController < ApplicationController
|
|
def index
|
|
render json: MultiJson.dump(Emoji.grouped)
|
|
end
|
|
|
|
def search_aliases
|
|
aliases = Emoji.search_aliases
|
|
|
|
locale_aliases = Emoji.locale_search_aliases(I18n.locale)
|
|
if locale_aliases
|
|
aliases =
|
|
aliases.merge(locale_aliases) { |_key, base_val, locale_val| (base_val + locale_val).uniq }
|
|
end
|
|
|
|
render json: MultiJson.dump(aliases)
|
|
end
|
|
end
|