diff options
Diffstat (limited to 'app/helpers/home_helper.rb')
-rw-r--r-- | app/helpers/home_helper.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index 9b3f1380b..df60b7dd7 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -56,4 +56,22 @@ module HomeHelper 'emojify' end end + + def optional_link_to(condition, path, options = {}, &block) + if condition + link_to(path, options, &block) + else + content_tag(:div, &block) + end + end + + def sign_up_message + if closed_registrations? + t('auth.registration_closed', instance: site_hostname) + elsif open_registrations? + t('auth.register') + elsif approved_registrations? + t('auth.apply_for_account') + end + end end |