Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-07-16 19:18:52 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-07-30 16:01:26 +0300
commitf1d3ea63cf74d2791a9a863b29ab2d919ea61bd0 (patch)
treec36c2b272fba917af321a4f16c34a5047407f3b2 /app/controllers/projects/commit_controller.rb
parentb4c4b48a8c0258ff266c523488aa169a1b5ea0f3 (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/controllers/projects/commit_controller.rb')
-rw-r--r--app/controllers/projects/commit_controller.rb9
1 files changed, 7 insertions, 2 deletions
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