mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 03:46:39 +08:00
Merge pull request #582 from ZmagoD/zd_SCI_1051
fix reports pdf for user annotation [SCI-1051]
This commit is contained in:
commit
e47bf8f013
1 changed files with 10 additions and 5 deletions
|
@ -193,9 +193,8 @@ module ApplicationHelper
|
||||||
.first
|
.first
|
||||||
end
|
end
|
||||||
user_description = %(<div class='col-xs-4'>
|
user_description = %(<div class='col-xs-4'>
|
||||||
<img src='#{Rails.application.routes.url_helpers
|
<img src='#{user_avatar_absolute_url(user, :thumb)}'
|
||||||
.avatar_path(user, :thumb)}' alt='thumb'>
|
alt='thumb'></div><div class='col-xs-8'>
|
||||||
</div><div class='col-xs-8'>
|
|
||||||
<div class='row'><div class='col-xs-9 text-left'><h5>
|
<div class='row'><div class='col-xs-9 text-left'><h5>
|
||||||
#{user.full_name}</h5></div><div class='col-xs-3 text-right'>
|
#{user.full_name}</h5></div><div class='col-xs-3 text-right'>
|
||||||
<span class='glyphicon glyphicon-remove' aria-hidden='true'></span>
|
<span class='glyphicon glyphicon-remove' aria-hidden='true'></span>
|
||||||
|
@ -212,8 +211,7 @@ module ApplicationHelper
|
||||||
user_description += %(<p></p></div></div></div>)
|
user_description += %(<p></p></div></div></div>)
|
||||||
end
|
end
|
||||||
|
|
||||||
raw(image_tag(Rails.application.routes.url_helpers
|
raw(image_tag(user_avatar_absolute_url(user, :icon_small),
|
||||||
.avatar_path(user, :icon_small),
|
|
||||||
class: 'atwho-user-img-popover')) +
|
class: 'atwho-user-img-popover')) +
|
||||||
raw('<a onClick="$(this).popover(\'show\')" ' \
|
raw('<a onClick="$(this).popover(\'show\')" ' \
|
||||||
'class="atwho-user-popover" data-container="body" ' \
|
'class="atwho-user-popover" data-container="body" ' \
|
||||||
|
@ -221,4 +219,11 @@ module ApplicationHelper
|
||||||
'data-placement="top" data-toggle="popover" data-content="') +
|
'data-placement="top" data-toggle="popover" data-content="') +
|
||||||
raw(user_description) + raw('" >') + user.full_name + raw('</a>')
|
raw(user_description) + raw('" >') + user.full_name + raw('</a>')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_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
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue