[#369] projects page: fix paginate
This commit is contained in:
parent
41bfa0136a
commit
08a665ef9f
|
@ -15,9 +15,8 @@ RosaABF.controller('ProjectsCtrl', ['$scope', '$http', function($scope, $http) {
|
|||
var params = { format: 'json', page: $scope.page, search: $scope.search,
|
||||
users: $scope.filter_users, groups: $scope.filter_groups };
|
||||
$http.get(Routes.projects_path(params)).then(function(res) {
|
||||
$scope.page = res.data.page;
|
||||
$scope.total_items = parseInt(res.data.projects_count, 10);
|
||||
$scope.projects = res.data.projects;
|
||||
$scope.pages = res.data.pages;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -37,8 +37,5 @@
|
|||
%span.fa.fa-lg.fa-times.text-danger{ 'confirmed-click' => 'leave_project(item)',
|
||||
'ng-show' => 'item.can_leave_project', 'ng-confirm-click' => t('layout.confirm') }
|
||||
|
||||
= paginate( total_items: 'total_items',
|
||||
page: 'page',
|
||||
per_page: Project.per_page,
|
||||
ng_show: "total_items > #{Project.per_page}",
|
||||
select_page: "goToPage(page)" )
|
||||
= render 'shared/angularjs_will_paginate'
|
||||
|
||||
|
|
|
@ -13,5 +13,4 @@ json.projects do
|
|||
end
|
||||
end
|
||||
|
||||
json.page params[:page]
|
||||
json.projects_count @projects_count
|
||||
json.pages angularjs_will_paginate(@projects)
|
||||
|
|
Loading…
Reference in New Issue