about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-09-03 04:56:54 +0200
committerGitHub <noreply@github.com>2019-09-03 04:56:54 +0200
commit3221f998dd1fcfc2111178637fbb1f712d9e8388 (patch)
tree95cc5987b51464187859ce3802ca874770c1db0d /app/helpers
parent34adc8784a3f165a4bd5719a067093f703f499e9 (diff)
Change OpenGraph description on sign-up page to reflect invite (#11744)
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/instance_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/instance_helper.rb b/app/helpers/instance_helper.rb
index dd0b25f3e..daacb535b 100644
--- a/app/helpers/instance_helper.rb
+++ b/app/helpers/instance_helper.rb
@@ -8,4 +8,16 @@ module InstanceHelper
   def site_hostname
     @site_hostname ||= Addressable::URI.parse("//#{Rails.configuration.x.local_domain}").display_uri.host
   end
+
+  def description_for_sign_up
+    prefix = begin
+      if @invite.present?
+        I18n.t('auth.description.prefix_invited_by_user', name: @invite.user.account.username)
+      else
+        I18n.t('auth.description.prefix_sign_up')
+      end
+    end
+
+    safe_join([prefix, I18n.t('auth.description.suffix')], ' ')
+  end
 end