diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-07-09 12:42:47 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-08-16 15:38:37 +0100 |
commit | 9289239593e4a64eb51b4183ab70357642810a25 (patch) | |
tree | e34890af01c0a19a0cc793583d212ef13f46a213 /app/helpers/link_to_helper.rb | |
parent | 32f44e53c879481198bdc02044d4fd3c892ce801 (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).
Conflicts:
app/controllers/admin_request_controller.rb
app/views/request/show.rhtml
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 |