diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-07-09 12:42:47 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-07-09 12:42:47 +0100 |
commit | 049198b25c7033ad6d69ec0907679025a54f89db (patch) | |
tree | 1eac389a66b1d6e3fa15f318bf649cb463f8368f /app/helpers/link_to_helper.rb | |
parent | d314c21449823f62afdb708b27ad327443162d8c (diff) |
Ensure (at least in the most basic cases) that views support recent "external request" changes (mainly that InfoRequests no longer necessarily have a User).
Diffstat (limited to 'app/helpers/link_to_helper.rb')
-rwxr-xr-x | app/helpers/link_to_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 1a86333b6..01332c5ab 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -93,6 +93,14 @@ module LinkToHelper def user_link(user, cls=nil) link_to h(user.name), user_url(user), :class => cls end + def user_link_for_request(request, cls=nil) + if request.is_external? + request.external_user_name || _("Anonymous user") + else + link_to h(request.user.name), user_url(request.user), :class => cls + end + end + def user_link_absolute(user) link_to h(user.name), main_url(user_url(user)) end |