diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b6d9928cb..250225787 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -133,43 +133,21 @@ module ApplicationHelper match = el.match(sa_user) user = User.find_by_id(match[2].base62_decode) team ||= current_team - - if user && - team && - UserTeam.user_in_team(user, team).any? - user_t, = user - .user_teams - .where('user_teams.team_id = ?', team) - .first - - user_description = %(
#{user.email}
- #{I18n.t('atwho.popover_html', - role: user_t.role.capitalize, - team: user_t.team.name, - time: user_t.created_at.strftime('%B %Y'))} -
#{user.email}
#{user.email}
) + if team.present? + user_description += %(+ #{I18n.t('atwho.popover_html', + role: user_t.role.capitalize, + team: user_t.team.name, + time: user_t.created_at.strftime('%B %Y'))} +
) + else + user_description += %() + end raw(image_tag(Rails.application.routes.url_helpers .avatar_path(user, :icon_small),