summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/projects/commit_controller.rb11
-rw-r--r--app/views/projects/commit/pipelines.html.haml9
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