闭社主体 forked from https://github.com/tootsuite/mastodon
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.

33 lines
735 B

8 years ago
8 years ago
  1. # frozen_string_literal: true
  2. module ApplicationHelper
  3. def active_nav_class(path)
  4. current_page?(path) ? 'active' : ''
  5. end
  6. def show_landing_strip?
  7. !user_signed_in? && !single_user_mode?
  8. end
  9. def open_registrations?
  10. Setting.open_registrations
  11. end
  12. def add_rtl_body_class(other_classes)
  13. other_classes = "#{other_classes} rtl" if [:ar, :fa, :he].include?(I18n.locale)
  14. other_classes
  15. end
  16. def favicon_path
  17. env_suffix = Rails.env.production? ? '' : '-dev'
  18. "/favicon#{env_suffix}.ico"
  19. end
  20. def title
  21. Rails.env.production? ? site_title : "#{site_title} (Dev)"
  22. end
  23. def fa_icon(icon)
  24. content_tag(:i, nil, class: 'fa ' + icon.split(' ').map { |cl| "fa-#{cl}" }.join(' '))
  25. end
  26. end