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
668 B

  1. # frozen_string_literal: true
  2. class InstancePresenter
  3. delegate(
  4. :closed_registrations_message,
  5. :site_contact_email,
  6. :open_registrations,
  7. :site_description,
  8. :site_extended_description,
  9. :site_terms,
  10. to: Setting
  11. )
  12. def contact_account
  13. Account.find_local(Setting.site_contact_username)
  14. end
  15. def user_count
  16. Rails.cache.fetch('user_count') { User.confirmed.count }
  17. end
  18. def status_count
  19. Rails.cache.fetch('local_status_count') { Status.local.count }
  20. end
  21. def domain_count
  22. Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) }
  23. end
  24. def version_number
  25. Mastodon::Version
  26. end
  27. end