diff options
author | Annabel Dunstone <annabel.dunstone@gmail.com> | 2016-08-17 19:46:41 +0300 |
---|---|---|
committer | Annabel Dunstone <annabel.dunstone@gmail.com> | 2016-08-17 19:46:41 +0300 |
commit | 8dbb1b2fbeff6caf1ad91173d707b5f55469cb40 (patch) | |
tree | 8e0ba45e4ceab0e9c91745910090ea247d5fe89d /app | |
parent | f80aa9026f6ce7ebfb88c437163868a596b492c4 (diff) |
Move stages and jobs to build sidebar
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/build.js | 6 | ||||
-rw-r--r-- | app/views/projects/builds/_sidebar.html.haml | 36 | ||||
-rw-r--r-- | app/views/projects/builds/show.html.haml | 35 |
3 files changed, 39 insertions, 38 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 2725ddcf465..1ee4ee5f10e 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -18,7 +18,7 @@ this.bp = Breakpoints.get(); $('.js-build-sidebar').niceScroll(); - this.populateJobDropdown(build_stage); + this.populateJobs(build_stage); this.updateStageDropdownText(build_stage); this.updateJobDropdownText(build_name); this.hideSidebar(); @@ -139,7 +139,7 @@ } }; - Build.prototype.populateJobDropdown = function(stage) { + Build.prototype.populateJobs = function(stage) { $('.build-job').hide(); $('.build-job[data-stage="' + stage + '"]').show(); }; @@ -157,7 +157,7 @@ e.preventDefault(); var stage = e.target.text; this.updateStageDropdownText(stage); - this.populateJobDropdown(stage); + this.populateJobs(stage); }; return Build; diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index a8bc53c2849..47d0c93b0ba 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -11,6 +11,42 @@ %p.build-detail-row #{@build.coverage}% + - builds = @build.pipeline.builds.latest.to_a + - statuses = ["failed", "pending", "running", "canceled", "success", "skipped"] + - if builds.size > 1 + .dropdown.build-dropdown + %button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'} + %span.stage-selection More + = icon('caret-down') + %ul.dropdown-menu + - builds.map(&:stage).uniq.each do |stage| + %li + %a.stage-item= stage + + .dropdown.build-dropdown + %button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'} + %span.build-selection More + = icon('caret-down') + %ul.dropdown-menu + - statuses.each do |build_status| + - builds.select{|build| build.status == build_status}.each do |build| + %li.build-job{class: ('active' if build == @build), data: {stage: build.stage}} + = link_to namespace_project_build_path(@project.namespace, @project, build) do + = ci_icon_for_status(build.status) + %span + - if build.name + = build.name + - else + = build.id + + - if @build.retried? + %li.active + %a + Build ##{@build.id} + · + %i.fa.fa-warning + This build was retried. + - if can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?) .block{ class: ("block-first" if !@build.coverage) } .title diff --git a/app/views/projects/builds/show.html.haml b/app/views/projects/builds/show.html.haml index dba0a0a9f4e..70e02cb2d13 100644 --- a/app/views/projects/builds/show.html.haml +++ b/app/views/projects/builds/show.html.haml @@ -5,41 +5,6 @@ .build-page = render "header" - - builds = @build.pipeline.builds.latest.to_a - - statuses = ["failed", "pending", "running", "canceled", "success", "skipped"] - - if builds.size > 1 - .dropdown.build-dropdown - %button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'} - %span.stage-selection More - = icon('caret-down') - %ul.dropdown-menu - - builds.map(&:stage).uniq.each do |stage| - %li - %a.stage-item= stage - - .dropdown.build-dropdown - %button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'} - %span.build-selection More - = icon('caret-down') - %ul.dropdown-menu - - statuses.each do |build_status| - - builds.select{|build| build.status == build_status}.each do |build| - %li.build-job{class: ('active' if build == @build), data: {stage: build.stage}} - = link_to namespace_project_build_path(@project.namespace, @project, build) do - = ci_icon_for_status(build.status) - %span - - if build.name - = build.name - - else - = build.id - - - if @build.retried? - %li.active - %a - Build ##{@build.id} - · - %i.fa.fa-warning - This build was retried. - if @build.stuck? - unless @build.any_runners_online? .bs-callout.bs-callout-warning |