nas/app/views/admin/sensitive_words/show.html.haml
KMY(雪あすか) ed246f0d03
Change: #648 センシティブワードの入力フォーム (#653)
* Change: #648 センシティブワードの入力フォーム

* Wip: 行の追加削除

* Wip: 設定の保存、マイグレーション

* 不要な処理を削除

* マイグレーションコード調整
2024-03-19 08:18:34 +09:00

42 lines
1.8 KiB
Text

- content_for :page_title do
= t('admin.sensitive_words.title')
- content_for :header_tags do
= javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
= simple_form_for @admin_settings, url: admin_sensitive_words_path, html: { method: :post } do |f|
= render 'shared/error_messages', object: @admin_settings
%p.lead= t 'admin.sensitive_words.hint'
%p= t 'admin.sensitive_words.phrases.regexp_html'
%p= t 'admin.sensitive_words.phrases.remote_html'
%p= t 'admin.sensitive_words.phrases.spoiler_html'
%hr/
.table-wrapper
%table.table.keywords-table#sensitive-words-table
%thead
%tr
%th= t('simple_form.labels.defaults.phrase')
%th= t('admin.sensitive_words.phrases.regexp_short')
%th= t('admin.sensitive_words.phrases.remote_short')
%th= t('admin.sensitive_words.phrases.spoiler_short')
%th
%tbody
= f.simple_fields_for :sensitive_words_test, @sensitive_words do |keyword|
= render partial: 'sensitive_word', collection: @sensitive_words, locals: { f: keyword, template: false }
= f.simple_fields_for :sensitive_words_test, @sensitive_words do |keyword|
= render partial: 'sensitive_word', collection: [SensitiveWord.new], locals: { f: keyword, template: true }
%tfoot
%tr
%td{ colspan: 4 }
= link_to safe_join([fa_icon('plus'), t('filters.edit.add_keyword')]), '#', class: 'table-action-link add-row-button'
.fields-group
= f.input :auto_warning_text, wrapper: :with_label, input_html: { placeholder: t('admin.sensitive_words.alert') }, label: t('admin.sensitive_words.auto_warning_text'), hint: t('admin.sensitive_words.auto_warning_text_hint')
.actions
= f.button :button, t('generic.save_changes'), type: :submit