From 1b618e88e54244e31d45d25f6da65911f5830eda Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 3 May 2017 10:50:43 +0200 Subject: [PATCH 1/2] fix reports pdf for user annotation [SCI-1051] --- app/helpers/application_helper.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c53c5b4e0..9641f46a5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -193,9 +193,8 @@ module ApplicationHelper .first end user_description = %(
- thumb -
+ thumb
#{user.full_name}
@@ -212,8 +211,7 @@ module ApplicationHelper user_description += %(

) end - raw(image_tag(Rails.application.routes.url_helpers - .avatar_path(user, :icon_small), + raw(image_tag(set_avatar_absolute_url(user, :icon_small), class: 'atwho-user-img-popover')) + raw('') + user.full_name + raw('') end + + def set_avatar_absolute_url(user, style) + unless user.avatar(style) == '/images/icon_small/missing.png' + return user.avatar(style) + end + URI.join(root_url, "/images/#{style}/missing.png").to_s + end end From 289a148332dadf314d8f19d5ced86d0a12095664 Mon Sep 17 00:00:00 2001 From: zmagod Date: Wed, 3 May 2017 15:33:23 +0200 Subject: [PATCH 2/2] refactor --- app/helpers/application_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9641f46a5..3fbccf1b8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -193,7 +193,7 @@ module ApplicationHelper .first end user_description = %(
- thumb
#{user.full_name}
@@ -211,7 +211,7 @@ module ApplicationHelper user_description += %(

) end - raw(image_tag(set_avatar_absolute_url(user, :icon_small), + raw(image_tag(user_avatar_absolute_url(user, :icon_small), class: 'atwho-user-img-popover')) + raw('') + user.full_name + raw('') end - def set_avatar_absolute_url(user, style) + def user_avatar_absolute_url(user, style) unless user.avatar(style) == '/images/icon_small/missing.png' return user.avatar(style) end