From 27c3a87194a3a29c06cf8a2dd489d28ca0b552ab Mon Sep 17 00:00:00 2001 From: Katarzyna Kobierska Date: Wed, 7 Sep 2016 12:46:29 +0200 Subject: Moved build tabs partial to shared --- app/views/admin/builds/index.html.haml | 2 +- app/views/projects/builds/_tabs.html.haml | 24 ------------------------ app/views/projects/builds/index.html.haml | 2 +- app/views/shared/_builds_tabs.html.haml | 24 ++++++++++++++++++++++++ 4 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 app/views/projects/builds/_tabs.html.haml create mode 100644 app/views/shared/_builds_tabs.html.haml diff --git a/app/views/admin/builds/index.html.haml b/app/views/admin/builds/index.html.haml index a86e054c8d4..7dba77d2dee 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, all_builds: @all_builds, scope: @scope + = render "shared/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 deleted file mode 100644 index 9c3173f7a1a..00000000000 --- a/app/views/projects/builds/_tabs.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -%ul.nav-links - %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)) - - %li{class: ('active' if scope == 'pending')} - = link_to build_path[:pending] do - Pending - %span.badge - = number_with_delimiter(all_builds.pending.count(:id)) - - %li{class: ('active' if scope == 'running')} - = link_to build_path[:running] do - Running - %span.badge - = number_with_delimiter(all_builds.running.count(:id)) - - %li{class: ('active' if scope == 'finished')} - = link_to build_path[:finished] do - Finished - %span.badge - = 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 cbcaad9e6b7..f1b3fd1bcea 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, all_builds: @all_builds, scope: @scope + = render "shared/builds_tabs", build_path: build_path, all_builds: @all_builds, scope: @scope .nav-controls - if can?(current_user, :update_build, @project) diff --git a/app/views/shared/_builds_tabs.html.haml b/app/views/shared/_builds_tabs.html.haml new file mode 100644 index 00000000000..9c3173f7a1a --- /dev/null +++ b/app/views/shared/_builds_tabs.html.haml @@ -0,0 +1,24 @@ +%ul.nav-links + %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)) + + %li{class: ('active' if scope == 'pending')} + = link_to build_path[:pending] do + Pending + %span.badge + = number_with_delimiter(all_builds.pending.count(:id)) + + %li{class: ('active' if scope == 'running')} + = link_to build_path[:running] do + Running + %span.badge + = number_with_delimiter(all_builds.running.count(:id)) + + %li{class: ('active' if scope == 'finished')} + = link_to build_path[:finished] do + Finished + %span.badge + = number_with_delimiter(all_builds.finished.count(:id)) -- cgit v1.2.1