From 952ea848681fb488bd3e0a09644476578f127712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Thu, 26 Oct 2023 10:06:27 +0900 Subject: [PATCH] =?UTF-8?q?Add:=20#173=20=E3=82=AB=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=83=A0=E7=B5=B5=E6=96=87=E5=AD=97=E6=96=B0=E8=A6=8F=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=83=BB=E7=B7=A8=E9=9B=86=E7=94=BB=E9=9D=A2=E3=81=AB?= =?UTF-8?q?=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E9=81=B8=E6=8A=9E=E6=AC=84?= =?UTF-8?q?=20(#175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump version to 8.0 * Add: 他のサーバーに公開する情報に、制限設定などを追加 * Fix: `quote_of_id`のインデックス * Fix: #172 他のサーバーからの相乗り絵文字削除が反映されない * Test: #166 リモートから自分の絵文字を受け取った時、ライセンスが上書きされないことを確認するテスト * Add: #173 カスタム絵文字新規作成・編集画面でのカテゴリ設定 --- app/controllers/admin/custom_emojis_controller.rb | 4 ++-- app/views/admin/custom_emojis/edit.html.haml | 3 +++ app/views/admin/custom_emojis/new.html.haml | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/custom_emojis_controller.rb b/app/controllers/admin/custom_emojis_controller.rb index f0b55ce064..d54bda4385 100644 --- a/app/controllers/admin/custom_emojis_controller.rb +++ b/app/controllers/admin/custom_emojis_controller.rb @@ -67,11 +67,11 @@ module Admin 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 diff --git a/app/views/admin/custom_emojis/edit.html.haml b/app/views/admin/custom_emojis/edit.html.haml index cde13d12e5..a984f18d62 100644 --- a/app/views/admin/custom_emojis/edit.html.haml +++ b/app/views/admin/custom_emojis/edit.html.haml @@ -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') diff --git a/app/views/admin/custom_emojis/new.html.haml b/app/views/admin/custom_emojis/new.html.haml index e1261e7f50..729c7a47a2 100644 --- a/app/views/admin/custom_emojis/new.html.haml +++ b/app/views/admin/custom_emojis/new.html.haml @@ -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')