accounts_helper.rb 524 B

123456789101112131415
  1. # frozen_string_literal: true
  2. module Admin::AccountsHelper
  3. def filter_params(more_params)
  4. params.permit(:local, :remote, :by_domain, :silenced, :suspended, :recent).merge(more_params)
  5. end
  6. def filter_link_to(text, more_params)
  7. link_to text, filter_params(more_params), class: params.merge(more_params).compact == params.compact ? 'selected' : ''
  8. end
  9. def table_link_to(icon, text, path, options = {})
  10. link_to safe_join([fa_icon(icon), text]), path, options.merge(class: 'table-action-link')
  11. end
  12. end