aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/link_to_helper.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-02-14 05:12:18 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-02-15 12:22:24 +1100
commit114d00d1c1e2a997d1921ae044ed7d51237b6434 (patch)
treecc43438a6113609884709833d795e1b6f074605c /app/helpers/link_to_helper.rb
parentb8654ca1f3e8b26a2f900dacbccce312376ff888 (diff)
Make links relative
Diffstat (limited to 'app/helpers/link_to_helper.rb')
-rwxr-xr-xapp/helpers/link_to_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index f32ab9b64..7d0dd7766 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -149,6 +149,10 @@ module LinkToHelper
link_to h(user.name), main_url(user_path(user))
end
+ def user_link(user)
+ link_to h(user.name), user_path(user)
+ end
+
def request_user_link_absolute(request)
if request.is_external?
request.external_user_name || _("Anonymous user")
@@ -157,6 +161,14 @@ module LinkToHelper
end
end
+ def request_user_link(request)
+ if request.is_external?
+ request.external_user_name || _("Anonymous user")
+ else
+ user_link(request.user)
+ end
+ end
+
def user_or_you_link(user)
if @user && user == @user
link_to h("you"), user_path(user)