summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-05 18:16:34 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-06 14:13:22 +0100
commit401c155e16e4966be538fd14f23e268cd3383aa7 (patch)
treecebea72b9aa1dbde1580ac13f3c8f957a6e90f38
parent260d754ca89c14297e0e360d35d7914d57e290bf (diff)
downloadgitlab-ce-401c155e16e4966be538fd14f23e268cd3383aa7.tar.gz
Update stage rendering views
-rw-r--r--app/views/projects/builds/_sidebar.html.haml4
-rw-r--r--app/views/projects/commit/_pipeline.html.haml16
-rw-r--r--app/views/projects/commit/_pipeline_stage.html.haml14
-rw-r--r--app/views/projects/pipelines/_graph.html.haml4
-rw-r--r--app/views/projects/pipelines/_with_tabs.html.haml15
-rw-r--r--app/views/projects/stage/_graph.html.haml22
-rw-r--r--app/views/projects/stage/_in_stage_group.html.haml (renamed from app/views/projects/commit/_pipeline_status_group.html.haml)0
-rw-r--r--app/views/projects/stage/_stage.html.haml2
8 files changed, 35 insertions, 42 deletions
diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml
index a45612fb28b..ce8b66b1945 100644
--- a/app/views/projects/builds/_sidebar.html.haml
+++ b/app/views/projects/builds/_sidebar.html.haml
@@ -111,7 +111,7 @@
%span.label.label-primary
= tag
- - if @build.pipeline.stages_count.many?
+ - if @build.pipeline.stages_count > 1
.dropdown.build-dropdown
.title Stage
%button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'}
@@ -120,7 +120,7 @@
%ul.dropdown-menu
- @build.pipeline.stages.each do |stage|
%li
- %a.stage-item= stage
+ %a.stage-item= stage.name
.builds-container
- HasStatus::ORDERED_STATUSES.each do |build_status|
diff --git a/app/views/projects/commit/_pipeline.html.haml b/app/views/projects/commit/_pipeline.html.haml
index 2cd40bb1106..4fc5e15592a 100644
--- a/app/views/projects/commit/_pipeline.html.haml
+++ b/app/views/projects/commit/_pipeline.html.haml
@@ -25,18 +25,7 @@
= time_interval_in_words pipeline.duration
.row-content-block.build-content.middle-block.pipeline-graph.hidden
- .pipeline-visualization
- %ul.stage-column-list
- - pipeline.stages.each do |stage|
- %li.stage-column
- .stage-name
- %a{name: stage.name}
- - if stage.name
- = stage.name.titleize
- .builds-container
- %ul
- = render "projects/commit/pipeline_stage", statuses: stage.statuses
-
+ = render "projects/pipelines/graph", subject: pipeline
- if pipeline.yaml_errors.present?
.bs-callout.bs-callout-danger
@@ -61,4 +50,5 @@
- if pipeline.project.build_coverage_enabled?
%th Coverage
%th
- = render pipeline.stages
+ - pipeline.stages.each do |stage|
+ = render "projects/stage/stage", subject: stage
diff --git a/app/views/projects/commit/_pipeline_stage.html.haml b/app/views/projects/commit/_pipeline_stage.html.haml
deleted file mode 100644
index f9a9c8707f5..00000000000
--- a/app/views/projects/commit/_pipeline_stage.html.haml
+++ /dev/null
@@ -1,14 +0,0 @@
-- status_groups = statuses.sort_by(&:name).group_by(&:group_name)
-- status_groups.each do |group_name, grouped_statuses|
- - if grouped_statuses.one?
- - status = grouped_statuses.first
- - is_playable = status.playable? && can?(current_user, :update_build, @project)
- %li.build{ class: ("playable" if is_playable) }
- .curve
- .build-content
- = render "projects/#{status.to_partial_path}_pipeline", subject: status
- - else
- %li.build
- .curve
- .dropdown.inline.build-content
- = render "projects/commit/pipeline_status_group", name: group_name, subject: grouped_statuses
diff --git a/app/views/projects/pipelines/_graph.html.haml b/app/views/projects/pipelines/_graph.html.haml
new file mode 100644
index 00000000000..3bb6426c156
--- /dev/null
+++ b/app/views/projects/pipelines/_graph.html.haml
@@ -0,0 +1,4 @@
+.pipeline-visualization
+ %ul.stage-column-list
+ - subject.stages.each do |stage|
+ = render "projects/stage/graph", subject: stage
diff --git a/app/views/projects/pipelines/_with_tabs.html.haml b/app/views/projects/pipelines/_with_tabs.html.haml
index 57e793d2e59..2ace9339af3 100644
--- a/app/views/projects/pipelines/_with_tabs.html.haml
+++ b/app/views/projects/pipelines/_with_tabs.html.haml
@@ -13,17 +13,7 @@
.tab-content
#js-tab-pipeline.tab-pane
.build-content.middle-block.pipeline-graph
- .pipeline-visualization
- %ul.stage-column-list
- - pipeline.stages.each do |stage|
- %li.stage-column
- .stage-name
- %a{name: stage.name}
- - if stage.name
- = stage.name.titleize
- .builds-container
- %ul
- = render "projects/commit/pipeline_stage", statuses: statuses
+ = render "projects/pipelines/graph", subject: pipeline
#js-tab-builds.tab-pane
- if pipeline.yaml_errors.present?
@@ -49,4 +39,5 @@
- if pipeline.project.build_coverage_enabled?
%th Coverage
%th
- = render pipeline.stages
+ - pipeline.stages.each do |stage|
+ = render "projects/stage/stage", subject: stage
diff --git a/app/views/projects/stage/_graph.html.haml b/app/views/projects/stage/_graph.html.haml
new file mode 100644
index 00000000000..f1d11db58ab
--- /dev/null
+++ b/app/views/projects/stage/_graph.html.haml
@@ -0,0 +1,22 @@
+%li.stage-column
+ .stage-name
+ %a{ name: subject.name }
+ - if subject.name
+ = subject.name.titleize
+ .builds-container
+ %ul
+ - statuses = subject.statuses.latest
+ - status_groups = statuses.sort_by(&:name).group_by(&:group_name)
+ - status_groups.each do |group_name, grouped_statuses|
+ - if grouped_statuses.one?
+ - status = grouped_statuses.first
+ - is_playable = status.playable? && can?(current_user, :update_build, @project)
+ %li.build{ class: ("playable" if is_playable) }
+ .curve
+ .build-content
+ = render "projects/#{status.to_partial_path}_pipeline", subject: status
+ - else
+ %li.build
+ .curve
+ .dropdown.inline.build-content
+ = render "projects/stage/in_stage_group", name: group_name, subject: grouped_statuses
diff --git a/app/views/projects/commit/_pipeline_status_group.html.haml b/app/views/projects/stage/_in_stage_group.html.haml
index 2b26ad9d6fa..2b26ad9d6fa 100644
--- a/app/views/projects/commit/_pipeline_status_group.html.haml
+++ b/app/views/projects/stage/_in_stage_group.html.haml
diff --git a/app/views/projects/stage/_stage.html.haml b/app/views/projects/stage/_stage.html.haml
index 717075620d9..055d8fca38b 100644
--- a/app/views/projects/stage/_stage.html.haml
+++ b/app/views/projects/stage/_stage.html.haml
@@ -1,7 +1,7 @@
%tr
%th{colspan: 10}
%strong
- %a{name: subject.name}
+ %a{ name: subject.name }
%span{class: "ci-status-link ci-status-icon-#{subject.status}"}
= ci_icon_for_status(subject.status)
- if subject.name