Skip to content

Commit

Permalink
Add: #173 カスタム絵文字新規作成・編集画面にカテゴリ選択欄 (#175)
Browse files Browse the repository at this point in the history
* Bump version to 8.0

* Add: 他のサーバーに公開する情報に、制限設定などを追加

* Fix: `quote_of_id`のインデックス

* Fix: #172 他のサーバーからの相乗り絵文字削除が反映されない

* Test: #166 リモートから自分の絵文字を受け取った時、ライセンスが上書きされないことを確認するテスト

* Add: #173 カスタム絵文字新規作成・編集画面でのカテゴリ設定
  • Loading branch information
kmycode authored Oct 26, 2023
1 parent e2bc9be commit 952ea84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/admin/custom_emojis_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ def set_custom_emoji
end

def resource_params
params.require(:custom_emoji).permit(:shortcode, :image, :visible_in_picker, :aliases_raw, :license)
params.require(:custom_emoji).permit(:shortcode, :image, :category_id, :visible_in_picker, :aliases_raw, :license)
end

def update_params
params.require(:custom_emoji).permit(:visible_in_picker, :aliases_raw, :license)
params.require(:custom_emoji).permit(:category_id, :visible_in_picker, :aliases_raw, :license)
end

def filtered_custom_emojis
Expand Down
3 changes: 3 additions & 0 deletions app/views/admin/custom_emojis/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
- if @custom_emoji.local?
%h4= t('admin.custom_emojis.edit.label')

.fields-group
= f.select :category_id, options_from_collection_for_select(CustomEmojiCategory.all, 'id', 'name'), prompt: t('admin.custom_emojis.assign_category'), class: 'select optional', 'aria-label': t('admin.custom_emojis.assign_category')

.fields-group
= f.input :visible_in_picker, as: :boolean, wrapper: :with_label, label: t('admin.custom_emojis.visible_in_picker')

Expand Down
3 changes: 3 additions & 0 deletions app/views/admin/custom_emojis/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
.fields-group
= f.input :image, wrapper: :with_label, input_html: { accept: CustomEmoji::IMAGE_MIME_TYPES.join(' ') }, hint: t('admin.custom_emojis.image_hint', size: number_to_human_size(CustomEmoji::LIMIT))

.fields-group
= f.select :category_id, options_from_collection_for_select(CustomEmojiCategory.all, 'id', 'name'), prompt: t('admin.custom_emojis.assign_category'), class: 'select optional', 'aria-label': t('admin.custom_emojis.assign_category')

.fields-group
= f.input :visible_in_picker, as: :boolean, wrapper: :with_label, label: t('admin.custom_emojis.visible_in_picker')

Expand Down

0 comments on commit 952ea84

Please sign in to comment.