提交 cb6f0351 编写于 作者: K Kamil Trzcinski

Improve pipeline view

上级 c351b9f5
class Projects::PipelinesController < Projects::ApplicationController
before_action :pipeline, except: [:index, :new, :create]
before_action :commit, only: [:show]
before_action :authorize_read_pipeline!
before_action :authorize_create_pipeline!, only: [:new, :create]
before_action :authorize_update_pipeline!, only: [:retry, :cancel]
......@@ -85,4 +86,8 @@ class Projects::PipelinesController < Projects::ApplicationController
def pipeline
@pipeline ||= project.ci_commits.find_by!(id: params[:id])
end
def commit
@commit ||= @pipeline.commit_data
end
end
......@@ -14,8 +14,7 @@
= pluralize ci_commit.statuses.count(:id), "build"
- if ci_commit.ref
for
%span.label.label-info
= ci_commit.ref
= link_to ci_commit.ref, namespace_project_commits_path(@project.namespace, @project, ci_commit.ref), class: "monospace"
- if defined?(link_to_commit) && link_to_commit
for commit
= link_to ci_commit.short_sha, namespace_project_commit_path(@project.namespace, @project, ci_commit.sha), class: "monospace"
......
.pull-right
%div
- if @notes_count > 0
- if defined?(@notes_count) && @notes_count > 0
%span.btn.disabled.btn-grouped
%i.fa.fa-comment
= @notes_count
......@@ -42,7 +42,14 @@
- @commit.parents.each do |parent|
= 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
= 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)
......
- page_title "Pipeline"
= 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册