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/serializers/concerns | |
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/serializers/concerns')
-rw-r--r-- | app/serializers/concerns/user_status_tooltip.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/serializers/concerns/user_status_tooltip.rb b/app/serializers/concerns/user_status_tooltip.rb new file mode 100644 index 00000000000..aa6e67e3351 --- /dev/null +++ b/app/serializers/concerns/user_status_tooltip.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module UserStatusTooltip + extend ActiveSupport::Concern + include ActionView::Helpers::TagHelper + include ActionView::Context + include EmojiHelper + include UsersHelper + + included do + expose :user_status_if_loaded, as: :status_tooltip_html + + def user_status_if_loaded + return nil unless object.association(:status).loaded? + + user_status(object) + end + end +end |