Commit e9dbcd8a authored by Katarzyna Kobierska's avatar Katarzyna Kobierska

Use local variables in partial

parent e81ed371
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.top-area .top-area
- build_path = ->(scope) { admin_builds_path(scope: scope) } - 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 .nav-controls
- if @all_builds.running_or_pending.any? - if @all_builds.running_or_pending.any?
......
%ul.nav-links %ul.nav-links
%li{class: ('active' if @scope.nil?)} %li{class: ('active' if scope.nil?)}
= link_to build_path[nil] do = link_to build_path[nil] do
All All
%span.badge.js-totalbuilds-count %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 = link_to build_path[:pending] do
Pending Pending
%span.badge %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 = link_to build_path[:running] do
Running Running
%span.badge %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 = link_to build_path[:finished] do
Finished Finished
%span.badge %span.badge
= number_with_delimiter(@all_builds.finished.count(:id)) = number_with_delimiter(all_builds.finished.count(:id))
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%div{ class: container_class } %div{ class: container_class }
.top-area .top-area
- build_path = ->(scope) { project_builds_path(@project, scope: scope) } - 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 .nav-controls
- if can?(current_user, :update_build, @project) - if can?(current_user, :update_build, @project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment