Commit cb6f0351 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Improve pipeline view

parent c351b9f5
class Projects::PipelinesController < Projects::ApplicationController class Projects::PipelinesController < Projects::ApplicationController
before_action :pipeline, except: [:index, :new, :create] before_action :pipeline, except: [:index, :new, :create]
before_action :commit, only: [:show]
before_action :authorize_read_pipeline! before_action :authorize_read_pipeline!
before_action :authorize_create_pipeline!, only: [:new, :create] before_action :authorize_create_pipeline!, only: [:new, :create]
before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action :authorize_update_pipeline!, only: [:retry, :cancel]
...@@ -85,4 +86,8 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -85,4 +86,8 @@ class Projects::PipelinesController < Projects::ApplicationController
def pipeline def pipeline
@pipeline ||= project.ci_commits.find_by!(id: params[:id]) @pipeline ||= project.ci_commits.find_by!(id: params[:id])
end end
def commit
@commit ||= @pipeline.commit_data
end
end end
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
= pluralize ci_commit.statuses.count(:id), "build" = pluralize ci_commit.statuses.count(:id), "build"
- if ci_commit.ref - if ci_commit.ref
for for
%span.label.label-info = link_to ci_commit.ref, namespace_project_commits_path(@project.namespace, @project, ci_commit.ref), class: "monospace"
= ci_commit.ref
- if defined?(link_to_commit) && link_to_commit - if defined?(link_to_commit) && link_to_commit
for commit for commit
= link_to ci_commit.short_sha, namespace_project_commit_path(@project.namespace, @project, ci_commit.sha), class: "monospace" = link_to ci_commit.short_sha, namespace_project_commit_path(@project.namespace, @project, ci_commit.sha), class: "monospace"
......
.pull-right .pull-right
%div %div
- if @notes_count > 0 - if defined?(@notes_count) && @notes_count > 0
%span.btn.disabled.btn-grouped %span.btn.disabled.btn-grouped
%i.fa.fa-comment %i.fa.fa-comment
= @notes_count = @notes_count
...@@ -42,7 +42,14 @@ ...@@ -42,7 +42,14 @@
- @commit.parents.each do |parent| - @commit.parents.each do |parent|
= link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "monospace" = link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "monospace"
- if @commit.status - if defined?(pipeline) && pipeline
.pull-right
= link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline), class: "ci-status ci-#{pipeline.status}" do
= ci_icon_for_status(pipeline.status)
pipeline:
= ci_label_for_status(pipeline.status)
- elsif @commit.status
.pull-right .pull-right
= link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status ci-#{@commit.status}" do = link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status ci-#{@commit.status}" do
= ci_icon_for_status(@commit.status) = ci_icon_for_status(@commit.status)
......
- page_title "Pipeline" - page_title "Pipeline"
= render "header_title" = render "header_title"
.prepend-top-default
- if @commit
= render "projects/commit/commit_box", pipeline: @pipeline
%div.block-connector
= render "projects/commit/ci_commit", ci_commit: @pipeline = render "projects/commit/ci_commit", ci_commit: @pipeline
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment