From f1d3ea63cf74d2791a9a863b29ab2d919ea61bd0 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 16 Jul 2018 18:18:52 +0200 Subject: 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 --- app/controllers/projects/commit_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/controllers/projects/commit_controller.rb') diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 1d1184d46d1..44b176d304e 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -22,7 +22,9 @@ class Projects::CommitController < Projects::ApplicationController apply_diff_view_cookie! respond_to do |format| - format.html { render } + format.html do + render + end format.diff do send_git_diff(@project.repository, @commit.diff_refs) end @@ -124,7 +126,10 @@ class Projects::CommitController < Projects::ApplicationController end def commit - @noteable = @commit ||= @project.commit_by(oid: params[:id]) + @noteable = @commit ||= @project.commit_by(oid: params[:id]).tap do |commit| + # preload author and their status for rendering + commit&.author&.status + end end def define_commit_vars -- cgit v1.2.1