2017-09-19 11:52:38 +10:00
|
|
|
- content_for :page_title do
|
|
|
|
= t('admin.custom_emojis.title')
|
|
|
|
|
2020-06-05 23:23:27 +10:00
|
|
|
- if can?(:create, :custom_emoji)
|
|
|
|
- content_for :heading_actions do
|
|
|
|
= link_to t('admin.custom_emojis.upload'), new_admin_custom_emoji_path, class: 'button'
|
2020-01-11 12:14:45 +11:00
|
|
|
|
2017-10-06 08:42:05 +11:00
|
|
|
.filters
|
|
|
|
.filter-subset
|
|
|
|
%strong= t('admin.accounts.location.title')
|
|
|
|
%ul
|
|
|
|
%li= filter_link_to t('admin.accounts.location.all'), local: nil, remote: nil
|
|
|
|
%li
|
|
|
|
- if selected? local: '1', remote: nil
|
2023-03-16 06:07:43 +11:00
|
|
|
= filter_link_to t('admin.accounts.location.local'), { local: nil, remote: nil }, { local: '1', remote: nil }
|
2017-10-06 08:42:05 +11:00
|
|
|
- else
|
|
|
|
= filter_link_to t('admin.accounts.location.local'), local: '1', remote: nil
|
|
|
|
%li
|
|
|
|
- if selected? remote: '1', local: nil
|
2023-03-16 06:07:43 +11:00
|
|
|
= filter_link_to t('admin.accounts.location.remote'), { remote: nil, local: nil }, { remote: '1', local: nil }
|
2017-10-06 08:42:05 +11:00
|
|
|
- else
|
|
|
|
= filter_link_to t('admin.accounts.location.remote'), remote: '1', local: nil
|
|
|
|
|
2024-06-14 19:49:10 +10:00
|
|
|
= form_with url: admin_custom_emojis_url, method: :get, class: :simple_form do |form|
|
2017-12-13 23:28:31 +11:00
|
|
|
.fields-group
|
2020-01-21 01:55:03 +11:00
|
|
|
- CustomEmojiFilter::KEYS.each do |key|
|
2024-06-14 19:49:10 +10:00
|
|
|
= form.hidden_field key, value: params[key] if params[key].present?
|
2017-12-13 23:28:31 +11:00
|
|
|
|
|
|
|
- %i(shortcode by_domain).each do |key|
|
|
|
|
.input.string.optional
|
2024-06-14 19:49:10 +10:00
|
|
|
= form.text_field key,
|
|
|
|
value: params[key],
|
|
|
|
class: 'string optional',
|
|
|
|
placeholder: I18n.t("admin.custom_emojis.#{key}")
|
2017-12-13 23:28:31 +11:00
|
|
|
|
|
|
|
.actions
|
2020-06-26 08:36:30 +10:00
|
|
|
%button.button= t('admin.accounts.search')
|
2017-12-30 12:43:43 +11:00
|
|
|
= link_to t('admin.accounts.reset'), admin_custom_emojis_path, class: 'button negative'
|
2017-12-13 23:28:31 +11:00
|
|
|
|
2024-06-14 19:54:22 +10:00
|
|
|
= form_with model: @form, url: batch_admin_custom_emojis_path do |f|
|
2019-09-10 06:44:17 +10:00
|
|
|
= hidden_field_tag :page, params[:page] || 1
|
|
|
|
|
2020-01-21 01:55:03 +11:00
|
|
|
- CustomEmojiFilter::KEYS.each do |key|
|
2019-09-10 06:44:17 +10:00
|
|
|
= hidden_field_tag key, params[key] if params[key].present?
|
|
|
|
|
|
|
|
.batch-table
|
|
|
|
.batch-table__toolbar
|
|
|
|
%label.batch-table__toolbar__select.batch-checkbox-all
|
|
|
|
= check_box_tag :batch_checkbox_all, nil, false
|
|
|
|
.batch-table__toolbar__actions
|
|
|
|
- if params[:local] == '1'
|
2024-08-08 09:08:36 +10:00
|
|
|
= f.button safe_join([material_symbol('save'), t('generic.save_changes')]), name: :update, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
2019-09-10 06:44:17 +10:00
|
|
|
|
2024-04-24 02:43:49 +10:00
|
|
|
= f.button safe_join([material_symbol('visibility'), t('admin.custom_emojis.list')]), name: :list, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
2019-09-10 06:44:17 +10:00
|
|
|
|
2024-04-24 02:43:49 +10:00
|
|
|
= f.button safe_join([material_symbol('visibility_off'), t('admin.custom_emojis.unlist')]), name: :unlist, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
2019-09-10 06:44:17 +10:00
|
|
|
|
2024-08-08 09:08:36 +10:00
|
|
|
= f.button safe_join([material_symbol('radio_button_checked'), t('admin.custom_emojis.enable')]), name: :enable, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
2019-09-10 06:44:17 +10:00
|
|
|
|
2024-08-08 09:08:36 +10:00
|
|
|
= f.button safe_join([material_symbol('radio_button_unchecked'), t('admin.custom_emojis.disable')]), name: :disable, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
2019-09-10 06:44:17 +10:00
|
|
|
|
2020-06-05 23:23:27 +10:00
|
|
|
- if can?(:destroy, :custom_emoji)
|
2024-04-24 02:43:49 +10:00
|
|
|
= f.button safe_join([material_symbol('close'), t('admin.custom_emojis.delete')]), name: :delete, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
2019-09-10 06:44:17 +10:00
|
|
|
|
2020-06-05 23:23:27 +10:00
|
|
|
- if can?(:copy, :custom_emoji) && params[:local] != '1'
|
2024-04-24 02:43:49 +10:00
|
|
|
= f.button safe_join([material_symbol('content_copy'), t('admin.custom_emojis.copy')]), name: :copy, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
2019-09-10 06:44:17 +10:00
|
|
|
|
|
|
|
- if params[:local] == '1'
|
|
|
|
.batch-table__form.simple_form
|
|
|
|
.fields-row
|
|
|
|
.fields-group.fields-row__column.fields-row__column-6
|
|
|
|
.input.select.optional
|
|
|
|
.label_input
|
2024-03-15 22:19:00 +11:00
|
|
|
= f.select :category_id,
|
|
|
|
options_from_collection_for_select(CustomEmojiCategory.all, 'id', 'name'),
|
|
|
|
'aria-label': t('admin.custom_emojis.assign_category'),
|
|
|
|
class: 'select optional',
|
|
|
|
prompt: t('admin.custom_emojis.assign_category')
|
2019-09-10 06:44:17 +10:00
|
|
|
|
|
|
|
.fields-group.fields-row__column.fields-row__column-6
|
|
|
|
.input.string.optional
|
|
|
|
.label_input
|
2024-03-15 22:19:00 +11:00
|
|
|
= f.text_field :category_name,
|
|
|
|
'aria-label': t('admin.custom_emojis.create_new_category'),
|
|
|
|
class: 'string optional',
|
|
|
|
placeholder: t('admin.custom_emojis.create_new_category')
|
2019-09-10 06:44:17 +10:00
|
|
|
|
|
|
|
.batch-table__body
|
|
|
|
- if @custom_emojis.empty?
|
|
|
|
= nothing_here 'nothing-here--under-tabs'
|
|
|
|
- else
|
|
|
|
= render partial: 'custom_emoji', collection: @custom_emojis, locals: { f: f }
|
2017-09-19 11:52:38 +10:00
|
|
|
|
2017-10-06 08:42:05 +11:00
|
|
|
= paginate @custom_emojis
|