summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-30 12:25:42 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-01-04 10:21:10 -0200
commit567dc62b6dd114ac129eb2f45baa8155f5f11a51 (patch)
tree70c4b81ce4be54a1020bfe6d504284a3c243b46b /app
parentb9ec1aaec8c94795b92623ec85da4ba5be286c46 (diff)
downloadgitlab-ce-567dc62b6dd114ac129eb2f45baa8155f5f11a51.tar.gz
Show 'All' tab by default in the builds pageshow-all-builds-by-default
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/builds_controller.rb6
-rw-r--r--app/controllers/projects/builds_controller.rb6
-rw-r--r--app/views/admin/builds/index.html.haml10
-rw-r--r--app/views/projects/builds/index.html.haml12
4 files changed, 17 insertions, 17 deletions
diff --git a/app/controllers/admin/builds_controller.rb b/app/controllers/admin/builds_controller.rb
index 83d9684c706..0db91eaaf2e 100644
--- a/app/controllers/admin/builds_controller.rb
+++ b/app/controllers/admin/builds_controller.rb
@@ -5,12 +5,12 @@ class Admin::BuildsController < Admin::ApplicationController
@builds = @all_builds.order('created_at DESC')
@builds =
case @scope
- when 'all'
- @builds
+ when 'running'
+ @builds.running_or_pending.reverse_order
when 'finished'
@builds.finished
else
- @builds.running_or_pending.reverse_order
+ @builds
end
@builds = @builds.page(params[:page]).per(30)
end
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb
index 26ba12520c7..39d3ba26ba2 100644
--- a/app/controllers/projects/builds_controller.rb
+++ b/app/controllers/projects/builds_controller.rb
@@ -12,12 +12,12 @@ class Projects::BuildsController < Projects::ApplicationController
@builds = @all_builds.order('created_at DESC')
@builds =
case @scope
- when 'all'
- @builds
+ when 'running'
+ @builds.running_or_pending.reverse_order
when 'finished'
@builds.finished
else
- @builds.running_or_pending.reverse_order
+ @builds
end
@builds = @builds.page(params[:page]).per(30)
end
diff --git a/app/views/admin/builds/index.html.haml b/app/views/admin/builds/index.html.haml
index 52c36af6225..ddd4e1481eb 100644
--- a/app/views/admin/builds/index.html.haml
+++ b/app/views/admin/builds/index.html.haml
@@ -7,6 +7,11 @@
%ul.center-top-menu
%li{class: ('active' if @scope.nil?)}
= link_to admin_builds_path do
+ All
+ %span.badge.js-totalbuilds-count= @all_builds.count(:id)
+
+ %li{class: ('active' if @scope == 'running')}
+ = link_to admin_builds_path(scope: :running) do
Running
%span.badge.js-running-count= number_with_delimiter(@all_builds.running_or_pending.count(:id))
@@ -15,11 +20,6 @@
Finished
%span.badge.js-running-count= number_with_delimiter(@all_builds.finished.count(:id))
- %li{class: ('active' if @scope == 'all')}
- = link_to admin_builds_path(scope: :all) do
- All
- %span.badge.js-totalbuilds-count= number_with_delimiter(@all_builds.count(:id))
-
.gray-content-block
#{(@scope || 'running').capitalize} builds
diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml
index 1a26908ab11..2fa5ad80fda 100644
--- a/app/views/projects/builds/index.html.haml
+++ b/app/views/projects/builds/index.html.haml
@@ -11,6 +11,12 @@
%ul.center-top-menu
%li{class: ('active' if @scope.nil?)}
= link_to project_builds_path(@project) do
+ All
+ %span.badge.js-totalbuilds-count
+ = number_with_delimiter(@all_builds.count(:id))
+
+ %li{class: ('active' if @scope == 'running')}
+ = link_to project_builds_path(@project, scope: :running) do
Running
%span.badge.js-running-count
= number_with_delimiter(@all_builds.running_or_pending.count(:id))
@@ -21,12 +27,6 @@
%span.badge.js-running-count
= number_with_delimiter(@all_builds.finished.count(:id))
- %li{class: ('active' if @scope == 'all')}
- = link_to project_builds_path(@project, scope: :all) do
- All
- %span.badge.js-totalbuilds-count
- = number_with_delimiter(@all_builds.count(:id))
-
.gray-content-block
#{(@scope || 'running').capitalize} builds from this project