The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

27 line
698 B

  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, :resolved).merge(more_params)
  5. end
  6. def filter_link_to(text, more_params)
  7. new_url = filtered_url_for(more_params)
  8. link_to text, new_url, class: filter_link_class(new_url)
  9. end
  10. def table_link_to(icon, text, path, options = {})
  11. link_to safe_join([fa_icon(icon), text]), path, options.merge(class: 'table-action-link')
  12. end
  13. private
  14. def filter_link_class(new_url)
  15. filtered_url_for(params) == new_url ? 'selected' : ''
  16. end
  17. def filtered_url_for(params)
  18. url_for filter_params(params)
  19. end
  20. end