summaryrefslogtreecommitdiff
path: root/app/views/projects
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-09-12 13:58:38 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-13 09:05:07 +0200
commit93742a439ab4492ef7a25cb9ddfd6ae004a1fc81 (patch)
tree773d1d5f10104dfa5897cea9f67884b787f4a9a7 /app/views/projects
parentd39e314cf5896ac06219446dc1ab8707f222d0d8 (diff)
downloadgitlab-ce-93742a439ab4492ef7a25cb9ddfd6ae004a1fc81.tar.gz
Code refactoring
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/builds/_table.html.haml7
-rw-r--r--app/views/projects/ci/builds/_build.html.haml10
2 files changed, 10 insertions, 7 deletions
diff --git a/app/views/projects/builds/_table.html.haml b/app/views/projects/builds/_table.html.haml
index d77405b2b1f..61eff73da26 100644
--- a/app/views/projects/builds/_table.html.haml
+++ b/app/views/projects/builds/_table.html.haml
@@ -1,4 +1,4 @@
-- admin = false unless defined?(admin)
+- admin = local_assigns.fetch(:admin, false)
- if builds.blank?
%li
@@ -19,9 +19,6 @@
%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, 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? }
+ = render partial: "projects/ci/builds/build", collection: builds, as: :build, locals: { commit_sha: true, ref: true, stage: true, allow_retry: true, coverage: admin || project.build_coverage_enabled?, admin: admin }
= paginate builds, theme: 'gitlab'
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 37e507ea00a..fd3d94bee9b 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -1,4 +1,10 @@
-- admin = false unless defined?(admin)
+- admin = local_assigns.fetch(:admin, false)
+- ref = local_assigns.fetch(:ref, nil)
+- commit_sha = local_assigns.fetch(:commit_sha, nil)
+- retried = local_assigns.fetch(:retried, false)
+- stage = local_assigns.fetch(:stage, false)
+- coverage = local_assigns.fetch(:coverage, false)
+- allow_retry = local_assigns.fetch(:allow_retry, false)
%tr.build.commit
%td.status
@@ -52,7 +58,7 @@
- if build.project
= link_to build.project.name_with_namespace, admin_namespace_project_path(build.project.namespace, build.project)
- - if defined?(runner) && runner
+ - if admin
%td
- if build.try(:runner)
= runner_link(build.runner)