Commit 93742a43 authored by Katarzyna Kobierska's avatar Katarzyna Kobierska

Code refactoring

parent d39e314c
- admin = false unless defined?(admin) - admin = local_assigns.fetch(:admin, false)
- if builds.blank? - if builds.blank?
%li %li
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
%th Coverage %th Coverage
%th %th
- if admin = 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 }
= 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? }
= paginate builds, theme: 'gitlab' = paginate builds, theme: 'gitlab'
- 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 %tr.build.commit
%td.status %td.status
...@@ -52,7 +58,7 @@ ...@@ -52,7 +58,7 @@
- if build.project - if build.project
= link_to build.project.name_with_namespace, admin_namespace_project_path(build.project.namespace, 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 %td
- if build.try(:runner) - if build.try(:runner)
= runner_link(build.runner) = runner_link(build.runner)
......
%ul.nav-links %ul.nav-links
%li{class: ('active' if scope.nil?)} %li{ class: ('active' if scope.nil?) }
= link_to build_path_proc.call(nil) do = link_to build_path_proc.call(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_proc.call('pending') do = link_to build_path_proc.call('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_proc.call('running') do = link_to build_path_proc.call('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_proc.call('finished') do = link_to build_path_proc.call('finished') do
Finished Finished
%span.badge %span.badge
......
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