summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-07 19:30:14 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-07 19:30:14 +0100
commit8842f55201ae4725b307336686f8ab168fa0effb (patch)
tree9fd3079231ad2258374e54e6ff26168e5809be43 /app/views
parent93c72e0f71919968972e874519e01370edcce022 (diff)
downloadgitlab-ce-8842f55201ae4725b307336686f8ab168fa0effb.tar.gz
Code review
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/commit/_pipeline.html.haml5
-rw-r--r--app/views/projects/pipelines/_graph.html.haml4
-rw-r--r--app/views/projects/pipelines/_with_tabs.html.haml5
-rw-r--r--app/views/projects/stage/_graph.html.haml11
4 files changed, 12 insertions, 13 deletions
diff --git a/app/views/projects/commit/_pipeline.html.haml b/app/views/projects/commit/_pipeline.html.haml
index 4fc5e15592a..a677e859a15 100644
--- a/app/views/projects/commit/_pipeline.html.haml
+++ b/app/views/projects/commit/_pipeline.html.haml
@@ -25,7 +25,7 @@
= time_interval_in_words pipeline.duration
.row-content-block.build-content.middle-block.pipeline-graph.hidden
- = render "projects/pipelines/graph", subject: pipeline
+ = render "projects/pipelines/graph", subject: pipeline, as: :pipeline
- if pipeline.yaml_errors.present?
.bs-callout.bs-callout-danger
@@ -50,5 +50,4 @@
- if pipeline.project.build_coverage_enabled?
%th Coverage
%th
- - pipeline.stages.each do |stage|
- = render "projects/stage/stage", subject: stage
+ = render partial: "projects/stage/stage", collection: pipeline.stages, as: :stage
diff --git a/app/views/projects/pipelines/_graph.html.haml b/app/views/projects/pipelines/_graph.html.haml
index 3bb6426c156..16297b93d31 100644
--- a/app/views/projects/pipelines/_graph.html.haml
+++ b/app/views/projects/pipelines/_graph.html.haml
@@ -1,4 +1,4 @@
+- pipeline = local_assigns.fetch(:pipeline)
.pipeline-visualization
%ul.stage-column-list
- - subject.stages.each do |stage|
- = render "projects/stage/graph", subject: stage
+ = render partial: "projects/stage/graph", collection: pipeline.stages, as: :stage
diff --git a/app/views/projects/pipelines/_with_tabs.html.haml b/app/views/projects/pipelines/_with_tabs.html.haml
index 2ace9339af3..a58bcb38b18 100644
--- a/app/views/projects/pipelines/_with_tabs.html.haml
+++ b/app/views/projects/pipelines/_with_tabs.html.haml
@@ -13,7 +13,7 @@
.tab-content
#js-tab-pipeline.tab-pane
.build-content.middle-block.pipeline-graph
- = render "projects/pipelines/graph", subject: pipeline
+ = render "projects/pipelines/graph", subject: pipeline, as: :pipeline
#js-tab-builds.tab-pane
- if pipeline.yaml_errors.present?
@@ -39,5 +39,4 @@
- if pipeline.project.build_coverage_enabled?
%th Coverage
%th
- - pipeline.stages.each do |stage|
- = render "projects/stage/stage", subject: stage
+ = render partial: "projects/stage/stage", collection: pipeline.stages, as: :stage
diff --git a/app/views/projects/stage/_graph.html.haml b/app/views/projects/stage/_graph.html.haml
index f1d11db58ab..d8c87fae5a1 100644
--- a/app/views/projects/stage/_graph.html.haml
+++ b/app/views/projects/stage/_graph.html.haml
@@ -1,12 +1,13 @@
+- stage = local_assigns.fetch(:stage)
+- statuses = stage.statuses.latest
+- status_groups = statuses.sort_by(&:name).group_by(&:group_name)
%li.stage-column
.stage-name
- %a{ name: subject.name }
- - if subject.name
- = subject.name.titleize
+ %a{ name: stage.name }
+ - if stage.name
+ = stage.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