summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-09-12 09:52:56 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-13 09:05:07 +0200
commitd39e314cf5896ac06219446dc1ab8707f222d0d8 (patch)
treee1a64d78c239de4f5e85ab66cf7be02e07515b15
parentb902a9632435ec7e4d4def609c7f0eaaf9d98535 (diff)
downloadgitlab-ce-d39e314cf5896ac06219446dc1ab8707f222d0d8.tar.gz
Improve build_path name and admin variable
-rw-r--r--app/views/admin/builds/index.html.haml4
-rw-r--r--app/views/projects/builds/_table.html.haml9
-rw-r--r--app/views/projects/builds/index.html.haml4
-rw-r--r--app/views/projects/ci/builds/_build.html.haml2
-rw-r--r--app/views/shared/builds/_tabs.html.haml8
5 files changed, 13 insertions, 14 deletions
diff --git a/app/views/admin/builds/index.html.haml b/app/views/admin/builds/index.html.haml
index 7d84172bd2e..e44e58880fa 100644
--- a/app/views/admin/builds/index.html.haml
+++ b/app/views/admin/builds/index.html.haml
@@ -4,8 +4,8 @@
%div{ class: container_class }
.top-area
- - build_path = ->(scope) { admin_builds_path(scope: scope) }
- = render "shared/builds/tabs", build_path: build_path, all_builds: @all_builds, scope: @scope
+ - build_path_proc = ->(scope) { admin_builds_path(scope: scope) }
+ = render "shared/builds/tabs", build_path_proc: build_path_proc, all_builds: @all_builds, scope: @scope
.nav-controls
- if @all_builds.running_or_pending.any?
diff --git a/app/views/projects/builds/_table.html.haml b/app/views/projects/builds/_table.html.haml
index da43dbb8d81..d77405b2b1f 100644
--- a/app/views/projects/builds/_table.html.haml
+++ b/app/views/projects/builds/_table.html.haml
@@ -1,4 +1,5 @@
-- admin = false unless admin
+- admin = false unless defined?(admin)
+
- if builds.blank?
%li
.nothing-here-block No builds to show
@@ -15,13 +16,11 @@
%th Stage
%th Name
%th
- %th
- - if !admin && project.build_coverage_enabled?
- Coverage
+ %th Coverage
%th
- if admin
- = render partial: "projects/ci/builds/build", collection: builds, as: :build, locals: { commit_sha: true, ref: true, stage: true, allow_retry: true, runner: true, admin: true }
+ = render partial: "projects/ci/builds/build", collection: builds, as: :build, locals: { commit_sha: true, ref: true, stage: true, allow_retry: true, runner: true, coverage: true, admin: true }
- else
= render partial: "projects/ci/builds/build", collection: builds, as: :build, locals: {commit_sha: true, ref: true, stage: true, allow_retry: true, coverage: project.build_coverage_enabled? }
diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml
index d2fc2ae34fe..5c60b7a7364 100644
--- a/app/views/projects/builds/index.html.haml
+++ b/app/views/projects/builds/index.html.haml
@@ -4,8 +4,8 @@
%div{ class: container_class }
.top-area
- - build_path = ->(scope) { project_builds_path(@project, scope: scope) }
- = render "shared/builds/tabs", build_path: build_path, all_builds: @all_builds, scope: @scope
+ - build_path_proc = ->(scope) { project_builds_path(@project, scope: scope) }
+ = render "shared/builds/tabs", build_path_proc: build_path_proc, all_builds: @all_builds, scope: @scope
.nav-controls
- if can?(current_user, :update_build, @project)
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index ecf15c77ad1..37e507ea00a 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -1,4 +1,4 @@
-- admin = false unless admin
+- admin = false unless defined?(admin)
%tr.build.commit
%td.status
diff --git a/app/views/shared/builds/_tabs.html.haml b/app/views/shared/builds/_tabs.html.haml
index 398ccf480d9..49ab28bd47b 100644
--- a/app/views/shared/builds/_tabs.html.haml
+++ b/app/views/shared/builds/_tabs.html.haml
@@ -1,24 +1,24 @@
%ul.nav-links
%li{class: ('active' if scope.nil?)}
- = link_to build_path.call(nil) do
+ = link_to build_path_proc.call(nil) do
All
%span.badge.js-totalbuilds-count
= number_with_delimiter(all_builds.count(:id))
%li{class: ('active' if scope == 'pending')}
- = link_to build_path.call('pending') do
+ = link_to build_path_proc.call('pending') do
Pending
%span.badge
= number_with_delimiter(all_builds.pending.count(:id))
%li{class: ('active' if scope == 'running')}
- = link_to build_path.call('running') do
+ = link_to build_path_proc.call('running') do
Running
%span.badge
= number_with_delimiter(all_builds.running.count(:id))
%li{class: ('active' if scope == 'finished')}
- = link_to build_path.call('finished') do
+ = link_to build_path_proc.call('finished') do
Finished
%span.badge
= number_with_delimiter(all_builds.finished.count(:id))