[#369] fix a build lists pagination; small refactoring
This commit is contained in:
parent
530523611c
commit
b55342e178
|
@ -133,8 +133,9 @@ RosaABF.controller('BuildListsController',
|
|||
_.each(to_open, function(bl){ $scope.showRelated(bl, true); });
|
||||
|
||||
// Render pagination
|
||||
$scope.page = results.page;
|
||||
$scope.build_lists_count = results.build_lists_count;
|
||||
$scope.page = results.page;
|
||||
$scope.total_items = results.total_items;
|
||||
|
||||
// Enable 'Search' button
|
||||
$scope.isRequest = false;
|
||||
}).error(function(data, status, headers, config) {
|
||||
|
|
|
@ -26,7 +26,6 @@ module PaginateHelper
|
|||
{
|
||||
total_items: 'total_items',
|
||||
page: 'page',
|
||||
ng_show: "total_items > #{options[:per_page]}",
|
||||
select_page: "goToPage(page)"
|
||||
}
|
||||
)
|
||||
|
|
|
@ -70,10 +70,6 @@
|
|||
/ updated_at
|
||||
%td{'am-time-ago' => 'bl.updated_at', title: "{{bl.updated_at | amDateFormat:'ddd, LLL'}}"}
|
||||
|
||||
= paginate( total_items: 'build_lists_count',
|
||||
page: 'page',
|
||||
per_page: 'params.per_page',
|
||||
ng_show: "build_lists_count > params.per_page",
|
||||
select_page: "goToPage(page)" )
|
||||
= angularjs_paginate( per_page: 'params.per_page' )
|
||||
|
||||
= render @project ? 'projects/base/submenu' : 'projects/build_lists/submenu'
|
||||
|
|
|
@ -38,7 +38,7 @@ json.dictionary do
|
|||
end
|
||||
end
|
||||
|
||||
json.server_status @build_server_status
|
||||
json.filter @filter.try(:options)
|
||||
json.page params[:page]
|
||||
json.build_lists_count @bls.count
|
||||
json.server_status @build_server_status
|
||||
json.filter @filter.try(:options)
|
||||
json.page params[:page]
|
||||
json.total_items @bls.count
|
||||
|
|
|
@ -10,5 +10,5 @@ pagination[ boundary-links = 'true'
|
|||
items-per-page = per_page
|
||||
max-size = 5
|
||||
rotate = 'false'
|
||||
ng-show = ng_show
|
||||
ng-show = "#{total_items} > #{per_page}"
|
||||
ng-change = select_page ]
|
||||
|
|
Loading…
Reference in New Issue