diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-27 13:32:21 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-27 13:32:21 +0100 |
commit | 1ad6b3696bdeedcc27af4db4f592b39942e19f7d (patch) | |
tree | d87c530d5160032527d0031711424f77e9945615 | |
parent | 42e3f0fd7888ab8ebe11801e01dd3ca1f33b20cf (diff) | |
download | gitlab-ce-1ad6b3696bdeedcc27af4db4f592b39942e19f7d.tar.gz |
Expose serialized pipelines for commit pipelines
-rw-r--r-- | app/controllers/projects/commit_controller.rb | 11 | ||||
-rw-r--r-- | app/views/projects/commit/pipelines.html.haml | 9 |
2 files changed, 15 insertions, 5 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index bfc59bcc862..c871043efbd 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -30,6 +30,17 @@ class Projects::CommitController < Projects::ApplicationController end def pipelines + @pipelines = @commit.pipelines.order(id: :desc) + + respond_to do |format| + format.html + format.json do + render json: PipelineSerializer + .new(project: @project, user: @current_user) + .with_pagination(request, response) + .represent(@pipelines) + end + end end def branches diff --git a/app/views/projects/commit/pipelines.html.haml b/app/views/projects/commit/pipelines.html.haml index 00e7cdd1729..89968cf4e0d 100644 --- a/app/views/projects/commit/pipelines.html.haml +++ b/app/views/projects/commit/pipelines.html.haml @@ -1,6 +1,5 @@ -- page_title "Pipelines", "#{@commit.title} (#{@commit.short_id})", "Commits" +- page_title 'Pipelines', "#{@commit.title} (#{@commit.short_id})", 'Commits' -= render "commit_box" - -= render "ci_menu" -= render "pipelines_list", pipelines: @commit.pipelines.order(id: :desc) += render 'commit_box' += render 'ci_menu' += render 'pipelines_list', pipelines: @pipelines |