mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-22 06:44:55 +08:00
Merge pull request #534 from okriuchykhin/ok_SCI_1127_v2
Add user popover method for users [SCI-1127]
This commit is contained in:
commit
8cff0a9a5b
1 changed files with 22 additions and 0 deletions
|
@ -167,4 +167,26 @@ module ApplicationHelper
|
|||
end
|
||||
new_text
|
||||
end
|
||||
|
||||
# Generate smart annotation link for one user object, without team
|
||||
def popover_for_user_name(user)
|
||||
user_description = %(<div class='col-xs-4'>
|
||||
<img src='#{Rails.application.routes.url_helpers
|
||||
.avatar_path(user, :thumb)}' alt='thumb'>
|
||||
</div><div class='col-xs-8'>
|
||||
<div class='row'><div class='col-xs-9 text-left'><h5>
|
||||
#{user.full_name}</h5></div><div class='col-xs-3 text-right'>
|
||||
<span class='glyphicon glyphicon-remove' aria-hidden='true'></span>
|
||||
</div></div><div class='row'><div class='col-xs-12'>
|
||||
<p class='silver'>#{user.email}</p><p></p></div></div></div>)
|
||||
|
||||
raw(image_tag(Rails.application.routes.url_helpers
|
||||
.avatar_path(user, :icon_small),
|
||||
class: 'atwho-user-img-popover')) +
|
||||
raw('<a onClick="$(this).popover(\'show\')" ' \
|
||||
'class="atwho-user-popover" data-container="body" ' \
|
||||
'data-html="true" tabindex="0" data-trigger="focus" ' \
|
||||
'data-placement="top" data-toggle="popover" data-content="') +
|
||||
raw(user_description) + raw('" >') + user.full_name + raw('</a>')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue