diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-16 19:18:52 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-07-30 16:01:26 +0300 |
commit | f1d3ea63cf74d2791a9a863b29ab2d919ea61bd0 (patch) | |
tree | c36c2b272fba917af321a4f16c34a5047407f3b2 /app/helpers/users_helper.rb | |
parent | b4c4b48a8c0258ff266c523488aa169a1b5ea0f3 (diff) |
Show the status of a user in interactions
The status is shown for
- The author of a commit when viewing a commit
- Notes on a commit (regular/diff)
- The user that triggered a pipeline when viewing a pipeline
- The author of a merge request when viewing a merge request
- The author of notes on a merge request (regular/diff)
- The author of an issue when viewing an issue
- The author of notes on an issue
- The author of a snippet when viewing a snippet
- The author of notes on a snippet
- A user's profile page
- The list of members of a group/user
Diffstat (limited to 'app/helpers/users_helper.rb')
-rw-r--r-- | app/helpers/users_helper.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 8ee4203b6f5..ceea4384f91 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -39,6 +39,24 @@ module UsersHelper "access:#{max_project_member_access(project)}" end + def user_status(user) + return unless user + + unless user.association(:status).loaded? + exception = RuntimeError.new("Status was not preloaded") + Gitlab::Sentry.track_exception(exception, extra: { user: user.inspect }) + end + + return unless user.status + + content_tag :span, + class: 'user-status-emoji has-tooltip', + title: user.status.message_html, + data: { html: true, placement: 'top' } do + emoji_icon user.status.emoji + end + end + private def get_profile_tabs |