summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-08-10 16:12:22 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-13 09:05:07 +0200
commite9dbcd8abef32884e1fa95a52e4a33d2046ef29a (patch)
treecf328c58d85bd8e6d146ffb13c30a402442ee7ca
parente81ed371a10012c2d09f67b3523c3ba3fd17c7bd (diff)
downloadgitlab-ce-e9dbcd8abef32884e1fa95a52e4a33d2046ef29a.tar.gz
Use local variables in partial
-rw-r--r--app/views/admin/builds/index.html.haml2
-rw-r--r--app/views/projects/builds/_tabs.html.haml16
-rw-r--r--app/views/projects/builds/index.html.haml2
3 files changed, 10 insertions, 10 deletions
diff --git a/app/views/admin/builds/index.html.haml b/app/views/admin/builds/index.html.haml
index 1bf4cb4d124..eb189328ab8 100644
--- a/app/views/admin/builds/index.html.haml
+++ b/app/views/admin/builds/index.html.haml
@@ -5,7 +5,7 @@
.top-area
- build_path = ->(scope) { admin_builds_path(scope: scope) }
- = render "projects/builds/tabs", build_path: build_path
+ = render "projects/builds/tabs", build_path: build_path, all_builds: @all_builds, scope: @scope
.nav-controls
- if @all_builds.running_or_pending.any?
diff --git a/app/views/projects/builds/_tabs.html.haml b/app/views/projects/builds/_tabs.html.haml
index 50894975a88..9c3173f7a1a 100644
--- a/app/views/projects/builds/_tabs.html.haml
+++ b/app/views/projects/builds/_tabs.html.haml
@@ -1,24 +1,24 @@
%ul.nav-links
- %li{class: ('active' if @scope.nil?)}
+ %li{class: ('active' if scope.nil?)}
= link_to build_path[nil] do
All
%span.badge.js-totalbuilds-count
- = number_with_delimiter(@all_builds.count(:id))
+ = number_with_delimiter(all_builds.count(:id))
- %li{class: ('active' if @scope == 'pending')}
+ %li{class: ('active' if scope == 'pending')}
= link_to build_path[:pending] do
Pending
%span.badge
- = number_with_delimiter(@all_builds.pending.count(:id))
+ = number_with_delimiter(all_builds.pending.count(:id))
- %li{class: ('active' if @scope == 'running')}
+ %li{class: ('active' if scope == 'running')}
= link_to build_path[:running] do
Running
%span.badge
- = number_with_delimiter(@all_builds.running.count(:id))
+ = number_with_delimiter(all_builds.running.count(:id))
- %li{class: ('active' if @scope == 'finished')}
+ %li{class: ('active' if scope == 'finished')}
= link_to build_path[:finished] do
Finished
%span.badge
- = number_with_delimiter(@all_builds.finished.count(:id))
+ = number_with_delimiter(all_builds.finished.count(:id))
diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml
index ec5e33366d1..3f3895e19f0 100644
--- a/app/views/projects/builds/index.html.haml
+++ b/app/views/projects/builds/index.html.haml
@@ -5,7 +5,7 @@
%div{ class: container_class }
.top-area
- build_path = ->(scope) { project_builds_path(@project, scope: scope) }
- = render "tabs", build_path: build_path
+ = render "tabs", build_path: build_path, all_builds: @all_builds, scope: @scope
.nav-controls
- if can?(current_user, :update_build, @project)