diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-05 14:17:42 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-06 14:13:21 +0100 |
commit | d865aedafc2282f898b4bd2fdfd3660c47203c37 (patch) | |
tree | 7d0767215b56c61e07380e5d2985e2f7ed72b077 /app/views/projects | |
parent | fa1105b10b4f5dbce46bd72eb6374fe7f8d51f56 (diff) | |
download | gitlab-ce-d865aedafc2282f898b4bd2fdfd3660c47203c37.tar.gz |
Introduce `Ci::Stage`, right now this is artificial object that is build dynamically.
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/builds/_sidebar.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/commit/_ci_stage.html.haml | 15 | ||||
-rw-r--r-- | app/views/projects/commit/_pipeline.html.haml | 14 | ||||
-rw-r--r-- | app/views/projects/pipelines/_with_tabs.html.haml | 12 | ||||
-rw-r--r-- | app/views/projects/pipelines/index.html.haml | 1 | ||||
-rw-r--r-- | app/views/projects/stage/_stage.html.haml | 14 |
6 files changed, 26 insertions, 32 deletions
diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index d5004f6a066..a45612fb28b 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.many? + - if @build.pipeline.stages_count.many? .dropdown.build-dropdown .title Stage %button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'} diff --git a/app/views/projects/commit/_ci_stage.html.haml b/app/views/projects/commit/_ci_stage.html.haml deleted file mode 100644 index 3a3d750439f..00000000000 --- a/app/views/projects/commit/_ci_stage.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -%tr - %th{colspan: 10} - %strong - %a{name: stage} - - status = statuses.latest.status - %span{class: "ci-status-link ci-status-icon-#{status}"} - = ci_icon_for_status(status) - - if stage - - = stage.titleize - = render statuses.latest_ci_stages, coverage: @project.build_coverage_enabled?, stage: false, ref: false, pipeline_link: false, allow_retry: true - = render statuses.retried_ci_stages, coverage: @project.build_coverage_enabled?, stage: false, ref: false, pipeline_link: false, retried: true -%tr - %td{colspan: 10} - diff --git a/app/views/projects/commit/_pipeline.html.haml b/app/views/projects/commit/_pipeline.html.haml index cd9ed46d2c1..2cd40bb1106 100644 --- a/app/views/projects/commit/_pipeline.html.haml +++ b/app/views/projects/commit/_pipeline.html.haml @@ -27,16 +27,15 @@ .row-content-block.build-content.middle-block.pipeline-graph.hidden .pipeline-visualization %ul.stage-column-list - - stages = pipeline.stages_with_latest_statuses - - stages.each do |stage, statuses| + - pipeline.stages.each do |stage| %li.stage-column .stage-name - %a{name: stage} - - if stage - = stage.titleize + %a{name: stage.name} + - if stage.name + = stage.name.titleize .builds-container %ul - = render "projects/commit/pipeline_stage", statuses: statuses + = render "projects/commit/pipeline_stage", statuses: stage.statuses - if pipeline.yaml_errors.present? @@ -62,5 +61,4 @@ - if pipeline.project.build_coverage_enabled? %th Coverage %th - - pipeline.stages.each do |stage| - = render 'projects/commit/ci_stage', stage: stage, statuses: pipeline.statuses.relevant.where(stage: stage) + = render pipeline.stages diff --git a/app/views/projects/pipelines/_with_tabs.html.haml b/app/views/projects/pipelines/_with_tabs.html.haml index 3464e155a1b..57e793d2e59 100644 --- a/app/views/projects/pipelines/_with_tabs.html.haml +++ b/app/views/projects/pipelines/_with_tabs.html.haml @@ -15,13 +15,12 @@ .build-content.middle-block.pipeline-graph .pipeline-visualization %ul.stage-column-list - - stages = pipeline.stages_with_latest_statuses - - stages.each do |stage, statuses| + - pipeline.stages.each do |stage| %li.stage-column .stage-name - %a{name: stage} - - if stage - = stage.titleize + %a{name: stage.name} + - if stage.name + = stage.name.titleize .builds-container %ul = render "projects/commit/pipeline_stage", statuses: statuses @@ -50,5 +49,4 @@ - if pipeline.project.build_coverage_enabled? %th Coverage %th - - pipeline.statuses.relevant.stages.each do |stage| - = render 'projects/commit/ci_stage', stage: stage, statuses: pipeline.statuses.relevant.where(stage: stage) + = render pipeline.stages diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml index 8340ce516db..e1e787dbde4 100644 --- a/app/views/projects/pipelines/index.html.haml +++ b/app/views/projects/pipelines/index.html.haml @@ -37,7 +37,6 @@ %span CI Lint %div.content-list.pipelines - - stages = @pipelines.stages - if @pipelines.blank? %div .nothing-here-block No pipelines to show diff --git a/app/views/projects/stage/_stage.html.haml b/app/views/projects/stage/_stage.html.haml new file mode 100644 index 00000000000..717075620d9 --- /dev/null +++ b/app/views/projects/stage/_stage.html.haml @@ -0,0 +1,14 @@ +%tr + %th{colspan: 10} + %strong + %a{name: subject.name} + %span{class: "ci-status-link ci-status-icon-#{subject.status}"} + = ci_icon_for_status(subject.status) + - if subject.name + + = subject.name.titleize + = render subject.statuses.latest_ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, pipeline_link: false, allow_retry: true + = render subject.statuses.retried_ordered, coverage: @project.build_coverage_enabled?, stage: false, ref: false, pipeline_link: false, retried: true +%tr + %td{colspan: 10} + |