Add: カスタム絵文字の専用編集画面/Fix: リモートの絵文字をローカルにコピー時、ライセンス情報が消失する問題 (#133)

* Add: カスタム絵文字の専用編集画面

* 新規作成画面に項目追加、編集画面に画像表示、旧テキストボックス削除

* Fix: カスタム絵文字のコピー処理で、コピーされていないプロパティがあった
This commit is contained in:
KMY(雪あすか) 2023-10-17 16:07:27 +09:00 committed by GitHub
parent 72d18cb16d
commit 4735d23c21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 115 additions and 14 deletions

View file

@ -0,0 +1,42 @@
- content_for :page_title do
= t('.title')
= simple_form_for @custom_emoji, url: admin_custom_emoji_path(@custom_emoji.id), method: :put do |f|
= render 'shared/error_messages', object: @custom_emoji
- CustomEmojiFilter::KEYS.each do |key|
= hidden_field_tag key, params[key] if params[key].present?
.fields-group
= custom_emoji_tag(@custom_emoji)
%h4= t('admin.custom_emojis.shortcode')
.fields-group
%samp= @custom_emoji.shortcode
- if !@custom_emoji.local?
%h4= t('admin.custom_emojis.domain')
.fields-group
%samp= @custom_emoji.domain
- if @custom_emoji.local?
%h4= t('admin.custom_emojis.edit.label')
.fields-group
= f.input :visible_in_picker, as: :boolean, wrapper: :with_label, label: t('admin.custom_emojis.visible_in_picker')
.fields-group
= f.input :aliases_raw, wrapper: :with_label, kmyblue: true, label: t('admin.custom_emojis.aliases'), hint: t('admin.custom_emojis.aliases_hint')
.fields-group
= f.input :license, wrapper: :with_label, kmyblue: true, label: t('admin.custom_emojis.license'), hint: t('admin.custom_emojis.license_hint')
.actions
= f.button :button, t('generic.save_changes'), type: :submit
- elsif @custom_emoji.license.present?
%h4= t('admin.custom_emojis.license')
.fields-group
%p= @custom_emoji.license