where i deviate from standard mastodon assets
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html.haml 4.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. - content_for :page_title do
  2. = t('admin.custom_emojis.title')
  3. - content_for :heading_actions do
  4. = link_to t('admin.custom_emojis.upload'), new_admin_custom_emoji_path, class: 'button'
  5. .filters
  6. .filter-subset
  7. %strong= t('admin.accounts.location.title')
  8. %ul
  9. %li= filter_link_to t('admin.accounts.location.all'), local: nil, remote: nil
  10. %li
  11. - if selected? local: '1', remote: nil
  12. = filter_link_to t('admin.accounts.location.local'), {local: nil, remote: nil}, {local: '1', remote: nil}
  13. - else
  14. = filter_link_to t('admin.accounts.location.local'), local: '1', remote: nil
  15. %li
  16. - if selected? remote: '1', local: nil
  17. = filter_link_to t('admin.accounts.location.remote'), {remote: nil, local: nil}, {remote: '1', local: nil}
  18. - else
  19. = filter_link_to t('admin.accounts.location.remote'), remote: '1', local: nil
  20. = form_tag admin_custom_emojis_url, method: 'GET', class: 'simple_form' do
  21. .fields-group
  22. - CustomEmojiFilter::KEYS.each do |key|
  23. = hidden_field_tag key, params[key] if params[key].present?
  24. - %i(shortcode by_domain).each do |key|
  25. .input.string.optional
  26. = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.custom_emojis.#{key}")
  27. .actions
  28. %button= t('admin.accounts.search')
  29. = link_to t('admin.accounts.reset'), admin_custom_emojis_path, class: 'button negative'
  30. = form_for(@form, url: batch_admin_custom_emojis_path) do |f|
  31. = hidden_field_tag :page, params[:page] || 1
  32. - CustomEmojiFilter::KEYS.each do |key|
  33. = hidden_field_tag key, params[key] if params[key].present?
  34. .batch-table
  35. .batch-table__toolbar
  36. %label.batch-table__toolbar__select.batch-checkbox-all
  37. = check_box_tag :batch_checkbox_all, nil, false
  38. .batch-table__toolbar__actions
  39. - if params[:local] == '1'
  40. = f.button safe_join([fa_icon('save'), t('generic.save_changes')]), name: :update, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  41. = f.button safe_join([fa_icon('eye'), t('admin.custom_emojis.list')]), name: :list, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  42. = f.button safe_join([fa_icon('eye-slash'), t('admin.custom_emojis.unlist')]), name: :unlist, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  43. = f.button safe_join([fa_icon('power-off'), t('admin.custom_emojis.enable')]), name: :enable, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  44. = f.button safe_join([fa_icon('power-off'), t('admin.custom_emojis.disable')]), name: :disable, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  45. = f.button safe_join([fa_icon('times'), t('admin.custom_emojis.delete')]), name: :delete, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  46. - unless params[:local] == '1'
  47. = f.button safe_join([fa_icon('copy'), t('admin.custom_emojis.copy')]), name: :copy, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  48. - if params[:local] == '1'
  49. .batch-table__form.simple_form
  50. .fields-row
  51. .fields-group.fields-row__column.fields-row__column-6
  52. .input.select.optional
  53. .label_input
  54. = 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')
  55. .fields-group.fields-row__column.fields-row__column-6
  56. .input.string.optional
  57. .label_input
  58. = f.text_field :category_name, class: 'string optional', placeholder: t('admin.custom_emojis.create_new_category'), 'aria-label': t('admin.custom_emojis.create_new_category')
  59. .batch-table__body
  60. - if @custom_emojis.empty?
  61. = nothing_here 'nothing-here--under-tabs'
  62. - else
  63. = render partial: 'custom_emoji', collection: @custom_emojis, locals: { f: f }
  64. = paginate @custom_emojis