1
0

instance_helper.rb 602 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. module InstanceHelper
  3. def site_title
  4. Setting.site_title
  5. end
  6. def site_hostname
  7. @site_hostname ||= Addressable::URI.parse("//#{Rails.configuration.x.local_domain}").display_uri.host
  8. end
  9. def description_for_sign_up(invite = nil)
  10. safe_join([description_prefix(invite), I18n.t('auth.description.suffix')], ' ')
  11. end
  12. private
  13. def description_prefix(invite)
  14. if invite.present?
  15. I18n.t('auth.description.prefix_invited_by_user', name: invite.user.account.username)
  16. else
  17. I18n.t('auth.description.prefix_sign_up')
  18. end
  19. end
  20. end